samba.git
9 years agos3:smbd: add lease related helper functions to open.c
Volker Lendecke [Tue, 28 Oct 2014 22:31:46 +0000 (15:31 -0700)]
s3:smbd: add lease related helper functions to open.c

Pair-Programmed-With: Jeremy Allison <jra@samba.org>
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit ffbac2112dee9933dd34263f590f0eae28efab45)

9 years agos3:smbd: add file_find_one_fsp_from_lease_key() helper function
Volker Lendecke [Tue, 28 Oct 2014 22:31:46 +0000 (15:31 -0700)]
s3:smbd: add file_find_one_fsp_from_lease_key() helper function

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit eb9fc01d207ce29e68027f8958d4e8534f89a9e5)

9 years agos3:smb2_create: validate durable reconnects with leases
Volker Lendecke [Tue, 28 Oct 2014 22:31:46 +0000 (15:31 -0700)]
s3:smb2_create: validate durable reconnects with leases

We don't support leases yet, but prepares for the comming commits.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit d78b18dd8c510591452ebd17810261cf89868d5c)

9 years agos3:smb2_create: allow durable handles with SMB2_LEASE_HANDLE
Volker Lendecke [Tue, 28 Oct 2014 22:31:46 +0000 (15:31 -0700)]
s3:smb2_create: allow durable handles with SMB2_LEASE_HANDLE

We don't support real lease yet, but this makes use of fsp_lease_type()
which converts a batch oplock into and RWH lease.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 81a5a9e8971fad928e0a1a022e7cb841d8dbadf5)

9 years agos3:smbd: add fsp_lease_type() and get_lease_type() helper functions
Volker Lendecke [Tue, 28 Oct 2014 22:31:46 +0000 (15:31 -0700)]
s3:smbd: add fsp_lease_type() and get_lease_type() helper functions

These convert the oplock state into SMB2_LEASE_ flags.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit b72fca52defa1fd0f7d10f2811d86bbc7c661f50)

9 years agos3:vfs.h: add more elements to struct fsp_lease
Stefan Metzmacher [Wed, 3 Dec 2014 16:57:37 +0000 (17:57 +0100)]
s3:vfs.h: add more elements to struct fsp_lease

We'll need a reference to the smbd_server_connection as well
as a timeout handler.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 7ca8785cae6529fe9b8f5546aaf3c15cca9458cd)

9 years agos3:locking: add downgrade_share_lease() helper function
Volker Lendecke [Tue, 28 Oct 2014 22:31:46 +0000 (15:31 -0700)]
s3:locking: add downgrade_share_lease() helper function

Pair-Programmed-With: Jeremy Allison <jra@samba.org>
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 3e91b823e4447b936e0fafaf7807b665a51ded30)

9 years agos3:locking: cleanup leases_db from share_mode_cleanup_disconnected()
Stefan Metzmacher [Thu, 27 Nov 2014 18:32:46 +0000 (19:32 +0100)]
s3:locking: cleanup leases_db from share_mode_cleanup_disconnected()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 62e7e142aa350be8f25193bf9c39a19e354346ea)

9 years agos3:locking: ensure all share mode removal functions go through a common lease refcoun...
Jeremy Allison [Fri, 10 Oct 2014 21:32:19 +0000 (14:32 -0700)]
s3:locking: ensure all share mode removal functions go through a common lease refcount manager.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit a504b84ec147f64c428095519099104a2cb6ff1f)

9 years agos3:open_files.idl: add data structures for SMB2.1 and SMB3.0 leases.
Stefan Metzmacher [Thu, 27 Nov 2014 17:34:56 +0000 (18:34 +0100)]
s3:open_files.idl: add data structures for SMB2.1 and SMB3.0 leases.

Pair-Programmed-With: Volker Lendecke <vl@samba.org>

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 6b2f19a5e6e8b3eb2a44cd24408ba4f27cfb8745)

9 years agos3:locking: add leases_db infrastructure
Volker Lendecke [Fri, 10 Oct 2014 23:36:54 +0000 (16:36 -0700)]
s3:locking: add leases_db infrastructure

Will enable us to solve the dynamic share path problem
with leases on [homes].

We're also able to give the correct error codes when a
lease key is re-used with a different file name.

Pair-Programmed-With: Jeremy Allison <jra@samba.org>

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 14fac5dbc05823562760ac424522fb39817ec062)

9 years agos3: leases: libsmbsharemodes no longer works with SMB2 leases inside our locking...
Jeremy Allison [Thu, 4 Dec 2014 01:06:08 +0000 (17:06 -0800)]
s3: leases: libsmbsharemodes no longer works with SMB2 leases inside our locking.tdb.

Remove it until a maintainer can be found.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit a199214dfb5fc9c2b4c9e15ccb24198065c616b9)

9 years agos3:smb2_server: add smbd_smb2_send_lease_break() helper function
Volker Lendecke [Tue, 28 Oct 2014 22:31:46 +0000 (15:31 -0700)]
s3:smb2_server: add smbd_smb2_send_lease_break() helper function

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 498e7220c553155ab6e7f383d9c4377ee92774ee)

9 years agos3:smb2_server: allow smbd_smb2_send_break() with session == NULL and tcon == NULL
Stefan Metzmacher [Thu, 13 Nov 2014 10:50:14 +0000 (11:50 +0100)]
s3:smb2_server: allow smbd_smb2_send_break() with session == NULL and tcon == NULL

In future we want to use this for lease breaks and they're not attached
to a session.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit a9a39953c785e76f67ce72c776b36ad1e0130ded)

