vlendec/samba-autobuild/.git
5 years agoctdb-tests: Update integration tests to use ctdb -X
Martin Schwenke [Thu, 20 Nov 2014 04:03:25 +0000 (15:03 +1100)]
ctdb-tests: Update integration tests to use ctdb -X

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-tools: Update onnode and ctdb-diagnostics to use ctdb -X
Martin Schwenke [Thu, 20 Nov 2014 03:39:59 +0000 (14:39 +1100)]
ctdb-tools: Update onnode and ctdb-diagnostics to use ctdb -X

Also update onnode unit tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-scripts: Update eventscripts to use ctdb -X instead of ctdb -Y
Martin Schwenke [Thu, 20 Nov 2014 03:32:46 +0000 (14:32 +1100)]
ctdb-scripts: Update eventscripts to use ctdb -X instead of ctdb -Y

Also update associated eventscript unit tests and ctdb stub.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-tools: Add -X option for machine parsable output with separator '|'
Martin Schwenke [Wed, 19 Nov 2014 07:19:50 +0000 (18:19 +1100)]
ctdb-tools: Add -X option for machine parsable output with separator '|'

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-tools: Add -x option to specify delimiter for machine readable output
Martin Schwenke [Wed, 19 Nov 2014 06:15:21 +0000 (17:15 +1100)]
ctdb-tools: Add -x option to specify delimiter for machine readable output

To support this, update printm() to replace ':' in format string with
options.machineseparator, which is a string but must contain a single
character.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-tools: Produce machine readable output with new function printm()
Martin Schwenke [Wed, 19 Nov 2014 05:35:35 +0000 (16:35 +1100)]
ctdb-tools: Produce machine readable output with new function printm()

printm() is a printf(3) replacement and must be used to printing any
machine readable output.  It currently just calls vprintf(3).  Later
it will change the field delimiter.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoinotify: Properly handle cross-dir renames
Volker Lendecke [Fri, 5 Dec 2014 15:38:45 +0000 (15:38 +0000)]
inotify: Properly handle cross-dir renames

When watching two subdirectories with inotify and a file is moved between both,
we get a IN_MOVED_FROM for the source watch and a IN_MOVED_TO for the
destination watch. Without this patch we create a NOTIFY_ACTION_OLD_NAME for
the old directory. We hold this back in notify_fsp, expecting the NEW_NAME
immediately after it. In the cross-directory rename case this does not work,
we'll not get the NEW_NAME, there is no NEW_NAME in that directory.

This patch changes us to create NOTIFY_ACTION_REMOVED and NOTIFY_ACTION_ADDED
in this case. Not sure this is right, but at least it is better than before: We
get something at all.

This is more likely to happen with the notifyd approach, as there we
inotify-watch many subdirectories from one process. Without nootifyd you had to
have two explorer windows open and do a nfs or local mv between those two
directories to find this.

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 Dec  5 21:01:54 CET 2014 on sn-devel-104

5 years agolib: Fix signed/unsigned comparisons
Volker Lendecke [Wed, 3 Dec 2014 14:54:19 +0000 (15:54 +0100)]
lib: Fix signed/unsigned comparisons

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos4: torture: leases. Simple lease_v2 rename test "v2_rename".
Jeremy Allison [Fri, 5 Dec 2014 05:29:47 +0000 (21:29 -0800)]
s4: torture: leases. Simple lease_v2 rename test "v2_rename".

Proves that renaming files can break handle leases.

With the previous patches we now pass this.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos3: leases: Make SMB2 setinfo SMB2_FILE_RENAME_INFORMATION_INTERNAL async.
Jeremy Allison [Fri, 5 Dec 2014 05:19:32 +0000 (21:19 -0800)]
s3: leases: Make SMB2 setinfo SMB2_FILE_RENAME_INFORMATION_INTERNAL async.

If there are any RH leases we must break them to read
and must wait for the client response before doing the rename.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos3: leases: send_break_message() public.
Jeremy Allison [Fri, 5 Dec 2014 05:15:24 +0000 (21:15 -0800)]
s3: leases: send_break_message() public.

We're going to need this to allow async SMB2
setinfo renames to send lease break messages
as well as the open code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3: leases: Make aio_add_req_to_fsp() public.
Jeremy Allison [Fri, 5 Dec 2014 05:13:33 +0000 (21:13 -0800)]
s3: leases: Make aio_add_req_to_fsp() public.

