kai/samba-autobuild/.git
3 years agowinbind: Fix a typo in a wrong comment...
Volker Lendecke [Tue, 29 Mar 2016 12:49:17 +0000 (14:49 +0200)]
winbind: Fix a typo in a wrong comment...

While trying to disentangle this knot I could not stand to fix the obvious
typo. The whole comment is not really the whole story anymore, but that's a
commit for another day.

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): Wed Mar 30 21:54:40 CEST 2016 on sn-devel-144

3 years agoexamples/perfcounter/perf_writer.c: fix memset
Aurelien Aptel [Tue, 29 Mar 2016 15:30:36 +0000 (17:30 +0200)]
examples/perfcounter/perf_writer.c: fix memset

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agowinbind: Remove unused idmap_backends_unixid_to_sid
Volker Lendecke [Wed, 16 Mar 2016 14:35:51 +0000 (15:35 +0100)]
winbind: Remove unused idmap_backends_unixid_to_sid

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Mar 30 17:58:48 CEST 2016 on sn-devel-144

3 years agowinbind: Remove unused idmap_[ug]id_to_sid
Volker Lendecke [Wed, 16 Mar 2016 14:33:48 +0000 (15:33 +0100)]
winbind: Remove unused idmap_[ug]id_to_sid

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agowinbind: Use plural xids2sids in _wbint_UnixIDs2Sids
Volker Lendecke [Fri, 4 Mar 2016 14:45:24 +0000 (15:45 +0100)]
winbind: Use plural xids2sids in _wbint_UnixIDs2Sids

We've had plural xid2sid idmap backends for a while. Start using
them.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agowinbind: Pass down the domain name to xids2sids
Volker Lendecke [Wed, 16 Mar 2016 14:25:35 +0000 (15:25 +0100)]
winbind: Pass down the domain name to xids2sids

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agowinbind: Add idmap_backend_unixids_to_sids
Volker Lendecke [Fri, 4 Mar 2016 14:03:08 +0000 (15:03 +0100)]
winbind: Add idmap_backend_unixids_to_sids

This is the plural version of idmap_backends_unixid_to_sid that expects all ids
to come from the same idmap domain. The singular version walks the domain list
itself, this one expects the domain name to be passed to it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agowinbind: Do per-domain xids2sids calls
Volker Lendecke [Tue, 1 Mar 2016 13:34:26 +0000 (14:34 +0100)]
winbind: Do per-domain xids2sids calls

This prepares the equivalent of 2b1dd01934b657a for xids2sids.

Collecting sids2xids per domain is a bit easier: SIDs carry their own domain
prefix. For the reverse, we need to scan the configuration for all the idmap
range definitions.

It has a separate effect: It enables overlapping idmap ranges. The per-domain
calls are done whenever a range matches. If the idmap child finds a successful
xid2sid mapping, this will be collected as one result. This means that every
range definition can contribute mappings.

If there are two rfc2307 sfu domains with overlapping ranges, the domains will
be queried one after the other for a specific mapping. If the defined ranges
overlap, the admin has to make sure that there are no conflicts, because in the
current code "the first writer wins", and the code does not specify an order
(yet).

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agowinbind: Introduce id_map_ptrs_init
Volker Lendecke [Fri, 4 Mar 2016 13:23:51 +0000 (14:23 +0100)]
winbind: Introduce id_map_ptrs_init

This simplifies _wbint_Sids2UnixIDs a bit and will be re-used in _wbint_UnixIDs2Sids

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoidmap: Factor out lp_scan_idmap_domains()
Volker Lendecke [Mon, 22 Feb 2016 16:03:43 +0000 (17:03 +0100)]
idmap: Factor out lp_scan_idmap_domains()

This simplifies idmap_found_domain_backend() by moving the regex magic
somewhere else. Also, this routine will be useful soon somewhere else, thus
make it non-static to idmap.c.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoVLV: avoid name conflict with string.h's index()
Douglas Bagnall [Tue, 22 Mar 2016 21:54:01 +0000 (10:54 +1300)]
VLV: avoid name conflict with string.h's index()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-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): Wed Mar 30 14:26:51 CEST 2016 on sn-devel-144

3 years agotdb: avoid a race condition when checking for robust mutexes
Ralph Boehme [Sat, 26 Mar 2016 11:43:55 +0000 (12:43 +0100)]
tdb: avoid a race condition when checking for robust mutexes