9 years agos3:smbd: Add fsp_client_guid() utility function to return the connected client guid.
Jeremy Allison [Wed, 5 Nov 2014 05:46:14 +0000 (21:46 -0800)]
s3:smbd: Add fsp_client_guid() utility function to return the connected client guid.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit c22d521d26a75a71f940088b5a01d7fa924efd88)

9 years agos3:smbd: factor out a send_break_to_none() helper function
Volker Lendecke [Tue, 28 Oct 2014 22:31:46 +0000 (15:31 -0700)]
s3:smbd: factor out a send_break_to_none() helper function

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit e761c80f65c690ce2d93c30bcd8d8d9d752096a8)

9 years agos4:torture:smb2: let smb2.lease.[v2_]complex1 check the R->NONE breaks
Stefan Metzmacher [Wed, 3 Dec 2014 21:32:33 +0000 (22:32 +0100)]
s4:torture:smb2: let smb2.lease.[v2_]complex1 check the R->NONE breaks

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 8c323f20dccb8d7a362e6ebb87fd6ec7739c336a)

9 years agos4:torture:smb2: Add smb2.lease.v2_breaking3 test.
Jeremy Allison [Tue, 2 Dec 2014 20:58:28 +0000 (12:58 -0800)]
s4:torture:smb2: Add smb2.lease.v2_breaking3 test.

This verifies the epoch handling in the multi step break.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 99f9eee657fcc1c435d00a677395e5125070bf77)

9 years agos4:torture:smb2: Add test that shows the client can respond to a lease break over...
Jeremy Allison [Mon, 1 Dec 2014 21:57:57 +0000 (13:57 -0800)]
s4:torture:smb2: Add test that shows the client can respond to a lease break over a different connection.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit c5b481a8d5ed6c7c18c14479bc0263f37ded4702)

9 years agoprofiling: Make WITH_PROFILE span more in smbprofile.h
Volker Lendecke [Thu, 2 Oct 2014 13:45:01 +0000 (13:45 +0000)]
profiling: Make WITH_PROFILE span more in smbprofile.h

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Oct  3 22:17:46 CEST 2014 on sn-devel-104

(cherry picked from commit 5496270d0f615aa39de0a083ec74fb40a988f64b)

9 years agoprofiling: Remove a big DEBUG statement
Volker Lendecke [Thu, 2 Oct 2014 13:40:35 +0000 (13:40 +0000)]
profiling: Remove a big DEBUG statement

I would like to have the freedom to play with the profiling implementation.
This is kindof in the way.

This code is from pre-SVN days:

> commit 7914e9351abb5271ebb4990c3b1fe495d15a4eda
> Author:     Jeremy Allison <jra@samba.org>
> AuthorDate: Thu Oct 5 18:50:18 2000 +0000
> Commit:     Jeremy Allison <jra@samba.org>
> CommitDate: Thu Oct 5 18:50:18 2000 +0000
>
>     Herb's fixes for profiling & compiler warnings.
>     Jeremy.

Herb, please speak up quickly if you still need this :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit f74ac712aea8d354b70966ffd3f617c65a17d8d0)

9 years agoprofiling: Remove some #ifdefs
Volker Lendecke [Thu, 2 Oct 2014 13:36:22 +0000 (13:36 +0000)]
profiling: Remove some #ifdefs

The DO_PROFILE_INC thingies already #define to nothing without
WITH_PROFILE, and any sane compiler will just not compile the if-condition
if there is no body to be executed.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 5254a7e1e5ab216a679bfbf3584bb8a16f502a2b)

9 years agoprofiling: Only compile profile/profile.c if profiling is enabled
Volker Lendecke [Tue, 30 Sep 2014 15:08:20 +0000 (15:08 +0000)]
profiling: Only compile profile/profile.c if profiling is enabled

This conditional compile avoids some #ifdef WITH_PROFILE, which makes the code
more readable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit c7c300f9710f1f207b9fa0274648ba2dc11c1ffd)

9 years agoprofiling: Only compile utils/status_profile.c if profiling is enabled
Volker Lendecke [Tue, 30 Sep 2014 15:08:20 +0000 (15:08 +0000)]
profiling: Only compile utils/status_profile.c if profiling is enabled

This conditional compile avoids some #ifdef WITH_PROFILE, which makes the code
more readable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 17c7f454813be526876ac750ceb6fd1422577495)

9 years agoprofiling: Fix a typo
Volker Lendecke [Thu, 2 Oct 2014 13:05:07 +0000 (13:05 +0000)]
profiling: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit a33b445a7d7567b27f5247cb6060edbbeecf4d52)

9 years agoprofiling: Move some #defines to profile.c
Volker Lendecke [Thu, 2 Oct 2014 12:52:05 +0000 (12:52 +0000)]
profiling: Move some #defines to profile.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 0e1b60e8c3325a1e5ea77f420326b254d5404389)

9 years agoprofiling: Fix a typo
Volker Lendecke [Tue, 30 Sep 2014 13:06:02 +0000 (13:06 +0000)]
profiling: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit d523e0b7ed67d1697a1b8ab5f58902afd2a496b3)

9 years agoprofiling: Make "struct profile_header" static
Volker Lendecke [Mon, 29 Sep 2014 15:06:37 +0000 (15:06 +0000)]
profiling: Make "struct profile_header" static

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 7c1f6c7f61f27ec8e115cdce1e2ac15addd8fb84)