We're going to need this to stop handle closures with
outstanding async SMB2 renames causing a crash.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3: leases : Cope with renaming leased open files.
Jeremy Allison [Thu, 4 Dec 2014 18:14:23 +0000 (10:14 -0800)]
s3: leases : Cope with renaming leased open files.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3: leases: Add leases_db_rename() to cope with renaming a leased file.
Jeremy Allison [Thu, 4 Dec 2014 18:13:47 +0000 (10:13 -0800)]
s3: leases: Add leases_db_rename() to cope with renaming a leased file.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agoctdb-recoverd: Process all the records for vacuum fetch in a loop
Amitay Isaacs [Wed, 23 Apr 2014 08:02:39 +0000 (18:02 +1000)]
ctdb-recoverd: Process all the records for vacuum fetch in a loop

Processing one migration request at a time is very slow and processing
a batch of records can take longer than VacuumInterval.  This causes
subsequent vacuum fetch requests to be dropped.  The dropped records
can accumulate quickly and will cause the vacuum database traverse to
be quite expensive.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Dec  5 17:06:58 CET 2014 on sn-devel-104

5 years agoctdb-vacuum: Do not delete VACUUM MIGRATED records immediately
Amitay Isaacs [Mon, 14 Apr 2014 04:53:25 +0000 (14:53 +1000)]
ctdb-vacuum: Do not delete VACUUM MIGRATED records immediately

Such records should be processed by the local vacuuming daemon to ensure
that all the remote copies have been deleted first.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agoctdb-vacuum: Use non-blocking lock when traversing delete tree
Amitay Isaacs [Wed, 5 Nov 2014 22:33:50 +0000 (09:33 +1100)]
ctdb-vacuum: Use non-blocking lock when traversing delete tree

This avoids vacuuming getting in the way of ctdb daemon to process
record requests.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agoctdb-vacuum: Use non-blocking lock when traversing delete queue
Amitay Isaacs [Mon, 14 Apr 2014 03:18:41 +0000 (13:18 +1000)]
ctdb-vacuum: Use non-blocking lock when traversing delete queue

This avoids vacuuming getting in the way of ctdb daemon to process
record requests.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agoctdb-vacuum: Stagger vacuuming child processes
Amitay Isaacs [Fri, 21 Feb 2014 03:58:00 +0000 (14:58 +1100)]
ctdb-vacuum: Stagger vacuuming child processes

This prevents multiple child processes being forked at the same time
for vacuuming TDBs.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agoctdb-vacuum: Track time for vacuuming in database statistics
Amitay Isaacs [Tue, 11 Feb 2014 03:23:28 +0000 (14:23 +1100)]
ctdb-vacuum: Track time for vacuuming in database statistics

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agovfs_fruit: add AAPL options
Ralph Boehme [Fri, 28 Nov 2014 21:44:29 +0000 (22:44 +0100)]
vfs_fruit: add AAPL options

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Dec  5 00:34:01 CET 2014 on sn-devel-104

5 years agos4:torture:vfs_fruit: smb2/create context AAPL test
Ralph Boehme [Sat, 27 Sep 2014 15:21:12 +0000 (17:21 +0200)]
s4:torture:vfs_fruit: smb2/create context AAPL test

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos4:libcli/raw: make short_name available in buffer
Ralph Boehme [Wed, 1 Oct 2014 12:36:43 +0000 (14:36 +0200)]
s4:libcli/raw: make short_name available in buffer

This will be used in smb2/create AAPL context torture tests, where the
server returns an Mac OS X specific data blob in the short name
buffer. It's not a string, so the existing string extraction doesn't
cut it.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:smbd: add SMB_VFS_READDIR_ATTR() to marshall direntry
Ralph Boehme [Wed, 26 Nov 2014 14:21:36 +0000 (15:21 +0100)]
s3:smbd: add SMB_VFS_READDIR_ATTR() to marshall direntry

SMB_VFS_READDIR_ATTR is a last minute hook to fetch additional metadata
for a directory entry when we're already marshalling the SMB reply buffer.

This would we used, when there's a need to repurpose some fields in the
the reply, like it's done with Apple's SMB2 extension "AAPL".

We then fetch AAPL metadata with the shiny new SMB_VFS_READDIR_ATTR()
VFS call and marshall appropiately.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_fruit: AAPL support
Ralph Boehme [Wed, 26 Nov 2014 17:11:17 +0000 (18:11 +0100)]
vfs_fruit: AAPL support

* readdir_attr VFS functions, used in trans2 when marshalling
  metadata associated with a directory entry

* support for reading and writing UNIX mode via MS NFS ACEs in NT ACL

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:smbd: ignore dacls with MS NFS ACEs
Ralph Boehme [Wed, 26 Nov 2014 17:01:37 +0000 (18:01 +0100)]
s3:smbd: ignore dacls with MS NFS ACEs