This fixes a race between calling waitpid() in two places (SIGCHLD the
signal handler and the rendezvous code when waiting for the child to
terminate), by

- blocking SIGCHLD before installing our signal handler

- in the rendezvous code call sigssuspend() which unblocks SIGCHLD and
  suspends the thread and waits for signal delivery

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Mar 29 16:04:19 CEST 2016 on sn-devel-144

3 years agovfs_glusterfs: call clock_gettime_mono() only on profile-enabled build
Uri Simchoni [Mon, 28 Mar 2016 07:20:22 +0000 (10:20 +0300)]
vfs_glusterfs: call clock_gettime_mono() only on profile-enabled build

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 29 00:12:14 CEST 2016 on sn-devel-144

3 years agovfs_aio_fork: call clock_gettime_mono() only on profile-enabled build
Uri Simchoni [Mon, 28 Mar 2016 07:19:49 +0000 (10:19 +0300)]
vfs_aio_fork: call clock_gettime_mono() only on profile-enabled build

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agovfs_aio_linux: call clock_gettime_mono() only on profile-enabled build
Uri Simchoni [Mon, 28 Mar 2016 07:18:46 +0000 (10:18 +0300)]
vfs_aio_linux: call clock_gettime_mono() only on profile-enabled build

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoasys: call clock_gettime_mono() only on profile-enabled build
Uri Simchoni [Mon, 28 Mar 2016 07:17:03 +0000 (10:17 +0300)]
asys: call clock_gettime_mono() only on profile-enabled build

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3-profile: add PROFILE_TIMESTAMP macro
Uri Simchoni [Mon, 28 Mar 2016 07:13:50 +0000 (10:13 +0300)]
s3-profile: add PROFILE_TIMESTAMP macro

This is a get-timestamp macro which works only when
profiling is enabled in the build. The underlying
clock_gettime_mono() function can be costly on some
architectures and we want to avoid it if it's not
necessary.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3-profile: reduce dependencies of smbprofile.h
Uri Simchoni [Mon, 28 Mar 2016 07:11:33 +0000 (10:11 +0300)]
s3-profile: reduce dependencies of smbprofile.h

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib/util: fix function comment
Uri Simchoni [Mon, 28 Mar 2016 07:08:58 +0000 (10:08 +0300)]
lib/util: fix function comment

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3: vfs: Use the new VFS functions for setting and getting DOS attributes.
Jeremy Allison [Fri, 25 Mar 2016 22:32:09 +0000 (15:32 -0700)]
s3: vfs: Use the new VFS functions for setting and getting DOS attributes.

This will make it easier to support those systems and file systems that
can store DOS attributes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <rsharpe@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Mar 27 09:23:42 CEST 2016 on sn-devel-144

3 years agos3: vfs: Add VFS functions for setting and getting DOS attributes.
Richard Sharpe [Sun, 20 Mar 2016 19:51:32 +0000 (12:51 -0700)]
s3: vfs: Add VFS functions for setting and getting DOS attributes.

This will make it easier to support those systems and file systems that
can store DOS attributes. It should retain the original functionality if
VFS functions providing these things are not provided.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
3 years agos3: smbd: DFS: Pass uint32_t ucf_flags through into unix_convert().
Jeremy Allison [Fri, 25 Mar 2016 18:34:30 +0000 (11:34 -0700)]
s3: smbd: DFS: Pass uint32_t ucf_flags through into unix_convert().

This allows vendors to ensure that flags such as UCF_PREP_CREATEFILE
are always passed to their VFS modules whilst smbd is doing pathname
lookup - even before the create VFS call is done.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Mar 26 00:08:40 CET 2016 on sn-devel-144

3 years agos3: smbd: DFS: Pass uint32_t ucf_flags through into dfs_redirect().
Jeremy Allison [Fri, 25 Mar 2016 18:26:39 +0000 (11:26 -0700)]
s3: smbd: DFS: Pass uint32_t ucf_flags through into dfs_redirect().

Eventually move this down to the call to unix_convert()
inside the DFS code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
3 years agos3: smbd: DFS: Pass uint32_t ucf_flags through into resolve_dfspath_wcard().
Jeremy Allison [Fri, 25 Mar 2016 18:23:29 +0000 (11:23 -0700)]
s3: smbd: DFS: Pass uint32_t ucf_flags through into resolve_dfspath_wcard().