9 years agos4: torture: leases - Add test for leases and blocking locks.
Jeremy Allison [Sat, 22 Nov 2014 05:28:14 +0000 (21:28 -0800)]
s4: torture: leases - Add test for leases and blocking locks.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Nov 27 19:08:24 CET 2014 on sn-devel-104

(cherry picked from commit c6a5eab3690d2926d66024a35e3c3e818d7e4935)

9 years agos4: smb2 : torture: Add new dynamic_share leases test.
Jeremy Allison [Mon, 17 Nov 2014 22:17:34 +0000 (14:17 -0800)]
s4: smb2 : torture: Add new dynamic_share leases test.

Depends on new share "dynamic_share" being set up containing an %R
in the path= statement.

Shows we will break leases and fail to grant new ones
if we get a lease_key+client guid pair match on files
with different fileid's, as can happen on dynamic shares.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 62c6c79011d7e62423fa97d4cabd9de149af8311)

9 years agos3: leases - torture test for timeout of responding to lease break request.
Jeremy Allison [Fri, 14 Nov 2014 18:24:40 +0000 (10:24 -0800)]
s3: leases - torture test for timeout of responding to lease break request.

Passes against W2K12.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit f76c7c7404c1a67389b701bd1ab24d3b2938c212)

9 years agos4:torture/smb2: smb2.lease.breaking6 test
Stefan Metzmacher [Wed, 26 Nov 2014 13:00:24 +0000 (14:00 +0100)]
s4:torture/smb2: smb2.lease.breaking6 test

The client is allowed to downgrade a lease to a lower value
than required.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit ea25f0d32a045e30d69aab4d84b15cf13a6e32ea)

9 years agos4:torture/smb2: smb2.lease.breaking5 test
Stefan Metzmacher [Wed, 26 Nov 2014 09:25:45 +0000 (10:25 +0100)]
s4:torture/smb2: smb2.lease.breaking5 test

This is like breaking4, but with an initial "R" lease instead
of "RH".

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 6494597c0451944e2599736af116d6838e6aac4e)

9 years agos4:torture/smb2: smb2.lease.breaking4 test
Stefan Metzmacher [Sat, 15 Nov 2014 10:58:01 +0000 (11:58 +0100)]
s4:torture/smb2: smb2.lease.breaking4 test

This demonstrates that a confliciting open with NTCREATEX_DISP_OVERWRITE
isn't delayed by a "RH" lease, even if a lease is in 'breaking' mode.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit b3a985ab6662cacb2ac399c667b48e03c0bd1bfe)

9 years agos4:torture/smb2: smb2.lease.breaking3 test
Stefan Metzmacher [Wed, 12 Nov 2014 14:43:56 +0000 (15:43 +0100)]
s4:torture/smb2: smb2.lease.breaking3 test

This demonstrates a race case where the client reuses a lease,
while the server already sent a break.

The open succeeds with SMB2_LEASE_FLAG_BREAK_IN_PROGRESS being set.

This is more complex that smb2.lease.breaking[1-2] as it generates breaks
from RWH => RH => R => NONE.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 8d16a2e36762f6da825106798689c96aff95437f)

9 years agos4:torture/smb2: smb2.lease.breaking2 test
Stefan Metzmacher [Sat, 15 Nov 2014 10:58:01 +0000 (11:58 +0100)]
s4:torture/smb2: smb2.lease.breaking2 test

This demonstrates that a conflicting open with NTCREATEX_DISP_OVERWRITE
breaks a lease to NONE.

It also shows which error codes are generated for unexpected lease break acks.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 5a652dbb92231183070b2d139d3459be8fd89439)

9 years agos4:torture/smb2: smb2.lease.breaking1 test
Stefan Metzmacher [Wed, 12 Nov 2014 14:43:56 +0000 (15:43 +0100)]
s4:torture/smb2: smb2.lease.breaking1 test

This demonstrates a race case where the client reuses a lease,
while the server already sent a break.

The open succeeds with SMB2_LEASE_FLAG_BREAK_IN_PROGRESS being set.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit a7a59b16a4920181fd0e2484c24b448ff8642e88)

9 years agos4:torture/smb2: make it possible to skip the automatic ack of lease breaks.
Stefan Metzmacher [Wed, 12 Nov 2014 14:43:56 +0000 (15:43 +0100)]
s4:torture/smb2: make it possible to skip the automatic ack of lease breaks.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 0c239d32094f8cc20bd36b55a4d08f57d04bd263)

9 years agos4:torture/smb2: add smb2.lease.v2_epoch[2|3] tests
Stefan Metzmacher [Wed, 12 Nov 2014 08:53:45 +0000 (09:53 +0100)]
s4:torture/smb2: add smb2.lease.v2_epoch[2|3] tests

They demonstrate that the lease version (v1 or v2) is selected
by the first open. All following opens using the other version
still get the lease version of the first open.

This implies that the server has to remember the lease version
more globaly.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit c18c84ca6ca04815e8ffedb3d6f8abadad06500b)

9 years agos4:torture/smb2: add smb2.lease.[v2_]complex1 tests
Stefan Metzmacher [Tue, 11 Nov 2014 18:35:59 +0000 (19:35 +0100)]
s4:torture/smb2: add smb2.lease.[v2_]complex1 tests

These tests verify the lease state is consistent between two connections
with the same client_guid.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 45c98b8069f6b94115616d7fddef515c76d7767e)

9 years agos4:torture/smb2: pass the expected flags to CHECK_LEASE()
Stefan Metzmacher [Wed, 12 Nov 2014 14:41:50 +0000 (15:41 +0100)]
s4:torture/smb2: pass the expected flags to CHECK_LEASE()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 90c886e9656a1360ffdb8eaa80ad2b6c987f73ef)

