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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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
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>
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>
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>
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
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>
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>
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
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>
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>
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
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>
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
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
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>
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
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>
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>
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>
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>
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
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>
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
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>
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
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
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
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
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Andrew Bartlett [Thu, 27 Nov 2014 04:13:23 +0000 (17:13 +1300)]
gse_krb5: Avoid a segfault when we can not read the dedicated keytab file
This improved code simply cleans up the memory as soon as possible,
rather than using memcmp(). Otherwise, we segfault if
krb5_kt_start_seq_get fails, as it can set the fd element in the
handle to -1.
Change-Id: Ib4821ef944a7e12cd8a891ae07dbfc0567c65495
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Nov 27 07:38:02 CET 2014 on sn-devel-104
Andrew Bartlett [Thu, 27 Nov 2014 04:08:30 +0000 (17:08 +1300)]
lib/param: Allow enum values to also be white-space insentive in comparison
This makes it easier to specify these in the --option= syntax on the command line.
Change-Id: I6b2398d79d37407c5d82cd6b540651ede1d09106
Pair-Programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Garming Sam [Tue, 25 Nov 2014 03:52:53 +0000 (16:52 +1300)]
wbinfo: create a more comprehensive test for sids2xids
In particular, this tests that ID_TYPE_BOTH is cached correctly.
Change-Id: I2475f22d3f4506c93b15d82b0d337d3729bbbd4c
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): Thu Nov 27 05:16:53 CET 2014 on sn-devel-104
Garming Sam [Tue, 25 Nov 2014 02:59:27 +0000 (15:59 +1300)]
wbinfo: fix tests and lack of cache flushing
Change-Id: I1a0a8f62522a6eb64d39bee48f4f71403d7c343a
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Volker Lendecke [Wed, 26 Nov 2014 20:35:27 +0000 (21:35 +0100)]
param: Simplify get_parametric_helper()
With variable sized arrays we don't need talloc_asprintf here
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): Thu Nov 27 01:41:09 CET 2014 on sn-devel-104
Volker Lendecke [Wed, 26 Nov 2014 20:34:44 +0000 (21:34 +0100)]
registry3: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
David Disseldorp [Tue, 25 Nov 2014 21:22:24 +0000 (22:22 +0100)]
param: remove unused get_share_params()
Given a share name, get_share_params() returns corresponding snum inside
a struct share_params. find_service() provides duplicate functionality.
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov 26 21:27:21 CET 2014 on sn-devel-104
David Disseldorp [Tue, 25 Nov 2014 21:22:23 +0000 (22:22 +0100)]
srv_srvsvc_nt: remove unneeded get_share_params() call
The snum and share name are already determined via the prior
find_service() call.
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Jeremy Allison [Wed, 26 Nov 2014 01:43:25 +0000 (17:43 -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.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <rb@sernet.de>
Christof Schmitt [Mon, 17 Nov 2014 21:59:34 +0000 (14:59 -0700)]
gencache: Request mutexes for gencache_notrans.tdb
The check in tdb_wrap ensures that mutexes are only used on systems that
properly support them.
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Nov 26 19:04:11 CET 2014 on sn-devel-104
Christof Schmitt [Mon, 17 Nov 2014 22:44:47 +0000 (15:44 -0700)]
gencache: Convert gencache.tdb to tdb_wrap
This change is not strictly necessary, but for consistency both gencache
tdbs are now opened through tdb_wrap.
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Christof Schmitt [Mon, 17 Nov 2014 21:30:49 +0000 (14:30 -0700)]
gencache: Convert gencache_notrans to use tdb_wrap
This allows using on the mutex check in tdb_wrap.
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Michael Adam [Wed, 2 Jul 2014 05:44:04 +0000 (07:44 +0200)]
s3:gencache: don't use transaction non non-persistent gencache_notrans.tdb
gencache_notrans.tdb is a non-persistent cache layer above the
persistent gencache.tdb. Despite its name, and despite the
nature of non-persistent tdbs, the current stabilization code
uses a transaction on gencache_notrans.tdb like this:
transaction_start(cache)
transaction_start(cache_notrans)
traverse(cache_notrans, stabilize_fn)
transaction_commit(cache)
transaction_commit(cache_notrans)
where stabilze_fn does this on a record:
1. store it to or delete it from cache
(depending on the timeout)
2. delete it from the cache_notrans
This patch changes gencache_notrans.tdb to avoid
transactions by using an all-record lock like this:
tdb_allrecord_lock(cache_notrans)
transaction_start(cache)
traverse(cache_notrans, stabilize_fn_mod)
transaction_commit(cache)
traverse(cache_notrans, wipe_fn)
tdb_wipe_all(cache_notrans)
tdb_allrecord_unlock(cache_notrans)
with stabilize_fn_mod doing only:
1. store the record to or delete it from cache
(depending on the timeout)
and wipe_fn deleting the records from the gencache_notrans db.
This is a step towards making non-persistent-db specific features
like mutex locking usable for gencache_notrans.tdb.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Michael Adam [Thu, 26 Jun 2014 14:56:41 +0000 (16:56 +0200)]
s3:gencache: simply stabilize() a bit more: remove error from state
state.error is set to true if and only if the traverse
callback returns error (-1), and hence only if the traverse
fails.
Hence the the error state is redundant.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Michael Adam [Thu, 26 Jun 2014 14:37:17 +0000 (16:37 +0200)]
s3:gencache: fix logic in stabilization when deleting a record from stable cache
Set state->written = true in the delete case
if and only if the record has really been deleted.
This does currently not seem to lead to an unneeded
write to the DB, since failure to delete the record
will cause the traverse and hence the transaction
to cancel. But I think this is clearer.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
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>
Volker Lendecke [Tue, 25 Nov 2014 21:03:18 +0000 (21:03 +0000)]
lib: Use tdb_parse_record in gencache_set
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Nov 26 14:50:38 CET 2014 on sn-devel-104
Andreas Schneider [Wed, 19 Nov 2014 09:31:45 +0000 (10:31 +0100)]
dns_server: Only build common library if AD DC is enabled.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Nov 26 12:11:18 CET 2014 on sn-devel-104
Andreas Schneider [Wed, 19 Nov 2014 09:30:23 +0000 (10:30 +0100)]
dfs_server: Only build in case we build an AD DC too.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
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
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>
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>
Volker Lendecke [Tue, 25 Nov 2014 11:55:26 +0000 (12:55 +0100)]
lib: Fix header include protection #define
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Nov 25 15:38:22 CET 2014 on sn-devel-104
Stefan Metzmacher [Tue, 11 Nov 2014 13:54:41 +0000 (14:54 +0100)]
script/autobuild.py: build 'samba' using --picky-developer
This makes sure we don't get unexpected new compiler warnings.
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): Tue Nov 25 09:46:30 CET 2014 on sn-devel-104
Stefan Metzmacher [Wed, 26 Feb 2014 06:34:51 +0000 (07:34 +0100)]
wafsamba: change the default to allow_warnings=False for CURRENT_CFLAGS()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Stefan Metzmacher [Wed, 26 Feb 2014 06:34:51 +0000 (07:34 +0100)]
wafsamba: change the default to allow_warnings=False for SAMBA_{SUBSYSTEM,LIBRARY,MODULE}()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Stefan Metzmacher [Wed, 29 Oct 2014 11:27:28 +0000 (12:27 +0100)]
s4:ntvfs/unixuid: remove unused allow_warnings=True
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Stefan Metzmacher [Wed, 29 Oct 2014 11:27:28 +0000 (12:27 +0100)]
s4:librpc: remove unused allow_warnings=True for 'dcerpc'
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Stefan Metzmacher [Wed, 29 Oct 2014 11:27:28 +0000 (12:27 +0100)]
s4:lib/messaging: remove unused allow_warnings=True
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>