Eventually move this down to the call to unix_convert()
inside the DFS code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
3 years agopam_winbind: Create and use a wbclient context
Andreas Schneider [Thu, 24 Mar 2016 08:38:56 +0000 (09:38 +0100)]
pam_winbind: Create and use a wbclient context

PAM sessions are long running. If we create a pam session a connection
to winbind is established and only closed by the destructor of the
libwbclient library. If we create a wbcContext, we will free it in the
end of the PAM function being called and the socket will be closed. This
decreases the amount of allocated 'winbindd_cli_state' structures in
winbind for every logged in user.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Mar 25 17:45:24 CET 2016 on sn-devel-144

3 years agopam_winbind: Use the correct type to check the pam_parse() return code
Andreas Schneider [Thu, 24 Mar 2016 08:23:31 +0000 (09:23 +0100)]
pam_winbind: Use the correct type to check the pam_parse() return code

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agos3: smbd: DFS - Remove the last lp_posix_pathnames() from the SMB2/3 code paths.
Jeremy Allison [Sun, 20 Mar 2016 04:04:09 +0000 (21:04 -0700)]
s3: smbd: DFS - Remove the last lp_posix_pathnames() from the SMB2/3 code paths.

lp_posix_pathnames() is only used in one place in SMB1 DFS
processing - in dealing with buggy clients, and not at all in SMB2/3.

Note that the removal of lp_posix_pathnames() in the initial detection
of path separator is a change in behavior - but the case where an
incoming DFS name *doesn't* begin with the correct separator is a client bug,
so I'm comfortable with making this 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): Fri Mar 25 13:23:48 CET 2016 on sn-devel-144

3 years agoctdb-recovery-helper: Add banning to parallel recovery
Amitay Isaacs [Tue, 15 Mar 2016 04:08:24 +0000 (15:08 +1100)]
ctdb-recovery-helper: Add banning to parallel recovery

If one or more nodes are misbehaving during recovery, keep track of
failures as ban_credits.  If the node with the highest ban_credits exceeds
5 ban credits, then tell recovery daemon to assign banning credits.

This will ban only a single node at a time in case of recovery failure.

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 25 06:57:32 CET 2016 on sn-devel-144

3 years agoctdb-recoverd: Add message handler to assigning banning credits
Amitay Isaacs [Thu, 17 Mar 2016 06:26:30 +0000 (17:26 +1100)]
ctdb-recoverd: Add message handler to assigning banning credits

This will be called from recovery helper to assign banning credits to
misbehaving node.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-protocol: Add srvid for assigning banning credits
Amitay Isaacs [Thu, 17 Mar 2016 06:16:09 +0000 (17:16 +1100)]
ctdb-protocol: Add srvid for assigning banning credits

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-recovery-helper: Introduce new #define variable
Amitay Isaacs [Thu, 17 Mar 2016 03:22:17 +0000 (14:22 +1100)]
ctdb-recovery-helper: Introduce new #define variable

... instead of hardcoding number of retries.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-recovery-helper: Improve log message
Amitay Isaacs [Thu, 17 Mar 2016 03:13:02 +0000 (14:13 +1100)]
ctdb-recovery-helper: Improve log message

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-tests: Add a test for recovery of large databases
Amitay Isaacs [Sat, 5 Mar 2016 04:04:48 +0000 (15:04 +1100)]
ctdb-tests: Add a test for recovery of large databases

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-recovery-helper: Introduce push database abstraction
Amitay Isaacs [Thu, 25 Feb 2016 07:07:11 +0000 (18:07 +1100)]
ctdb-recovery-helper: Introduce push database abstraction

This abstraction uses capabilities of the remote nodes to either send
older PUSH_DB controls or newer DB_PUSH_START and DB_PUSH_CONFIRM
controls.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-recovery-helper: Introduce pull database abstraction
Amitay Isaacs [Wed, 24 Feb 2016 07:10:49 +0000 (18:10 +1100)]
ctdb-recovery-helper: Introduce pull database abstraction