9 years agos4:torture/smb2: don't check the lease break connection against samba3
Stefan Metzmacher [Wed, 12 Nov 2014 08:15:58 +0000 (09:15 +0100)]
s4:torture/smb2: don't check the lease break connection against samba3

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit a9d46264ab3eb53cf4a70edf4e5dad2fe6d86e6c)

9 years agos4:torture/smb2: always verify the v2 lease epoch.
Stefan Metzmacher [Tue, 11 Nov 2014 18:35:07 +0000 (19:35 +0100)]
s4:torture/smb2: always verify the v2 lease epoch.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit c0f2b46d69dc7e729bac766785b26a1911a80825)

9 years agos4:torture/smb2: verify lease_flags in CHECK_LEASE_BREAK()
Stefan Metzmacher [Wed, 12 Nov 2014 16:00:44 +0000 (17:00 +0100)]
s4:torture/smb2: verify lease_flags in CHECK_LEASE_BREAK()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 8fa2fb7dde10640ded645d8180d441012dbad155)

9 years agos4:torture/smb2: lease per test fnames
Stefan Metzmacher [Wed, 12 Nov 2014 06:24:16 +0000 (07:24 +0100)]
s4:torture/smb2: lease per test fnames

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 2742257be693d57c075523e2691137692aa9e34a)

9 years agos4:torture/smb2: make lease tests more reliable by calling torture_wait_for_lease_break()
Stefan Metzmacher [Wed, 12 Nov 2014 06:23:31 +0000 (07:23 +0100)]
s4:torture/smb2: make lease tests more reliable by calling torture_wait_for_lease_break()

They now work against w2k8r2, w2012, w2012r2.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 34926bd4bd13ea6518273e94473fbb47b7cf565e)

9 years agos4:torture/smb2: skip lease tests if the server doesn't support them
Stefan Metzmacher [Wed, 12 Nov 2014 06:19:49 +0000 (07:19 +0100)]
s4:torture/smb2: skip lease tests if the server doesn't support them

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 683b9569487bd30ecd0ba677367dbe9e0eff16c2)

9 years agos4:libcli/smb2: initialize ls->lease_version
Stefan Metzmacher [Wed, 12 Nov 2014 10:13:15 +0000 (11:13 +0100)]
s4:libcli/smb2: initialize ls->lease_version

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 38b0fded58f9e066ad7190f7797cdfb92d3d23ff)

9 years agos4:libcli/smb2: add new_epoch to struct smb2_lease_break
Stefan Metzmacher [Tue, 11 Nov 2014 18:33:13 +0000 (19:33 +0100)]
s4:libcli/smb2: add new_epoch to struct smb2_lease_break

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 3327615c23fbfd26b572b01acfe7e1402f018a16)

9 years agos4:param: don't expand PROTOCOL_DEFAULT in lpcfg_smbcli_options()
Stefan Metzmacher [Thu, 20 Nov 2014 13:38:09 +0000 (14:38 +0100)]
s4:param: don't expand PROTOCOL_DEFAULT in lpcfg_smbcli_options()

We let the low-level smb1 or smb2 code assign what PROTOCOL_DEFAULT means.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit d7669ea451fa445b6ec77fa08d951fa59b08ab5f)

9 years agos4:libcli/smb2: allow the caller to specify a specific value for max_protocol.
Stefan Metzmacher [Thu, 20 Nov 2014 13:35:38 +0000 (14:35 +0100)]
s4:libcli/smb2: allow the caller to specify a specific value for max_protocol.

The default is still PROTOCOL_LATEST. As smb2_connect*() is about SMB2/3 only
we upgrade to PROTOCOL_LATEST if PROTOCOL_NT1 or lower is given.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit d0a1995b934895ae9f0bbeed52772a4ef5d4b0dd)

9 years agos4:libcli/raw: fix up the max_protocol value for the current transport connection
Stefan Metzmacher [Thu, 20 Nov 2014 13:32:40 +0000 (14:32 +0100)]
s4:libcli/raw: fix up the max_protocol value for the current transport connection

This allows the caller to pass PROTOCOL_DEFAULT,
which results in PROTOCOL_NT1.

As smbcli_transport_init() is about SMB1 only we downgrade
to PROTOCOL_NT1 if a higher value (for SMB2 or SMB3) was given.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit bc83e45a19deccfb0106c9ad79b0624b1c5d1fa7)

9 years agos4:libcli/smb_composite: use the options on the transport
Stefan Metzmacher [Thu, 20 Nov 2014 13:30:31 +0000 (14:30 +0100)]
s4:libcli/smb_composite: use the options on the transport

These are the options which really belong to the connection
and might not be the the same as the hints given from the caller.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 55750f010423b0548e9d6b8f5745d7ad5fc4b773)

9 years agos3:smb2_create: send interim responses after 0.5 milliseconds
Stefan Metzmacher [Thu, 13 Nov 2014 11:10:46 +0000 (12:10 +0100)]
s3:smb2_create: send interim responses after 0.5 milliseconds

We don't have to care about delayed NT_STATUS_SHARING_VIOLATION anymore
after the following commit:

    commit 4111fcfd4f570d39d46a0d414546ca62c7b609be
    Author: Jeremy Allison <jra@samba.org>
    Date:   Thu May 2 11:12:47 2013 -0700

        Only do the 1 second delay for sharing violations for SMB1, not SMB2.

        Match Windows behavior.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit fe0ad5c66884da5e7cba5c7b0d40a8c41cf6a63b)