Ignore NFS ACEs in code the modifies
* default POSIX ACLs
* VFS: NFSv4 ACLs
* VFS: xattr and tdb ACLs

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibcli/security: add a function that checks for MS NFS ACEs
Ralph Boehme [Tue, 14 Oct 2014 11:54:05 +0000 (13:54 +0200)]
libcli/security: add a function that checks for MS NFS ACEs

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibcli/security: add NFS SID mappings
Ralph Boehme [Mon, 8 Sep 2014 21:18:35 +0000 (23:18 +0200)]
libcli/security: add NFS SID mappings

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:smbd: add SMB2 AAPL create context defines
Ralph Boehme [Fri, 22 Aug 2014 01:48:50 +0000 (03:48 +0200)]
s3:smbd: add SMB2 AAPL create context defines

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:vfs: add create tags to SMB_VFS_CREATEFILE
Ralph Boehme [Wed, 26 Nov 2014 13:12:51 +0000 (14:12 +0100)]
s3:vfs: add create tags to SMB_VFS_CREATEFILE

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:smbd: allocate out_context_blobs with talloc
Ralph Boehme [Fri, 28 Nov 2014 10:44:09 +0000 (11:44 +0100)]
s3:smbd: allocate out_context_blobs with talloc

By tallocing the out_context_blobs instead of using an automatic stack
variable, we can use out_context_blobs as talloc parent for individual
create tag that we add via smb2_create_blob_add().

This is in preperation of a SMB_VFS_CREATE_FILE modification where I add
the in and out_context_blobs as additional args. With this change in
place we can add create tags to out_context_blobs from there too.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:vfs: add SMB_VFS_READDIR_ATTR()
Ralph Boehme [Wed, 26 Nov 2014 13:30:37 +0000 (14:30 +0100)]
s3:vfs: add SMB_VFS_READDIR_ATTR()

SMB_VFS_READDIR_ATTR is a last minute hook to fetch additional metadata
for a directory entry when we're already marshalling the SMB reply
buffer.

This would be used, when there's a need to repurpose some fields in the
the reply, like it's done with Apple's SMB2 extension "AAPL".

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agounix_msg: Fix unix_msg_test_drain
Volker Lendecke [Thu, 4 Dec 2014 14:50:27 +0000 (14:50 +0000)]
unix_msg: Fix unix_msg_test_drain

poll_funcs_init_tevent does not register a tevent context by default. This
used to be the case in an early development stage, but apparently I
haven't tested this for a while :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Dec  4 18:55:08 CET 2014 on sn-devel-104

5 years agodocs-xml: document the interaction between "write cache size" and "aio read/write...
Stefan Metzmacher [Sat, 8 Nov 2014 08:47:01 +0000 (09:47 +0100)]
docs-xml: document the interaction between "write cache size" and "aio read/write size"

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

5 years agos3:smbd: document the interaction between "smb2 leases" and "write cache size"
Stefan Metzmacher [Sat, 8 Nov 2014 08:45:59 +0000 (09:45 +0100)]
s3:smbd: document the interaction between "smb2 leases" and "write cache size"

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoselftest:Samba3: use "smb2 leases = yes"
Jeremy Allison [Tue, 14 Oct 2014 17:34:53 +0000 (10:34 -0700)]
selftest:Samba3: use "smb2 leases = yes"

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3:smb2_negprot: announce support for SMB2.1 leases.
Jeremy Allison [Tue, 28 Oct 2014 22:31:46 +0000 (15:31 -0700)]
s3:smb2_negprot: announce support for SMB2.1 leases.

We only do this with "smb2 leases = yes"
and the default values for "oplocks = yes"
and "kernel oplocks = no".

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3:param: Add "smb2 leases" parameter. Default "false".
Jeremy Allison [Tue, 14 Oct 2014 17:34:53 +0000 (10:34 -0700)]
s3:param: Add "smb2 leases" parameter. Default "false".

This is currently marked as experimental!

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3:smb2_create: support leases and pass them down to the VFS layer.
Volker Lendecke [Tue, 28 Oct 2014 22:31:46 +0000 (15:31 -0700)]
s3:smb2_create: support leases and pass them down to the VFS layer.

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:smbd: Implementation of SMB2.1 and SMB3.0 leases.
Volker Lendecke [Tue, 28 Oct 2014 22:31:46 +0000 (15:31 -0700)]
s3:smbd: Implementation of SMB2.1 and SMB3.0 leases.

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>
5 years agos3:smbd: add lease related helper functions to oplock.c
Volker Lendecke [Tue, 28 Oct 2014 22:31:46 +0000 (15:31 -0700)]
s3:smbd: add lease related helper functions to oplock.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>
5 years agos3:smbd: add lease key validation functions to open.c
Volker Lendecke [Tue, 28 Oct 2014 22:31:46 +0000 (15:31 -0700)]
s3:smbd: add lease key validation functions to open.c