This abstraction depending on the capability of the remote node either
uses older PULL_DB control or newer DB_PULL control.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-protocol: Add new capability
Amitay Isaacs [Tue, 23 Feb 2016 03:52:51 +0000 (14:52 +1100)]
ctdb-protocol: Add new capability

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-protocol: Add srvid for messages during recovery
Amitay Isaacs [Tue, 23 Feb 2016 07:03:10 +0000 (18:03 +1100)]
ctdb-protocol: Add srvid for messages during recovery

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-protocol: Introduce variable for checking srvid prefix
Amitay Isaacs [Wed, 23 Mar 2016 03:35:42 +0000 (14:35 +1100)]
ctdb-protocol: Introduce variable for checking srvid prefix

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-recovery-helper: Write recovery records to a recovery file
Amitay Isaacs [Tue, 8 Mar 2016 07:32:19 +0000 (18:32 +1100)]
ctdb-recovery-helper: Write recovery records to a recovery file

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-recovery-helper: Re-factor function to retain records from recdb
Amitay Isaacs [Tue, 8 Mar 2016 06:48:46 +0000 (17:48 +1100)]
ctdb-recovery-helper: Re-factor function to retain records from recdb

Also, rename traverse function and traverse state for recdb_records
consistently.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-protocol: Add file IO functions for ctdb_rec_buffer
Amitay Isaacs [Tue, 8 Mar 2016 06:20:30 +0000 (17:20 +1100)]
ctdb-protocol: Add file IO functions for ctdb_rec_buffer

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-recovery-helper: Create accessors for recdb structure fields
Amitay Isaacs [Mon, 29 Feb 2016 02:53:52 +0000 (13:53 +1100)]
ctdb-recovery-helper: Create accessors for recdb structure fields

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-recovery-helper: Rename pnn to dmaster in recdb_records()
Amitay Isaacs [Fri, 26 Feb 2016 04:42:53 +0000 (15:42 +1100)]
ctdb-recovery-helper: Rename pnn to dmaster in recdb_records()

This variable is used to set the dmaster value for each record in
recdb_traverse().

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-recovery-helper: Pass capabilities to database recovery functions
Amitay Isaacs [Thu, 25 Feb 2016 00:04:51 +0000 (11:04 +1100)]
ctdb-recovery-helper: Pass capabilities to database recovery functions

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-recovery-helper: Factor out generic recv function
Amitay Isaacs [Fri, 26 Feb 2016 06:36:39 +0000 (17:36 +1100)]
ctdb-recovery-helper: Factor out generic recv function

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-client: Add client API functions for new controls
Amitay Isaacs [Fri, 19 Feb 2016 00:14:40 +0000 (11:14 +1100)]
ctdb-client: Add client API functions for new controls

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-daemon: Implement new controls DB_PULL and DB_PUSH_START/DB_PUSH_CONFIRM
Amitay Isaacs [Fri, 19 Feb 2016 06:32:09 +0000 (17:32 +1100)]
ctdb-daemon: Implement new controls DB_PULL and DB_PUSH_START/DB_PUSH_CONFIRM

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-protocol: Add new controls DB_PULL and DB_PUSH_START/DB_PUSH_CONFIRM
Amitay Isaacs [Thu, 18 Feb 2016 23:54:15 +0000 (10:54 +1100)]
ctdb-protocol: Add new controls DB_PULL and DB_PUSH_START/DB_PUSH_CONFIRM

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-protocol: Add new data type ctdb_pulldb_ext for new control
Amitay Isaacs [Thu, 18 Feb 2016 23:45:19 +0000 (10:45 +1100)]
ctdb-protocol: Add new data type ctdb_pulldb_ext for new control

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-tunables: Add new tunable RecBufferSizeLimit
Amitay Isaacs [Tue, 8 Mar 2016 06:29:31 +0000 (17:29 +1100)]
ctdb-tunables: Add new tunable RecBufferSizeLimit

This will be used to limit the size of record buffer sent in newer
controls for recovery and existing controls for vacuuming.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-client: Add client API for sending message to multiple nodes
Amitay Isaacs [Fri, 26 Feb 2016 03:12:19 +0000 (14:12 +1100)]
ctdb-client: Add client API for sending message to multiple nodes

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agos3: torture. Remove spurious lp_posix_pathnames() included by cut-and-paste error.
Jeremy Allison [Sun, 20 Mar 2016 04:07:01 +0000 (21:07 -0700)]
s3: torture. Remove spurious lp_posix_pathnames() included by cut-and-paste error.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Mar 25 02:23:56 CET 2016 on sn-devel-144