9 years agoRevert "libcli/smb: mask off SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET for version 1"
Stefan Metzmacher [Wed, 26 Nov 2014 10:06:16 +0000 (11:06 +0100)]
Revert "libcli/smb: mask off SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET for version 1"

This reverts commit a6affb7bb3ff595165e708c56ede2181f0bb570f.

This is not really needed. The caller should ignore this flag.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 334089c1015ca35ee37d4c9bf5da455e72c3e86e)

9 years agos3:smb2_break: First test for NT_STATUS_INVALID_OPLOCK_PROTOCOL, then for in_oplock_l...
Volker Lendecke [Tue, 23 Sep 2014 16:49:46 +0000 (18:49 +0200)]
s3:smb2_break: First test for NT_STATUS_INVALID_OPLOCK_PROTOCOL, then for in_oplock_level being reasonable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov 12 00:03:34 CET 2014 on sn-devel-104

(cherry picked from commit 2d44498740d98edd9d09f12d35dc91d8d17e0c62)

9 years agos3:locking: convert brl_have_read field to brl_num_read.
Volker Lendecke [Tue, 28 Oct 2014 22:27:09 +0000 (15:27 -0700)]
s3:locking: convert brl_have_read field to brl_num_read.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 837e29035c911f3509135252c3f423d0f56b606d)

9 years agos3:smbd: Don't set fsp->oplock_type before we've granted any oplocks.
Jeremy Allison [Thu, 23 Oct 2014 00:53:01 +0000 (17:53 -0700)]
s3:smbd: Don't set fsp->oplock_type before we've granted any oplocks.

It's not needed, and may lead to unexpected side effects.

grant_fsp_oplock_type() is the only place to touch this.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 1020c5942a996e3e900e2b81f9964dd61fc9c71d)

9 years agos3:smbd: move all oplock granting code to grant_fsp_oplock_type()
Volker Lendecke [Tue, 28 Oct 2014 22:27:09 +0000 (15:27 -0700)]
s3:smbd: move all oplock granting code to grant_fsp_oplock_type()

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Pair-Programmed-With: Jeremy Allison <jra@samba.org>

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit a08b0e78220f84f87b2af1535d645a994a5c93ab)

9 years agos3:smbd: break oplocks to none with FILE_OVERWRITE
Volker Lendecke [Tue, 23 Sep 2014 21:34:14 +0000 (23:34 +0200)]
s3:smbd: break oplocks to none with FILE_OVERWRITE

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 87a102189bf2d87e39dd1762fff92465aa7be5ec)

9 years agolibcli/smb: Add smb2_lease_equal() which compares client_guids and keys.
Jeremy Allison [Wed, 5 Nov 2014 05:44:45 +0000 (21:44 -0800)]
libcli/smb: Add smb2_lease_equal() which compares client_guids and keys.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Nov  7 22:41:47 CET 2014 on sn-devel-104

(cherry picked from commit dbb191f35bb093ad7fc8839b3d47e508be8f6069)

9 years agolibcli/smb: add smb2_lease_key_equal() helper function
Volker Lendecke [Wed, 29 Oct 2014 12:55:16 +0000 (13:55 +0100)]
libcli/smb: add smb2_lease_key_equal() helper function

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 2fc8f761c188b1abc90df68003b05b7a098aeabe)

9 years agolibcli/smb: mask off SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET for version 1
Volker Lendecke [Mon, 22 Sep 2014 19:21:36 +0000 (21:21 +0200)]
libcli/smb: mask off SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET for version 1

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit a6affb7bb3ff595165e708c56ede2181f0bb570f)

9 years agolibcli/smb: remember the lease_version in struct smb2_lease
Volker Lendecke [Tue, 23 Sep 2014 20:56:41 +0000 (22:56 +0200)]
libcli/smb: remember the lease_version in struct smb2_lease

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 171cefe48fe1d312c60426c09876700a07d45547)

9 years agos4:torture: Add smb2.oplock test batch9a and raw.oplock test batch9a
Jeremy Allison [Wed, 5 Nov 2014 18:12:20 +0000 (10:12 -0800)]
s4:torture: Add smb2.oplock test batch9a and raw.oplock test batch9a

Shows attribute(stat) access open can create a file,
and subsequent attribute(stat) opens don't break oplocks.

Can be extended to explore more varients.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 8db5150143c4770bf2ffc40a5234f7b090ec8208)

9 years agos3-winbindd: Allow winbindd to connect over SMB2 to servers
Andrew Bartlett [Tue, 23 Sep 2014 21:08:10 +0000 (14:08 -0700)]
s3-winbindd: Allow winbindd to connect over SMB2 to servers

This allows SMB signing to work against many more DCs, and so improves network security.

The default for "client max protocol" remains NT1 in the rest of the code.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 14f6256c515ff4af4f478f947ad89b7edc8743cf)

9 years agopam_winbind: fix warn_pwd_expire implementation.
Günther Deschner [Wed, 3 Dec 2014 15:55:39 +0000 (16:55 +0100)]
pam_winbind: fix warn_pwd_expire implementation.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=9056

warn_pwd_expire parameter is not working as documented in pam_winbind manual
page. This patch adds missing bit and allows disabling warning message fully,
i.e. setting warn time to zero days.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Dec  3 21:36:49 CET 2014 on sn-devel-104

