Andrew Bartlett [Tue, 1 Mar 2016 01:19:33 +0000 (14:19 +1300)]
pygensec: Use pytalloc_steal() in gensec_start_{client,server}()
This is better than casting to get to the pytalloc_Object structure directly
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Mon, 29 Feb 2016 20:31:00 +0000 (09:31 +1300)]
pyparam: Use pytalloc_BaseObject_PyType_Ready()
This changes pyparam to use talloc.BaseObject() just like the PIDL output
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Mon, 29 Feb 2016 20:30:03 +0000 (09:30 +1300)]
py_passdb: Use pytalloc_BaseObject_PyType_Ready()
This changes py_passdb to use talloc.BaseObject() just like the PIDL output
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Mon, 29 Feb 2016 20:27:11 +0000 (09:27 +1300)]
pycredentials: Use pytalloc_BaseObject_PyType_Ready()
This changes pycredentials to use talloc.BaseObject() just like the PIDL output
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Mon, 29 Feb 2016 20:26:29 +0000 (09:26 +1300)]
pytalloc: Add pytalloc_BaseObject_PyType_Ready() wrapper
This avoids the need for the caller to set tp_base and tp_basicsize and
so removes those as possible errors.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Mon, 29 Feb 2016 03:27:31 +0000 (16:27 +1300)]
pyparam: Do not use pytalloc_Object directly
This type should not be used directly, it should have been made private
to pytalloc. This then allows removal of the (PyCFunction) cast
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Mon, 29 Feb 2016 03:27:12 +0000 (16:27 +1300)]
pypassdb: Do not use pytalloc_Object directly
This type should not be used directly, it should have been made private
to pytalloc. This then allows removal of the (PyCFunction) cast
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Mon, 29 Feb 2016 03:26:08 +0000 (16:26 +1300)]
pycredentials: Remove PyCredentialCacheContainerObject
We can call pytalloc_reference() and avoid having this in the header file
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Mon, 22 Feb 2016 01:10:23 +0000 (14:10 +1300)]
pycredentials: Do not use pytalloc_Object directly
This type should not be used directly, it should have been made private
to pytalloc
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Tue, 22 Dec 2015 06:49:54 +0000 (19:49 +1300)]
selftest: dbcheck should not be marked flapping
The primary cause of the flapping was due to the objectclass
sort routine being non-deterministic.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Wed, 23 Dec 2015 20:43:36 +0000 (09:43 +1300)]
dbcheck: Avoid spurious warnings in dbcheck due to objectclass sorting
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11433
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Tue, 22 Dec 2015 06:48:38 +0000 (19:48 +1300)]
dbcheck: Fix incorrect/duplicate attrid in replPropertMetaData
If custom schema is used in a replicated DC environment, these are created as soon as
an attribute is modified on more than one DC. We have to remove these.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11443
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Wed, 23 Dec 2015 00:16:57 +0000 (13:16 +1300)]
selftest: Update release-4-1-0rc3 with more test records
CN=ops_run_anything2,OU=SUDOers,DC=release-4-1-0rc3,DC=samba,DC=corp
This will be modified during the dbcheck to show that new
versions of Samba will reset the attid correctly
CN=ops_run_anything3,OU=SUDOers,DC=release-4-1-0rc3,DC=samba,DC=corp
This will not be modified, and shows how a 4.1 DC without
replication would record custom schema objects.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Tue, 22 Dec 2015 06:39:31 +0000 (19:39 +1300)]
rpc_server/drsuapi: Block replication of incorrect/duplicate attrid in replPropertMetaData
If custom schema is used in a replicated DC environment, these are created as soon as
an attribute is modified on more than one DC. We have to prevent replication
as otherwise we will corrupt the client replica state.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11443
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Tue, 22 Dec 2015 06:33:39 +0000 (19:33 +1300)]
repl_meta_data: Correctly use msDS-IntId for custom schema, not the prefixMap value
We must, when dealing with custom schema, respect the msDC-IntId value recorded
in the schema. If we do not, then we will create multiple replPropertyMetaData
records for the one attribute. This may cause confusion during replication.
This fixes the issue by always calling dsdb_attribute_get_attid() to obtain
the correct local (32 bit integer) attribute ID
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11443
Andrew Bartlett [Thu, 25 Feb 2016 00:57:37 +0000 (13:57 +1300)]
pidl: Use a tmp_ctx helper variable
This is so we free the ndr_push_struct_blob() return value after
we make it into a string
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Thu, 25 Feb 2016 00:57:00 +0000 (13:57 +1300)]
pidl: Use the $mem_ctx helper variable
This is already set to pytalloc_get_mem_ctx(py_obj)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Tue, 16 Feb 2016 01:06:28 +0000 (14:06 +1300)]
pidl: Fix our python reference handling
The new talloc.BaseObject allow us to hold a talloc context per
python object (there may be many referring to the same C object)
and the talloc context that the actual object pointer is under.
Another advantage is that talloc.BaseObject(), has less of
an ABI surface.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Mon, 7 Mar 2016 22:18:56 +0000 (11:18 +1300)]
pyrpc: Clarify failure mode after pytalloc_reference_ex() improvements
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Tue, 16 Feb 2016 03:15:53 +0000 (16:15 +1300)]
talloc: Bump version number
The removal of the macros and replacement with proper functions
is a API, but not ABI break. Only code that incorrectly
used the structure either in function signatures or
to access the members directly will need to be modified
before being built against this version of talloc.
Andrew Bartlett
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Mon, 22 Feb 2016 01:02:28 +0000 (14:02 +1300)]
pytalloc: Add new BaseObject
This new object not only avoids the ABI issues of talloc.Object
it stores one more pointer, being the start of the array, and
so can be used to fix the PIDL bindings/talloc refcount issue.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Stefan Metzmacher [Mon, 22 Feb 2016 07:47:07 +0000 (08:47 +0100)]
pytalloc: add a _pytalloc_get_type() helper function and generate PyExc_TypeError on mismatch
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Mon, 22 Feb 2016 01:29:15 +0000 (14:29 +1300)]
talloc: add _pytalloc_get_ptr/_pytalloc_get_mem_ctx helper functions
This allows us to check which type is involved, and dereference
that type correctly
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Mon, 22 Feb 2016 22:04:51 +0000 (11:04 +1300)]
talloc: Improve testsuite by avoiding path issues
We now rely on waf to tell us where the helper binary is.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Mon, 7 Mar 2016 22:16:27 +0000 (11:16 +1300)]
pyrpc: Add warning about abuse of py_return_ndr_struct()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Tue, 16 Feb 2016 02:15:44 +0000 (15:15 +1300)]
pydsdb: Fix returning of ldb.MessageElement.
This object is not based on pytalloc_Object and so this causes
a segfault (later a failure) when the struct definitions diverge.
We must also not reuse the incoming ldb_message_element as a talloc
context and overwrite the values, instead we should create a new
object and return that.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Andrew Bartlett [Mon, 7 Mar 2016 21:39:24 +0000 (10:39 +1300)]
pyldb: Add warning about pyldb_MessageElement_AsMessageElement()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Uri Simchoni [Thu, 3 Mar 2016 07:18:58 +0000 (09:18 +0200)]
libnet: make Kerberos domain join site-aware
When joining a domain using Kerberos authentication, create a
configuration file for the Kerberos libs to prefer on-site
domain controllers, without relying on the winbindd Kerberos
locator, which many not be operational at this stage.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11769
Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar 8 01:30:35 CET 2016 on sn-devel-144
Uri Simchoni [Thu, 3 Mar 2016 07:18:57 +0000 (09:18 +0200)]
dsgetdcname: fix flag check
Fix the check for zero requseted flags.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11769
Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Uri Simchoni [Thu, 3 Mar 2016 07:18:44 +0000 (09:18 +0200)]
dsgetdcname: return an IP address on rediscovery
When dsgetdcname return its result based on discovery
process (instead of retrieving cached value), always
return the found server's IP address in dc_address field,
rather than its netbios name.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11769
Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Wed, 10 Feb 2016 08:02:12 +0000 (09:02 +0100)]
idmap_autorid: Protect against corrupt databases
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Sun, 6 Mar 2016 15:39:58 +0000 (16:39 +0100)]
idmap_autorid: Fix a use-after-free
Parsing the domain_range_index references data.dptr
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Jeremy Allison [Fri, 4 Mar 2016 22:16:13 +0000 (14:16 -0800)]
s3: smbd: Change open_streams_for_delete() to take a struct smb_filename *.
Prepare for changing vfs_streaminfo to do the same.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Mar 7 21:12:56 CET 2016 on sn-devel-144
Jeremy Allison [Fri, 4 Mar 2016 22:16:13 +0000 (14:16 -0800)]
s3: smbd: Change open_streams_for_delete() to take a struct smb_filename *.
Prepare for changing vfs_streaminfo to do the same.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 4 Mar 2016 22:13:22 +0000 (14:13 -0800)]
s3: smbd: Change open_streams_for_delete() to static.
Not used outside of open.c
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 4 Mar 2016 22:07:04 +0000 (14:07 -0800)]
s3: smbd: Change delete_all_streams() to take a const struct smb_filename *.
Prepare for changing the interface to vfs_streaminfo().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 4 Mar 2016 22:01:47 +0000 (14:01 -0800)]
s3: VFS: vfs_fruit. If we have an fsp, use it in preference to a pathname in vfs_streaminfo.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Thu, 3 Mar 2016 16:39:09 +0000 (17:39 +0100)]
lib: Avoid a gencache_parse when setting a delete marker
We know that we want to put something into _notrans, no point in
doing another round trip into gencache.tdb.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Thu, 3 Mar 2016 16:41:34 +0000 (17:41 +0100)]
lib: Avoid looking at fcntl'ed gencache.tdb
gencache_notrans.tdb is much cheaper to look at than gencache.tdb because it's
mutexed and thus avoids expensive fcntl locks. This patch aggressively uses the
shared _notrans tdb for both positive and negative entries. It's a replacement
for the memcache copy in every process that was removed a few patches ago.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Wed, 22 Jul 2015 14:03:47 +0000 (16:03 +0200)]
lib: Simplify gencache_pull_timeout callers
gencache_pull_timeout used to point at the "/" right after the timeout. None
of the callers was interested in the "/", they are interested in the payload.
Increment the endpointer in gencache_pull_timeout and rename it.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Wed, 22 Jul 2015 14:00:03 +0000 (16:00 +0200)]
lib: Make gencache_pull_timeout look at uint8_t
At this point we're still looking at TDB_DATA. This patch moves the casts to a
more appropriate place.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Wed, 22 Jul 2015 13:50:00 +0000 (15:50 +0200)]
lib: Remove memcache from gencache
The main reason for this was to avoid access to the fcntl-governed transaction
based gencache.tdb. A later patch will make this unnecessary by filling
gencache_notrans more aggressively.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Sun, 6 Mar 2016 09:27:06 +0000 (10:27 +0100)]
lib: Fix a typo in gencache
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Thu, 3 Mar 2016 14:59:05 +0000 (15:59 +0100)]
lib: Simplify gencache_del
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Thu, 3 Mar 2016 14:59:05 +0000 (15:59 +0100)]
lib: skip deleted entries in gencache_iterate
"net cache flush" can give nasty error messages like
Couldn't delete entry! key = IDMAP/UID2SID/12345
These happen when there's an already deleted entry in
gencache_notrans.tdb, indicated by a 0 timeout. This happens if two
gencache_del function calls have happened right after the other and a
gencache_stabilize has not wiped them.
In gencache_iterate, don't show these deleted entries
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Andreas Schneider [Wed, 2 Mar 2016 16:36:55 +0000 (17:36 +0100)]
krb5_wrap: Do not use deprecated KRB5 functions
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): Mon Mar 7 17:57:39 CET 2016 on sn-devel-144
Martin Schwenke [Tue, 1 Mar 2016 01:20:35 +0000 (12:20 +1100)]
ctdb-packaging: Set --libexecdir in RPM spec file
If the files section uses %{_libexecdir} then CTDB must also be
configured to build and install with the same path, otherwise rpmbuild
can fail due to a mismatch. "rpmbuild --showrc" indicates that the
default %configure command sets:
--libexecdir=%{_libexecdir} \
A mismatch will occur on SUSE systems, where SLES 12 and OpenSUSE 12
set _libexecdir to %{_exec_prefix}/lib.
The failure was initially seen when testing on Debian where
_libexecdir is set to %{_prefix}/lib/x86_64-linux-gnu, though Debian
is an unlikely platform for building RPMs...
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon Mar 7 14:43:15 CET 2016 on sn-devel-144
Amitay Isaacs [Tue, 9 Feb 2016 00:59:30 +0000 (11:59 +1100)]
ctdb-locking: Use real-time only for actual record or DB locking
Use real-time priority only for obtaining record and database locks.
Do not open databases with real-time priority as it can cause thundering
herd on fcntl lock while opening tdb database. Also relinquish real-time
priority after the lock is obtained.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Mar 7 11:29:00 CET 2016 on sn-devel-144
Amitay Isaacs [Sat, 5 Mar 2016 03:05:21 +0000 (14:05 +1100)]
ctdb-takeover: Inform clients when dropping all IP addresses
CTDB releases all IPs in following cases: starting up, shutting down,
node gets banned, node does not come out of recovery for a long time.
Always inform samba when CTDB releases IP addresses.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Amitay Isaacs [Fri, 4 Mar 2016 04:04:13 +0000 (15:04 +1100)]
ctdb-takeover: Do not kill smbd processes on releasing IP
CTDB already notifies Samba with RELEASE_IP message. Samba can take
appropriate action based on that.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Rowland Penny [Tue, 15 Dec 2015 11:00:37 +0000 (11:00 +0000)]
Remove posixAccount from samdb.py
Signed-off-by: Rowland Penny rpenny@samba.org
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Mon Mar 7 08:13:42 CET 2016 on sn-devel-144
Martin Schwenke [Tue, 1 Mar 2016 01:25:13 +0000 (12:25 +1100)]
ctdb-packaging: Drop changelog section from RPM spec file
This is unmaintained and misleading.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon Mar 7 05:00:15 CET 2016 on sn-devel-144
Volker Lendecke [Mon, 22 Feb 2016 20:32:08 +0000 (21:32 +0100)]
g_lock: Remove some unneeded includes
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): Sun Mar 6 19:34:42 CET 2016 on sn-devel-144
Volker Lendecke [Mon, 22 Feb 2016 19:39:20 +0000 (20:39 +0100)]
lib: Avoid "includes.h" in dbwrap.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Volker Lendecke [Sun, 28 Feb 2016 16:56:23 +0000 (17:56 +0100)]
lib: Introduce SERVER_ID_BUF_LENGTH
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Jeremy Allison [Thu, 3 Mar 2016 23:29:10 +0000 (15:29 -0800)]
smbd: Clean up the logic inside vfs_chown_fsp() to prevent future security issues.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sat Mar 5 12:53:11 CET 2016 on sn-devel-144
Jeremy Allison [Thu, 3 Mar 2016 22:34:57 +0000 (14:34 -0800)]
VFS: Modify lchown to take a const struct smb_filename * instead of const char *
Preparing to reduce use of lp_posix_pathnames().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 3 Mar 2016 19:54:23 +0000 (11:54 -0800)]
VFS: Modify chown to take a const struct smb_filename * instead of const char *
Preparing to reduce use of lp_posix_pathnames().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 3 Mar 2016 19:53:39 +0000 (11:53 -0800)]
VFS: vfs_netatalk. Fix wrong VFS call used inside atalk_lchown()
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Ira Cooper [Fri, 4 Mar 2016 23:00:07 +0000 (18:00 -0500)]
vfs_glusterfs: Fix use after free in AIO callback.
The wrapper->state pointer is not getting NULLed during free
allowing use of freed memory, causing a crash.
Thanks to Red Hat for discovering this issue.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11774
Signed-off-by: Ira Copper <ira@samba.org>
Reviewed-by: Poornima G <pgurusid@redhat.com>
Tested-by: Christopher Blum <cblum@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Mar 5 09:08:53 CET 2016 on sn-devel-144
Ira Cooper [Thu, 3 Mar 2016 18:47:32 +0000 (13:47 -0500)]
source3: Honor the core soft limit of the OS.
We should honor the soft limits set by the operating system.
In any case, 16M doesn't make a useful coredump for modern
Samba.
Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Mar 5 00:39:48 CET 2016 on sn-devel-144
Aurelien Aptel [Thu, 3 Mar 2016 15:30:35 +0000 (16:30 +0100)]
s3/rpc_server/srvsvc/srv_srvsvc_nt.c: change snum to signed int
snum is used to store the result of the find_service() call which
returns a signed int, with -1 being an error.
with an uint32_t the error check (< 0) is always false.
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Reviewed-by: Jeremy Allison <jra@samba.org>
Aurelien Aptel [Fri, 4 Mar 2016 09:05:22 +0000 (10:05 +0100)]
s3,s4 torture/denytest: fix possible infinite loop
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: David Disseldorf <ddis@suse.de>
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Fri Mar 4 21:23:45 CET 2016 on sn-devel-144
Aurelien Aptel [Fri, 4 Mar 2016 08:29:48 +0000 (09:29 +0100)]
s4/torture/libnetapi/libnetapi_user.c: fix typo
fixed misplaced parenthesis and wrong sizeof().
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: David Disseldorf <ddis@suse.de>
Amitay Isaacs [Thu, 3 Mar 2016 03:17:40 +0000 (14:17 +1100)]
ctdb-common: For AF_PACKET socket types, protocol is in network order
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11770
From man page of packet(7):
protocol is the IEEE 802.3
protocol number in network byte order. See the <linux/if_ether.h>
include file for a list of allowed protocols. When protocol is set to
htons(ETH_P_ALL), then all protocols are received.
Protocol argument was changed from network order to host order wrongly
in commit
9f8395cb7d49b63a82f75bf504f5f83920102b29.
Specifying "protocol" field to socket(AF_PACKET, ...) call only affects
the packets that are recevied. So use protocol = 0 when sending raw
packets.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri Mar 4 12:58:50 CET 2016 on sn-devel-144
Volker Lendecke [Thu, 3 Mar 2016 16:19:18 +0000 (17:19 +0100)]
vfs: Fix the vfs_gpfs build
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Mar 4 02:09:15 CET 2016 on sn-devel-144
Douglas Bagnall [Wed, 2 Mar 2016 20:33:38 +0000 (09:33 +1300)]
heimdal asn1: avoid fclose(NULL) caused by missing braces
Thanks to GCC6 -Wmisleading-indentation.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Mar 3 16:21:52 CET 2016 on sn-devel-144
Douglas Bagnall [Wed, 2 Mar 2016 20:31:32 +0000 (09:31 +1300)]
regtree: avoid GCC indentation warning
This was not actually a bug, but GCC6 (sort of reasonably) thought it could be.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Michael Adam [Thu, 3 Mar 2016 08:27:42 +0000 (09:27 +0100)]
smbd:smb2: move op variable into scope of use in smb2_create_send
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Michael Adam [Sun, 28 Feb 2016 01:32:36 +0000 (02:32 +0100)]
smbd:smb2: implement create replay
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Michael Adam [Mon, 29 Feb 2016 01:11:26 +0000 (02:11 +0100)]
smbXsrv.idl: add create_action to smbXsrv_open
Needed for create replay.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Michael Adam [Sat, 27 Feb 2016 02:23:27 +0000 (03:23 +0100)]
smbXsrv:open: add smb2srv_open_lookup_replay_cache()
A function to find an open from the replay cache,
based on the create_guid handed in.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Michael Adam [Fri, 26 Feb 2016 12:53:25 +0000 (13:53 +0100)]
smb2:create: create replay cache when request has a create_guid
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Michael Adam [Tue, 23 Feb 2016 23:23:15 +0000 (00:23 +0100)]
smbXsrv:open: maintain a replay cache
This caches a map create_guid -> file_id, so that
a replayed create can find the already created
open again.
This is automatically deleted once the first use
of the file handle is happening (triggered by
the lookup for the file-id).
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Michael Adam [Fri, 26 Feb 2016 12:44:13 +0000 (13:44 +0100)]
librpc:smbXsrv.idl: add flags to smbXsrv_open
These flags reflect the need for and state of the replay cache.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Michael Adam [Wed, 24 Feb 2016 14:53:57 +0000 (15:53 +0100)]
smbd:smb2: allow the REPLAY_OPERATION flag for SMB3+ requests
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Michael Adam [Wed, 2 Mar 2016 19:45:16 +0000 (20:45 +0100)]
torture:smb2: add smb2.replay.replay-dhv2-lease3
create with a lease, and replay with lease
with a different lease key.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Michael Adam [Wed, 2 Mar 2016 00:38:24 +0000 (01:38 +0100)]
torture:smb2: add smb2.replay.replay-oplock-lease
create with an oplock, and replay with a lease.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Michael Adam [Tue, 1 Mar 2016 22:03:50 +0000 (23:03 +0100)]
torture:smb2: add smb2.replay.replay-dhv2-lease-oplock
Open with a lease and replay with an oplock.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Michael Adam [Mon, 29 Feb 2016 18:04:32 +0000 (19:04 +0100)]
torture:smb2: add smb2.replay.replay-dhv2-lease2
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Michael Adam [Mon, 29 Feb 2016 17:23:04 +0000 (18:23 +0100)]
torture:smb2: add smb2.replay.replay-dhv2-lease1
This is a variant of the replay-dhv2-oplock1 test for leases
instead of for oplocks.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Michael Adam [Mon, 29 Feb 2016 18:00:42 +0000 (19:00 +0100)]
torture:smb2:replay: extend CHECK_CREATE_OUT() to know leases
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Michael Adam [Tue, 1 Mar 2016 00:18:03 +0000 (01:18 +0100)]
torture:smb2: split rename2 into multiple tests and extend these
- replay-regular
- replay-dhv2-oplock1
- replay-dhv2-oplock2
- replay-dhv2-oplock3
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Michael Adam [Tue, 1 Mar 2016 00:14:48 +0000 (01:14 +0100)]
torture:smb2: rename replay1 -> replay-commands
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Michael Adam [Wed, 2 Mar 2016 20:54:58 +0000 (21:54 +0100)]
vfs: remove an outdate comment from the files_struct definition
Leases are implemented since a while...
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Mar 3 12:16:47 CET 2016 on sn-devel-144
Jeremy Allison [Wed, 2 Mar 2016 01:25:25 +0000 (17:25 -0800)]
VFS: Modify chmod_acl to take a const struct smb_filename * instead of const char *
Preparing to reduce use of lp_posix_pathnames().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 2 Mar 2016 00:20:25 +0000 (16:20 -0800)]
VFS: Modify chmod to take a const struct smb_filename * instead of const char *
Preparing to reduce use of lp_posix_pathnames().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Justin Maggard [Wed, 2 Mar 2016 18:19:56 +0000 (10:19 -0800)]
s3:smbd: add negprot remote arch detection for OSX
Remote arch detection for OSX clients has been broken for some time, since
both Samba and OSX started supporting SMB2. Fix it by adding modern OSX
client detection support to the negprot remote arch detection routine.
Signed-off-by: Justin Maggard <jmaggard10@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar 3 09:03:53 CET 2016 on sn-devel-144
Justin Maggard [Wed, 2 Mar 2016 18:18:34 +0000 (10:18 -0800)]
s3:smbd: rework negprot remote arch detection
Negprot remote arch detection is very cryptic. Rework it so it's easier
to understand, and therefore more extensible, following the protocol table
in inline comments. This also allows us to remove some hacks.
Signed-off-by: Justin Maggard <jmaggard10@gmail.com>
Reviewed-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Uri Simchoni [Mon, 29 Feb 2016 20:09:57 +0000 (22:09 +0200)]
selftest: test access based share enum parameter
BUG: https://bugzilla.samba.org/show_bug.cgi?id=8093
Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Wed Mar 2 23:51:56 CET 2016 on sn-devel-144
Alberto Maria Fiaschi [Tue, 23 Feb 2016 17:22:10 +0000 (18:22 +0100)]
access based share enum: handle permission set in configuration files
change function is_enumeration_allowed to check permissions set by
fields: valid users, invalid users, only user.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=8093
Signed-off-by: Alberto Maria Fiaschi <alberto.fiaschi@estar.toscana.it>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Michael Adam [Tue, 1 Mar 2016 22:07:06 +0000 (23:07 +0100)]
torture:smb2: skip replay4 if server does not support multi-channel
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Mar 2 20:38:49 CET 2016 on sn-devel-144
Michael Adam [Tue, 1 Mar 2016 19:40:47 +0000 (20:40 +0100)]
smbd: fix crash in smbXsrv_client_global_remove()
Probably copy-n-paste error.
Uncovered by the multi-channel-related tests we're
currently writing to exercise this code more.
Pair-Programmed-With: Guenther Deschner <gd@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Jeremy Allison [Wed, 2 Mar 2016 05:52:44 +0000 (21:52 -0800)]
vfs:zfs fix build after get_nt_acl_fn signature change.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Wed Mar 2 10:50:58 CET 2016 on sn-devel-144
Michael Adam [Tue, 1 Mar 2016 23:18:32 +0000 (00:18 +0100)]
vfs:glusterfs: fix build after opendir signature change
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Mar 2 04:34:15 CET 2016 on sn-devel-144
Michael Adam [Tue, 1 Mar 2016 23:15:50 +0000 (00:15 +0100)]
vfs:ceph: fix build after opendir signature change.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Fri, 26 Feb 2016 11:54:23 +0000 (12:54 +0100)]
vfs/time_audit: use duration we get from the async backend
Finally! The previous commits changed the VFS and the async backend to
pass the duration of an aync operation up the stack.
We now can use this value instead of doing our own sampling which avoids
the following problem:
1. SMB2 read request received, added to the async queue
2. SMB2 create_file request comes in, is processed and blocks for N
seconds in open()
3. async read completes in the dispatcher thread, completion callback
will be called when we enter the main tevent loop
4. open() completes after N seconds
5. main tevent event loop is entered, async results are processed
6. async read result is processed, time sampling will include the N
seconds blocked in open()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Fri, 26 Feb 2016 10:14:36 +0000 (11:14 +0100)]
vfs/glusterfs: measure libglusterfs aio function call duration
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Fri, 26 Feb 2016 09:52:39 +0000 (10:52 +0100)]
vfs/aio_linux: measure libaio aio function call duration
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Fri, 26 Feb 2016 08:59:23 +0000 (09:59 +0100)]
vfs/aio_fork: measure async request syscall duration
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>