3 years agos3: smbd: Modify vfs_stat_smb_basename() to take a const struct smb_filename * instea...
Jeremy Allison [Sat, 19 Mar 2016 05:17:30 +0000 (22:17 -0700)]
s3: smbd: Modify vfs_stat_smb_basename() to take a const struct smb_filename * instead of const char *.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agos3: vfs: vfs_acl_tdb. Remove use of vfs_stat_smb_basename().
Jeremy Allison [Sat, 19 Mar 2016 05:15:12 +0000 (22:15 -0700)]
s3: vfs: vfs_acl_tdb. Remove use of vfs_stat_smb_basename().

We only need a basic STAT here.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agos3: vfs: recycle. Remove use of vfs_stat_smb_basename().
Jeremy Allison [Sat, 19 Mar 2016 05:10:34 +0000 (22:10 -0700)]
s3: vfs: recycle. Remove use of vfs_stat_smb_basename().

We only need a basic STAT here.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agos3: smbd: Remove many common uses of lp_posix_pathnames().
Jeremy Allison [Sat, 19 Mar 2016 04:58:20 +0000 (21:58 -0700)]
s3: smbd: Remove many common uses of lp_posix_pathnames().

Check the smb_filename->flags field, or req->posix_pathnames
instead, depending on what is available.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agos3: smbd: Remove unneeded lp_posix_pathnames() check in SMB2 create.
Jeremy Allison [Sat, 19 Mar 2016 04:55:05 +0000 (21:55 -0700)]
s3: smbd: Remove unneeded lp_posix_pathnames() check in SMB2 create.

Add a comment reminding me to re-add the check when SMB2
unix extensions are re-added.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agos3: posix_acls. Always use STAT, not LSTAT here.
Jeremy Allison [Sat, 19 Mar 2016 04:50:15 +0000 (21:50 -0700)]
s3: posix_acls. Always use STAT, not LSTAT here.

We have already refused acls on a symlink.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agos3: vfs: Remove use of lp_posix_pathnames() below the VFS.
Jeremy Allison [Sat, 19 Mar 2016 04:31:22 +0000 (21:31 -0700)]
s3: vfs: Remove use of lp_posix_pathnames() below the VFS.

We don't have access to a struct smb_filename here and
can't get one, so simply always set AT_SYMLINK_NOFOLLOW
and remove the optimization if we ended up fstatat()'ing
a symlink, as we don't know if the caller wanted a link
stat or not.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agos3: Filenames: Add uint32_t flags parameter to synthetic_smb_fname().
Jeremy Allison [Sat, 19 Mar 2016 04:19:38 +0000 (21:19 -0700)]
s3: Filenames: Add uint32_t flags parameter to synthetic_smb_fname().

Get it from parent/deriving smb_filename if present.
Use 0 (as usually this a Windows-style lookup) if
not.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agos3: smbd: Add uint32_t flags field to struct smb_filename.
Jeremy Allison [Thu, 17 Mar 2016 23:20:17 +0000 (16:20 -0700)]
s3: smbd: Add uint32_t flags field to struct smb_filename.

Only one defined flag for now, SMB_FILENAME_POSIX_PATH.
Define as the same as FSP_POSIX_FLAGS_PATHNAMES to keep
the value consistent.

Set this inside unix_convert() when a posix path parse
is selected.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agos3:smbd: Move lp_posix_pathnames() out of ea_list_has_invalid_name().
Jeremy Allison [Tue, 15 Mar 2016 18:43:32 +0000 (11:43 -0700)]
s3:smbd: Move lp_posix_pathnames() out of ea_list_has_invalid_name().

External uses will be replaced by checks on struct smb_filename flags.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agos3: vfs: vfs_afsacl. refuse_symlink() means we can always use STAT here.
Jeremy Allison [Tue, 15 Mar 2016 18:46:58 +0000 (11:46 -0700)]
s3: vfs: vfs_afsacl. refuse_symlink() means we can always use STAT here.

For a posix acl call on a symlink, we've already refused it.
For a Windows acl mapped call on a symlink, we want to follow
it.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agos3:smbd: Fix build for vfs_afsacl.c.
Jeremy Allison [Thu, 17 Mar 2016 23:44:50 +0000 (16:44 -0700)]
s3:smbd: Fix build for vfs_afsacl.c.