9 years agolibcli: SMB2: Pure SMB2-only negprot fix to make us behave as a Windows client does.
Jeremy Allison [Wed, 26 Nov 2014 21:15:24 +0000 (13:15 -0800)]
libcli: SMB2: Pure SMB2-only negprot fix to make us behave as a Windows client does.

Required as some servers return zero when asked for
zero credits in an initial SMB2-only negprot.

Back-port of c426f97238e4f664d1b13781101ca9c942aa7d0d
from master.

https://bugzilla.samba.org/show_bug.cgi?id=10966

Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Thu Dec  4 05:42:28 CET 2014 on sn-devel-104

9 years agoldb: version 1.1.18
Stefan Metzmacher [Sat, 29 Nov 2014 10:43:53 +0000 (11:43 +0100)]
ldb: version 1.1.18

This release contains:

- fixes for segfaults in pyldb
- documentation fixes
- build system improvements

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sat Nov 29 14:45:56 CET 2014 on sn-devel-104

(cherry picked from commit 13a1406fa11f4c7eb1996a5ac1e33c966b886082)

The last 13 patches address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10975
We need to backport ldb-1.1.18 to v4-2-test...

9 years agolib-pyldb: Block elements should be surrounded by {} in py_msg.setitem()
Kamen Mazdrashki [Thu, 20 Nov 2014 03:07:47 +0000 (04:07 +0100)]
lib-pyldb: Block elements should be surrounded by {} in py_msg.setitem()

Change-Id: I0d09374b27708fcaad3523d985a2db7983dbd81a
Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Nov 25 07:24:12 CET 2014 on sn-devel-104

(cherry picked from commit 30c07907749063d0b0c663f1b43b02b4c6b0049d)

9 years agolib-pyldb: Fix docstring for msg.add() method - it was "S.append()"
Kamen Mazdrashki [Thu, 20 Nov 2014 03:06:01 +0000 (04:06 +0100)]
lib-pyldb: Fix docstring for msg.add() method - it was "S.append()"

Change-Id: I9492d3c3993fc3d68d7bf24405db6e8cd746eaac
Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 322320889c60f31cc536342bc9a54ae258f41139)

9 years agolib-ldb-test: Test copying message element from a message to a new message
Kamen Mazdrashki [Tue, 25 Nov 2014 02:50:52 +0000 (03:50 +0100)]
lib-ldb-test: Test copying message element from a message to a new message

Change-Id: Iefcafb418a170ee410aec900bb36eb8e01e946b1
Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 1d14af77299e88b5f0d3230ec0481ed5abaf4bdd)

9 years agolib-pyldb: Avoid crash when copying MessageElements between Python Message objects
Kamen Mazdrashki [Wed, 12 Nov 2014 00:17:56 +0000 (01:17 +0100)]
lib-pyldb: Avoid crash when copying MessageElements between Python Message objects

This patch allows for following snipets in Python:
  res = ldb.search(...)
  m_from = res[0]
  m_to = Message()
  m_to.add(m_from["attrName"])

The problem previously is that we are trying to reference a
ldb_message_element that may not be a memory context on its own.
For instance, when search request from above example returns
Messages with more than one attribute, this leads immediately
to "Bad talloc magic value" crash, every message element beside
the first one is not a memory context

Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 2d67335f681a60a636e48107d908778806a0b15f)

9 years agolib-ldb_ldif: Stop processing if ldb_message element name is NULL
Kamen Mazdrashki [Wed, 12 Nov 2014 00:12:31 +0000 (01:12 +0100)]
lib-ldb_ldif: Stop processing if ldb_message element name is NULL

I have hit this while using Python bindings for testing and
forgot to pass 'name' argument to MessageElement constructor
Passing NULL as 'name' is obviously a mistake and this commits
aims to warn about such unintetional mistakes.

Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 7f121d3860ee3289f5fd397ab3312634d11cb2f2)

9 years agolib-ldb: Check for input parameter when searching attributes by name
Kamen Mazdrashki [Tue, 11 Nov 2014 01:56:32 +0000 (02:56 +0100)]
lib-ldb: Check for input parameter when searching attributes by name

This prevents a segfault that is hard to be tracked down from
Python bindings for instance.

Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit ea7778697e22ffbe22634974144c6e5c142a85d6)

9 years agolib-pyldb: Throw exception when we can't create MessageElement object
Kamen Mazdrashki [Mon, 10 Nov 2014 21:59:07 +0000 (22:59 +0100)]
lib-pyldb: Throw exception when we can't create MessageElement object

At the moment we return an error, but no exception and it is
hard to instantly see what the problem is from Python

Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 4d25dfd611e7786a17975fcaed039be971bac7da)

9 years agolib-pyldb: Avoid leaking memory in error cases
Kamen Mazdrashki [Sun, 9 Nov 2014 03:31:36 +0000 (04:31 +0100)]
lib-pyldb: Avoid leaking memory in error cases

Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 18f879b857c174371a9fe27722c70051ed68ed64)

9 years agolib-pyldb: Avoid SEGFAULT in case we can't convert passed value to py_String
Kamen Mazdrashki [Sun, 9 Nov 2014 03:28:47 +0000 (04:28 +0100)]
lib-pyldb: Avoid SEGFAULT in case we can't convert passed value to py_String

Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit a48b533ea5c9faae3429b0fb680b52b14676cd22)

9 years agolib/ldb: remove unused 'allow_warnings=True'
Stefan Metzmacher [Wed, 29 Oct 2014 10:56:25 +0000 (11:56 +0100)]
lib/ldb: remove unused 'allow_warnings=True'

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 94fadfc89bab0c28f5c126c653569c5f1b99a64e)