This makes sure a lease key can only be used for one specific
file.

This also handles the dynamic share file case [homes].

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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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

5 years agos3:idmap_cache: remove unused idmap_cache_set_sid2[u|g]id()
Stefan Metzmacher [Sat, 29 Nov 2014 09:52:05 +0000 (10:52 +0100)]
s3:idmap_cache: remove unused idmap_cache_set_sid2[u|g]id()

Change-Id: I40bcfacb812b0dac7917533c9baf82a79f598efd
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Wed Dec  3 06:44:29 CET 2014 on sn-devel-104

5 years agopdb: Increase version number to fix ABI
Garming Sam [Tue, 25 Nov 2014 01:56:45 +0000 (14:56 +1300)]
pdb: Increase version number to fix ABI

In the process, we can also rename pdb to avoid conflicts with libpdb.

We don't depend directly on pdb to avoid duplicate symbols.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10355
Change-Id: I4df6ba2f4ce35d3718dc4198b527cca46a139efe
Pair-programmed-with: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agoidmap: return the correct id type to *id_to_sid methods
Garming Sam [Wed, 26 Nov 2014 02:33:35 +0000 (15:33 +1300)]
idmap: return the correct id type to *id_to_sid methods

We have a pointer to a unixid which is sent down instead of a uid or
gid. We can use this as an in-out variable so that pdb_samba_dsdb can be
returned ID_TYPE_BOTH to cache correctly instead of leaving it as
ID_TYPE_UID or ID_TYPE_GID.

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

Change-Id: I0cef2e419cbb337531244b7b41c708cf2ab883e3
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agoidmap: unify passdb *id_to_sid methods
Garming Sam [Tue, 25 Nov 2014 01:45:26 +0000 (14:45 +1300)]
idmap: unify passdb *id_to_sid methods

Instead of passing down gid or uid, a pointer to a unixid is now sent
down. This acts as an in-out variable so that the idmap functions can
correctly receive ID_TYPE_BOTH, filling in cache details correctly
rather than forcing the cache to store ID_TYPE_UID or ID_TYPE_GID.

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

Change-Id: I11409a0f498e61a3c0a6ae606dd7af1135e6b066
Pair-programmed-with: Andrew Bartlett <abarlet@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3:utils/profiles fix a use after free
Christian Ambach [Tue, 4 Nov 2014 22:51:23 +0000 (23:51 +0100)]
s3:utils/profiles fix a use after free

path is a talloc-child of subkeys, so subkeys should not be freed before calling
verbose_output

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Wed Dec  3 00:43:19 CET 2014 on sn-devel-104

5 years agos3:registry/regfio fix some valgrind warnings
Christian Ambach [Tue, 4 Nov 2014 22:50:07 +0000 (23:50 +0100)]
s3:registry/regfio fix some valgrind warnings

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3:registry/regfio read SD from the correct location
Christian Ambach [Tue, 4 Nov 2014 22:47:26 +0000 (23:47 +0100)]
s3:registry/regfio read SD from the correct location

try to find the security descriptor at the data pointer, not at the beginning of the hbin

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3-libsmb: Duplicate the memory before we free it.
Andreas Schneider [Fri, 14 Nov 2014 09:05:13 +0000 (10:05 +0100)]
s3-libsmb: Duplicate the memory before we free it.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Dec  2 21:46:53 CET 2014 on sn-devel-104

5 years agos3-libsmb: Set the netbios_name in use_ccache case too.
Andreas Schneider [Fri, 14 Nov 2014 09:03:07 +0000 (10:03 +0100)]
s3-libsmb: Set the netbios_name in use_ccache case too.

If we do not set the netbios_name we are not able to connect to a
Windows DC.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
5 years agos3-lib: Do not require a password with --use-ccache.
Andreas Schneider [Fri, 14 Nov 2014 08:31:51 +0000 (09:31 +0100)]
s3-lib: Do not require a password with --use-ccache.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
5 years agotdb: version 1.3.3 tdb-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

5 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>
5 years agoMinor spelling correction in samba-tool domain
Daniel Cotton [Mon, 1 Dec 2014 17:15:21 +0000 (03:45 +1030)]
Minor spelling correction in samba-tool domain

Signed-Off-By: Daniel Cotton <danielcotton.patches at gmail.com>
Reviewed-By: Michael Adam <obnox@samba.org>
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Tue Dec  2 01:18:53 CET 2014 on sn-devel-104