Missed conversion of get_nt_acl_fn from const char *
to const struct smb_filename *.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agoFix an obvious error where we were converting a UNIX error to an NT STATUS but not...
Richard Sharpe [Thu, 24 Mar 2016 04:56:30 +0000 (21:56 -0700)]
Fix an obvious error where we were converting a UNIX error to an NT STATUS but not returning it.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoselftest/Samba3: use the correct "SELFTEST_WINBINDD_SOCKET_DIR" for "net join"
Stefan Metzmacher [Tue, 22 Mar 2016 13:09:08 +0000 (14:09 +0100)]
selftest/Samba3: use the correct "SELFTEST_WINBINDD_SOCKET_DIR" for "net join"

This avoids picking up a gid from the DC's winbind when
creating BUILTIN\Administrators

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Mar 24 22:15:44 CET 2016 on sn-devel-144

3 years agothird_party/zlib/zlib.h: use HAVE___ATTRIBUTE__ instead of __GNUC__
Douglas Bagnall [Wed, 23 Mar 2016 02:30:22 +0000 (15:30 +1300)]
third_party/zlib/zlib.h: use HAVE___ATTRIBUTE__ instead of __GNUC__

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Thu Mar 24 18:43:34 CET 2016 on sn-devel-144

3 years agos4/lib/wmi_wrap: use HAVE___ATTRIBUTE__ instead of __GNUC__
Douglas Bagnall [Wed, 23 Mar 2016 02:29:50 +0000 (15:29 +1300)]
s4/lib/wmi_wrap: use HAVE___ATTRIBUTE__ instead of __GNUC__

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agomdssvc/sparql_parser.c: use HAVE___ATTRIBUTE__ instead of __GNUC__
Douglas Bagnall [Wed, 23 Mar 2016 02:28:45 +0000 (15:28 +1300)]
mdssvc/sparql_parser.c: use HAVE___ATTRIBUTE__ instead of __GNUC__

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agos3/modules/getdate: use HAVE___ATTRIBUTE__ instead of __GNUC__
Douglas Bagnall [Wed, 23 Mar 2016 02:27:45 +0000 (15:27 +1300)]
s3/modules/getdate: use HAVE___ATTRIBUTE__ instead of __GNUC__

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agotevent.h: use HAVE___ATTRIBUTE__ instead of __GNUC__
Douglas Bagnall [Wed, 23 Mar 2016 02:26:49 +0000 (15:26 +1300)]
tevent.h: use HAVE___ATTRIBUTE__ instead of __GNUC__

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agolibreplace: use HAVE___ATTRIBUTE__ instead of __GNUC__
Douglas Bagnall [Wed, 23 Mar 2016 02:26:03 +0000 (15:26 +1300)]
libreplace: use HAVE___ATTRIBUTE__ instead of __GNUC__

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agoutil/attr.h: use HAVE___ATTRIBUTE__, not __GNUC__ comparisons
Douglas Bagnall [Tue, 22 Mar 2016 22:16:48 +0000 (11:16 +1300)]
util/attr.h: use HAVE___ATTRIBUTE__, not __GNUC__ comparisons

The comparisons that look like

    #if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )

fail if __GNUC_MINOR__ is 0.  The intended comparison is something
more like

    #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)

However, given that:

 * these checks are really trying to test the presence of
   __attribute__,

 * there are now credible compilers that are not GCC, which have
   __attribute__ but might not be good at emulating __GNUC__
   numbers, and

 * we really face little risk of running into GCC 2.95

 * we have a HAVE___ATTRIBUTE__ check in ./configure

let's not do the version comparisons.

(Untested on GCC 2.95, GCC 3.0 and GCC 3.1).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agos4-libnet: Link dckeytab.so correctly when is AD DC enabled
Andreas Schneider [Thu, 10 Mar 2016 13:30:38 +0000 (14:30 +0100)]
s4-libnet: Link dckeytab.so correctly when is AD DC enabled

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Mar 24 15:12:21 CET 2016 on sn-devel-144

3 years agos4:torture:smb2:rename.c: Fix file permissions.
Günther Deschner [Wed, 23 Mar 2016 13:41:23 +0000 (14:41 +0100)]
s4:torture:smb2:rename.c: Fix file permissions.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar 24 06:33:03 CET 2016 on sn-devel-144

3 years agoseltest: add test for "ignore system acls" in vfs_acl_xattr.
Uri Simchoni [Mon, 21 Mar 2016 21:13:25 +0000 (23:13 +0200)]
seltest: add test for "ignore system acls" in vfs_acl_xattr.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agovfs_acl_common: avoid setting POSIX ACLs if "ignore system acls" is set
Uri Simchoni [Mon, 21 Mar 2016 21:04:24 +0000 (23:04 +0200)]
vfs_acl_common: avoid setting POSIX ACLs if "ignore system acls" is set