9 years agolib/ldb: fix compiler warnings in ldb_tdb.c
Stefan Metzmacher [Wed, 29 Oct 2014 10:53:06 +0000 (11:53 +0100)]
lib/ldb: fix compiler warnings in ldb_tdb.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 8ac49f9f05415a49619e160c468a3fa261b0320b)

9 years agolib/ldb: fix compiler warnings in ldb_modules_list_from_string()
Stefan Metzmacher [Wed, 29 Oct 2014 10:52:37 +0000 (11:52 +0100)]
lib/ldb: fix compiler warnings in ldb_modules_list_from_string()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit edc6a89398f1fff9de55e77e84b441bfab955869)

9 years agotdb: version 1.3.3
Stefan Metzmacher [Tue, 2 Dec 2014 07:42:18 +0000 (08:42 +0100)]
tdb: version 1.3.3

This fixes the tdb1-run-mutex-openflags2 test when robust mutexes are available.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10781

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Dec  2 11:54:28 CET 2014 on sn-devel-104

(cherry picked from commit 1e32ada8ec1a2699caa1e813782cfc8a1c50f690)

9 years agotdb/test: TDB_CLEAR_IF_FIRST | TDB_MUTEX_LOCKING, O_RDONLY is a valid combination
Stefan Metzmacher [Tue, 2 Dec 2014 07:39:05 +0000 (08:39 +0100)]
tdb/test: TDB_CLEAR_IF_FIRST | TDB_MUTEX_LOCKING, O_RDONLY is a valid combination

This used to be invalid in the early developement code, but now we're
able to open a tdb with mutex area and TDB_NOLOCK without problems.
O_RDONLY implies TDB_NOLOCK...

This should have been part of commit c8d05e934ea03fffbc34944d2d51a016b89a7eca.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10781

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 6244346c11c40b3ed39ee626e1d27c75a29b7430)

9 years agotdb: version 1.3.2
Stefan Metzmacher [Sat, 29 Nov 2014 10:37:54 +0000 (11:37 +0100)]
tdb: version 1.3.2

The following bugs are fixed with this release:

- Bug 10625 - tdb.h missing include of stdbool.h
- Bug 10781 - smbstatus: locking.tdb - TDB_MUTEX_LOCKING requires TDB_CLEAR_IF_FIRST
- Bug 10968 - tdb mutex runtime test clobbers stdout

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10625
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10781
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10968

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit e6c766848c5f5f13584f3bc4c1670c76e7ff8472)

9 years agotdb: Fix tdb_runtime_check_for_robust_mutexes()
Volker Lendecke [Wed, 26 Nov 2014 15:35:19 +0000 (15:35 +0000)]
tdb: Fix tdb_runtime_check_for_robust_mutexes()

When using exit() instead of _exit(), the child will flush buffered stdout
(and other stdio) content that it inherited from the parent process. In
make test, this led to duplicate output from net registry which then
confused the blackbox selftest.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 42b2e5ca8c9b85e6fce71529bef5d6b3ba4f4a38)

9 years agotdb: allow tdb_open_ex() with O_RDONLY of TDB_FEATURE_FLAG_MUTEX tdbs.
Stefan Metzmacher [Tue, 4 Nov 2014 08:51:51 +0000 (09:51 +0100)]
tdb: allow tdb_open_ex() with O_RDONLY of TDB_FEATURE_FLAG_MUTEX tdbs.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10781

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit c8d05e934ea03fffbc34944d2d51a016b89a7eca)

9 years agovfs_streams_xattr: check stream type
Ralph Boehme [Fri, 21 Nov 2014 13:56:08 +0000 (14:56 +0100)]
vfs_streams_xattr: check stream type

Only allow access to the stream type "$DATA". vfs_streams_depot does
this too and it fixes the failing test "smb2.streams.names".

Backport of 927290b384bc4f4fd53a1f93d4d27ccc71dd6135 from master.
https://bugzilla.samba.org/show_bug.cgi?id=10971

Signed-off-by: Ralph Boehme <slow@samba.org>
9 years agovfs_streams_xattr: initialize pointer
Ralph Boehme [Fri, 21 Nov 2014 13:54:17 +0000 (14:54 +0100)]
vfs_streams_xattr: initialize pointer

Intitialize pointer to NULL, otherwise we talloc_free() an unitialized
pointer in the error code path.

Backport of 1076e4e4e2a2b6238116bd860b03a9dcc8a151f8 from master.
https://bugzilla.samba.org/show_bug.cgi?id=10971

Signed-off-by: Ralph Boehme <slow@samba.org>
9 years agovfs_streams_xattr: fix check with samba_private_attr_name()
Ralph Boehme [Thu, 20 Nov 2014 15:33:22 +0000 (16:33 +0100)]
vfs_streams_xattr: fix check with samba_private_attr_name()

We want to check with samba_private_attr_name() whether the xattr name
is a private one, unfortunately it flags xattrs that begin with the
default streams prefix as private.  By only calling
samba_private_attr_name() in case the xattr does NOT begin with the
default prefix, we know that if it returns 'true' it definitely one of
our internal xattr like "user.DOSATTRIB".

This fixes a bug introduced in 634bcb09a08b927fd79ae0e16aeee2a123605f94
that denied all access to valid stream xattrs.

Backport of 1160fcfe3d97644a6bcfa9ee687fd7dfca58e812 from master.
https://bugzilla.samba.org/show_bug.cgi?id=10971