5 years agoReduce number of places where sys.path is (possibly) updated for external module...
Jelmer Vernooij [Tue, 4 Nov 2014 20:37:41 +0000 (20:37 +0000)]
Reduce number of places where sys.path is (possibly) updated for external module paths.

Change-Id: I69d060f27ea090d14405e884d1ce271975358c56
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Sun Nov 30 20:54:04 CET 2014 on sn-devel-104

5 years agoDon't assume st/subunit being present means it was generated by the current process.
Jelmer Vernooij [Sun, 2 Nov 2014 20:36:13 +0000 (12:36 -0800)]
Don't assume st/subunit being present means it was generated by the current process.

This fixes --list.

Change-Id: I75fc765757e06861cf3bb489246e0845564a1123
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoBe consistent about what functions add $LISTOPT and $LOADLIST to the command-line.
Jelmer Vernooij [Sat, 1 Nov 2014 23:36:54 +0000 (16:36 -0700)]
Be consistent about what functions add $LISTOPT and $LOADLIST to the command-line.

Change-Id: Ife86624b53a99d48ce9f00d146b14f798c9bdb24
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Sun Nov 30 16:43:52 CET 2014 on sn-devel-104

5 years agoselftest: Add separate command line for listing tests, allowing us of subunit-filter...
Jelmer Vernooij [Sat, 1 Nov 2014 22:13:18 +0000 (15:13 -0700)]
selftest: Add separate command line for listing tests, allowing us of subunit-filter (which doesn't support subunit v2).

Change-Id: Icb877214a422c63fd38ef92425c7b4fe7ee19ad5
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoselftest/tests.py: Remove testsuite samba.tests.samdb which does not have any tests.
Jelmer Vernooij [Sat, 1 Nov 2014 23:06:09 +0000 (16:06 -0700)]
selftest/tests.py: Remove testsuite samba.tests.samdb which does not have any tests.

Change-Id: I8edcf73aa4a9b61c6e5c7cfb592a4692d4030a29
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoRe-use add_prefix function.
Jelmer Vernooij [Sat, 1 Nov 2014 21:40:30 +0000 (14:40 -0700)]
Re-use add_prefix function.

Change-Id: I6e91bc9fc6714c147427e920ca0e3e22cb9a076b
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoselftest: Drop support for TESTSUITE-IDLIST, and remove its last user.
Jelmer Vernooij [Mon, 27 Oct 2014 03:17:20 +0000 (20:17 -0700)]
selftest: Drop support for TESTSUITE-IDLIST, and remove its last user.

Change-Id: Ic616676bb770fa4769195d73c4309915646caae0
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoldb: version 1.1.18 ldb-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

5 years agotdb: version 1.3.2 tdb-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>
5 years agos3-libads: remove unused dn from ads_get_service_principal_names().
Günther Deschner [Fri, 14 Nov 2014 12:21:43 +0000 (13:21 +0100)]
s3-libads: remove unused dn from ads_get_service_principal_names().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Nov 28 16:46:20 CET 2014 on sn-devel-104

5 years agontdb: Fix control reaches end of non-void function.
Andreas Schneider [Tue, 18 Nov 2014 13:16:58 +0000 (14:16 +0100)]
ntdb: Fix control reaches end of non-void function.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
5 years agotorture: Fix raw.open.chained-openx
Volker Lendecke [Thu, 27 Nov 2014 20:44:18 +0000 (21:44 +0100)]
torture: Fix raw.open.chained-openx

sizeof(buf) is 5. On FreeBSD10/clang this overwrites "ret". Not good.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Nov 28 13:30:18 CET 2014 on sn-devel-104

5 years agotest: Fix samba3.blackbox.net.registry.check
Volker Lendecke [Thu, 27 Nov 2014 21:04:58 +0000 (22:04 +0100)]
test: Fix samba3.blackbox.net.registry.check

On FreeBSD, "wc -l" returns whitespace. Cope with that.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Nov 28 10:24:06 CET 2014 on sn-devel-104

5 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

5 years agomessaging4: Fix types
Volker Lendecke [Thu, 27 Nov 2014 11:28:40 +0000 (12:28 +0100)]
messaging4: Fix types

According to python docs, PyArg_ParseTuple takes "int" and "unsigned
long long". With pointers down to functions, in particular with
varargs, there is no automatic conversion. So we need to be very
strict about types. Automatic conversion to for example uint64_t
happes only with assignment.

This fixes a crash on FreeBSD10/clang.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <rb@sernet.de>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Nov 27 21:32:18 CET 2014 on sn-devel-104

5 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

5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>