When "ignore system acls" is set, do not mess at all with POSIX ACLS,
do not even calculate the would-be POSIX-ACL-based security descriptor
(for performance reasons).
Instead, just store a V3 blob with zero hash. This means that if we
later read the ACL without ignoring system ACLs, the NT ACL shall be
reset to the info derivable from the POSIX ACL.

File ownership is still modified as it has bearing on disk quotas.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos4-libnet: only build python-dckeytab module for Heimdal in AD DC mode
Alexander Bokovoy [Wed, 23 Mar 2016 06:15:34 +0000 (08:15 +0200)]
s4-libnet: only build python-dckeytab module for Heimdal in AD DC mode

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Wed Mar 23 23:43:51 CET 2016 on sn-devel-144

3 years agoRevert "autobuild: Return the last 50 log lines"
Stefan Metzmacher [Wed, 23 Mar 2016 10:07:08 +0000 (11:07 +0100)]
Revert "autobuild: Return the last 50 log lines"

This reverts commit aab2f39bb7ff330fbb01da4021c096e69a429d2e.

This breaks if log_base is an https url...

Traceback (most recent call last):
  File "script/autobuild.py", line 744, in <module>
    elapsed_time, log_base=options.log_base)
  File "script/autobuild.py", line 608, in email_failure
    f = open("%s/%s.stdout" % (log_base, failed_tag), 'r')
IOError: [Errno 2] No such file or directory:
'https://git.samba.org/uri/samba-autobuild/ctdb.stdout'

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Mar 23 18:59:17 CET 2016 on sn-devel-144

3 years agotorture: Fix the O3 developer build
Volker Lendecke [Tue, 22 Mar 2016 15:03:58 +0000 (16:03 +0100)]
torture: Fix the O3 developer build

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): Tue Mar 22 22:48:52 CET 2016 on sn-devel-144

3 years agos3:ntlm_auth: pass manage_squid_request() needs a valid struct ntlm_auth_state from...
Stefan Metzmacher [Mon, 21 Mar 2016 18:41:53 +0000 (19:41 +0100)]
s3:ntlm_auth: pass manage_squid_request() needs a valid struct ntlm_auth_state from within get_password()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Mar 22 19:20:38 CET 2016 on sn-devel-144

3 years agos3:rpc_server/samr: correctly handle session_extract_session_key() failures
Stefan Metzmacher [Sun, 28 Feb 2016 22:32:50 +0000 (23:32 +0100)]
s3:rpc_server/samr: correctly handle session_extract_session_key() failures

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agowinbind: Fix CID 1357100 Unchecked return value
Volker Lendecke [Tue, 22 Mar 2016 10:24:23 +0000 (11:24 +0100)]
winbind: Fix CID 1357100 Unchecked return value

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): Tue Mar 22 15:49:14 CET 2016 on sn-devel-144

3 years agoautobuild: Return the last 50 log lines
Garming Sam [Mon, 14 Mar 2016 01:18:54 +0000 (14:18 +1300)]
autobuild: Return the last 50 log lines

This means that you don't have to deal with tars for quickly determining
the cause of a failure.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Mar 22 11:39:38 CET 2016 on sn-devel-144

3 years agoldb_controls: avoid unnecessary unchecked talloc_asprintf()s
Douglas Bagnall [Tue, 22 Mar 2016 00:42:12 +0000 (13:42 +1300)]
ldb_controls: avoid unnecessary unchecked talloc_asprintf()s

The error paths when a control doesn't parse involved a lot of
talloc_asprintf()s and talloc_asprintf_append()s but almost no actual
printf formatting. The return values were not checked. This replaces
them with constant strings.

The one case that did use formatting looked like this:

 "invalid %s control syntax\n",  LDB_CONTROL_DIRSYNC_EX_NAME

and that has been replaced with

  "invalid dirsync_ex control syntax\n"