Signed-off-by: Ralph Boehme <slow@samba.org>
9 years agos4-rpc: dnsserver: Fix enumeration of IPv4 and IPv6 addresses
Guenter Kukkukk [Fri, 21 Nov 2014 15:57:45 +0000 (16:57 +0100)]
s4-rpc: dnsserver: Fix enumeration of IPv4 and IPv6 addresses

In the initial implementation only IPv4 addresses were supported.

Add IPv6 (and mixed IPv4/IPv6) support and all further needed conversion
routines to support w2k, dotnet, longhorn clients.

Signed-off-by: Guenter Kukkukk <linux@kukkukk.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Wed Nov 26 03:44:07 CET 2014 on sn-devel-104

(cherry picked from commit 3ac4355f3e7f79bc0045c43bc818697dc6b08850)

The last 3 patches address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10952
samba-tool dns serverinfo <server> is broken for IPv6 - also in mixed IPv4/IPv6
environments.

9 years agosamba-tool: Fix the IP output of "samba-tool dns serverinfo <some_server>"
Guenter Kukkukk [Fri, 21 Nov 2014 02:55:25 +0000 (03:55 +0100)]
samba-tool: Fix the IP output of "samba-tool dns serverinfo <some_server>"

Avoid hardcoded IP-strings, use standard python IP functions to format
IPv4 and IPv6 addresses correctly.

I have removed the display of the port number.
MS-DNSP 2.2.3.2.2.1 DNS_ADDR: (from May 15, 2014)
Port Number (2bytes): Senders MUST set this to zero, and receivers MUST ignore
it.

Signed-off-by: Guenter Kukkukk <linux@kukkukk.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit d5af53c5372866a33a0195cabbd64232ac53bad4)

9 years agosamba-tool: Fix enum values in dns.py
Guenter Kukkukk [Fri, 21 Nov 2014 02:40:17 +0000 (03:40 +0100)]
samba-tool: Fix enum values in dns.py

DNS_ZONE_UPDATE_SECURE was used twice, DNS_ZONE_UPDATE_UNSECURE was missing.

Signed-off-by: Guenter Kukkukk <linux@kukkukk.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 4bda589c8e68cd66ca3b0ea9496cb1b11febcae6)

9 years agoparam: fix testparm to show hidden share defaults
Garming Sam [Thu, 27 Nov 2014 21:03:29 +0000 (10:03 +1300)]
param: fix testparm to show hidden share defaults

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10864
Change-Id: I16710f70a3cbaeadf7adf139441dd2b017ef81ee
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Fri Nov 28 07:54:54 CET 2014 on sn-devel-104

(cherry picked from commit 907094c7fa73aaf2e9dda184ea4f0c1a606300bc)

9 years agos3-smbstatus: Fix exit code of profile output.
Andreas Schneider [Mon, 24 Nov 2014 16:46:27 +0000 (17:46 +0100)]
s3-smbstatus: Fix exit code of profile output.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10961

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Thu Nov 27 12:04:19 CET 2014 on sn-devel-104

9 years agos3-smbclient: Return success if we listed the shares.
Andreas Schneider [Mon, 24 Nov 2014 15:26:13 +0000 (16:26 +0100)]
s3-smbclient: Return success if we listed the shares.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10960

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4-dns: dlz-bind: Add trailing '.' to all fqdn strings
Amitay Isaacs [Mon, 3 Nov 2014 00:57:50 +0000 (11:57 +1100)]
s4-dns: dlz-bind: Add trailing '.' to all fqdn strings

BIND 9.10.x is strict when sending records via putrr and putnamedrr.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10620

Thanks to Guenter Kukkukk for identifying the problem and resolution.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Guenter Kukkukk <kukks@samba.org>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Nov 21 06:14:55 CET 2014 on sn-devel-104

(cherry picked from commit b7f6b09a13daaa702aef5a0ab9f458521e4902b1)

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Mon Nov 24 23:35:13 CET 2014 on sn-devel-104

9 years agos4-dns: Add support for BIND 9.10
Amitay Isaacs [Mon, 20 Oct 2014 05:32:42 +0000 (16:32 +1100)]
s4-dns: Add support for BIND 9.10

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Matthieu Patou <mat@matws.net>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Sat Oct 25 05:42:19 CEST 2014 on sn-devel-104

(cherry picked from commit faa3423d1a26eb6103389b234add0f1e8d0dfc08)

9 years agos4-dns: Update dlz_minimal.h based on BIND release 9.10
Amitay Isaacs [Mon, 20 Oct 2014 04:31:30 +0000 (15:31 +1100)]
s4-dns: Update dlz_minimal.h based on BIND release 9.10

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Matthieu Patou <mat@matws.net>
(cherry picked from commit aeb6ad8a9c2713c6c71a2ac4cd355dd1bda6cc51)

9 years agos4-dns: Check DLZ_DLOPEN_VERSION for different BIND versions
Amitay Isaacs [Sun, 19 Oct 2014 01:57:55 +0000 (12:57 +1100)]
s4-dns: Check DLZ_DLOPEN_VERSION for different BIND versions

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Matthieu Patou <mat@matws.net>
(cherry picked from commit 1e5c14548c8d03f66aaa908654c94f36a94455f2)

9 years agos4-dns: Update template variables, change BIND98 --> BIND9_8
Amitay Isaacs [Mon, 20 Oct 2014 05:40:05 +0000 (16:40 +1100)]
s4-dns: Update template variables, change BIND98 --> BIND9_8

This makes it easier to add suport for BIND 9.10.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Matthieu Patou <mat@matws.net>
(cherry picked from commit 58334eb58ed2f11c6f212481b6be772d9f182810)