in line with the way it is done elsewhere.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoldb controls: allow paged_search to use a cookie
Douglas Bagnall [Tue, 15 Mar 2016 23:56:09 +0000 (12:56 +1300)]
ldb controls: allow paged_search to use a cookie

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoldb client controls: don't ignore failed memdup
Douglas Bagnall [Tue, 22 Mar 2016 00:32:12 +0000 (13:32 +1300)]
ldb client controls: don't ignore failed memdup

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agodsdb python tests: fix several usage strings
Douglas Bagnall [Fri, 11 Mar 2016 02:17:43 +0000 (15:17 +1300)]
dsdb python tests: fix several usage strings

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agodsdb sort test: avoid exception with fewer elements
Douglas Bagnall [Mon, 21 Mar 2016 21:25:27 +0000 (10:25 +1300)]
dsdb sort test: avoid exception with fewer elements

The FIENDISH_TESTS list has 33 members, and when the number of
elements being tested is less than that (because you run the script
with, say, --elements=20) some will have a zero count. A recent fix
for Python 2.6 didn't take these possible zeros into account.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoldb sort tests: point out a known fails against Windows
Douglas Bagnall [Mon, 14 Mar 2016 23:51:18 +0000 (12:51 +1300)]
ldb sort tests: point out a known fails against Windows

It seems that Windows 2012R2 has issues ordering attributes with the
"generalized time" syntax (2.5.5.11), and that these show up in our
tests when the number of elements exceeds 27. As far as I can tell
there is no logic to the results after that point.

To avoid failures, use the --elements option, like this:

python source4/dsdb/tests/python/sort.py --elements=25

Against Samba this makes no difference because we don't fail.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoldb controls: don't ignore memory allocation failure
Douglas Bagnall [Thu, 10 Mar 2016 21:26:10 +0000 (10:26 +1300)]
ldb controls: don't ignore memory allocation failure

Thanks to Jeremy Allison for noticing this.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoImplement Virtual List View (VLV)
Douglas Bagnall [Tue, 8 Mar 2016 01:28:33 +0000 (14:28 +1300)]
Implement Virtual List View (VLV)

VLV is a more sophisticated version of a paged searches that allows
you to ask for arbitrary windows in a previously performed sorted
search. If clients use VLV correctly the original search will not be
repeated.

Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosort: enable custom behaviour on critical control
Garming Sam [Thu, 10 Mar 2016 02:25:44 +0000 (15:25 +1300)]
sort: enable custom behaviour on critical control

The sort module should simply return unsorted results when a sort is
unsupported but not critical. A similar custom behaviour should be
expected with VLV pagination when it is enabled.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agondrdump: add quiet flag
Douglas Bagnall [Tue, 1 Mar 2016 01:13:18 +0000 (14:13 +1300)]
ndrdump: add quiet flag

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agondr: inline search for ndr_token_peek()
Douglas Bagnall [Fri, 26 Feb 2016 03:58:09 +0000 (16:58 +1300)]
ndr: inline search for ndr_token_peek()

This is often a hot path, particularly with complex structures like
nt-acls.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agondr: Use ndr_steal to avoid long lists
Douglas Bagnall [Tue, 1 Mar 2016 01:18:52 +0000 (14:18 +1300)]
ndr: Use ndr_steal to avoid long lists

When pulling complex structures like nt-acls, a long list of tokens may
be produced. By removing tokens along the way with ndr_token_steal,
future calls to retrieve from the token list are not as expensive.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agolibrpc ndr: add ndr_pull_steal_switch_value()
Douglas Bagnall [Mon, 29 Feb 2016 23:26:33 +0000 (12:26 +1300)]
librpc ndr: add ndr_pull_steal_switch_value()

Switch values currently only have a peek variant, instead of a retrieve
variant for getting their values. This can create performance issues
with complex structures as the token list simply grows longer.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agondr: avoid unnecessary searches of token list
Douglas Bagnall [Fri, 26 Feb 2016 04:01:37 +0000 (17:01 +1300)]
ndr: avoid unnecessary searches of token list

When pulling complex structures like nt-acls, a long list of tokens
may be produced. This change means the token list won't be walked in the
buffers case if the switch value is not needed.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agonsswitch: winbind_nss_solaris.c: Remove unused macro containing strcpy.
Jeremy Allison [Wed, 16 Mar 2016 21:19:57 +0000 (14:19 -0700)]
nsswitch: winbind_nss_solaris.c: Remove unused macro containing strcpy.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Mar 22 07:59:35 CET 2016 on sn-devel-144

3 years agonsswitch: winbind_nss_aix: Remove all uses of strcpy.
Jeremy Allison [Wed, 16 Mar 2016 21:04:34 +0000 (14:04 -0700)]
nsswitch: winbind_nss_aix: Remove all uses of strcpy.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>