kai/samba-autobuild/.git
3 years agodbwrap_util: improve a debug message in dbwrap_delete_action()
Michael Adam [Thu, 25 Feb 2016 15:02:36 +0000 (16:02 +0100)]
dbwrap_util: improve a debug message in dbwrap_delete_action()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agolib: Fix 1354521 Unchecked return value
Volker Lendecke [Tue, 1 Mar 2016 11:43:32 +0000 (12:43 +0100)]
lib: Fix 1354521 Unchecked return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Tue Mar  1 21:49:44 CET 2016 on sn-devel-144

3 years agontvfs: Fix CID 1354522 Unchecked return value
Volker Lendecke [Tue, 1 Mar 2016 11:42:37 +0000 (12:42 +0100)]
ntvfs: Fix CID 1354522 Unchecked return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
3 years agos3: smbd: Change dptr_create() to take a const struct smb_filename * instead of const...
Jeremy Allison [Sat, 27 Feb 2016 00:35:17 +0000 (16:35 -0800)]
s3: smbd: Change dptr_create() to take a const struct smb_filename * instead of const char *.

Also internally change path storage inside struct dptr_struct
to a struct smb_filename *.

This allows me to remove several of the synthetic_smb_fname()
calls I had to add in the previous patches, as we're now
dealing with struct smb_filename * throughout the dptr and
OpenDir code.

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): Tue Mar  1 18:34:24 CET 2016 on sn-devel-144

3 years agos3: smbd: In call_trans2findfirst() all use of ctx is really talloc_tos().
Jeremy Allison [Sat, 27 Feb 2016 00:31:10 +0000 (16:31 -0800)]
s3: smbd: In call_trans2findfirst() all use of ctx is really talloc_tos().

Use talloc_tos() explicitly to make this clear. Will help make the next
commit clearer.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: smbd: Change OpenDir() to take a struct smb_filename *, not a char *.
Jeremy Allison [Fri, 26 Feb 2016 23:55:14 +0000 (15:55 -0800)]
s3: smbd: Change OpenDir() to take a struct smb_filename *, not a char *.

Enhances plumbing to remove lp_posix_pathnames() later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: smbd: Change the internals of the private struct smb_Dir.
Jeremy Allison [Fri, 26 Feb 2016 22:59:51 +0000 (14:59 -0800)]
s3: smbd: Change the internals of the private struct smb_Dir.

Store a struct smb_filename *, not a char *. This will
allow us to change the interface to OpenDir() in the next
commit to pass in a struct smb_filename *, not a char *.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agoVFS: Modify opendir to take a const struct smb_filename * instead of const char *
Jeremy Allison [Fri, 26 Feb 2016 22:53:12 +0000 (14:53 -0800)]
VFS: Modify opendir to take a const struct smb_filename * instead of const char *

Preparing to reduce use of lp_posix_pathnames().

Uses the same techniques as commit 616d068f0cebb8e50a855b6e30f36fccb7f5a3c8
(synthetic_smb_fname()) to cope with modules that
modify the incoming pathname.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agopassdb: add linefeed to debug message
Uri Simchoni [Tue, 1 Mar 2016 08:36:35 +0000 (10:36 +0200)]
passdb: add linefeed to debug message

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Mar  1 15:24:35 CET 2016 on sn-devel-144

3 years agos3/passdb/py_passdb.c: free frame before returning
Aurelien Aptel [Mon, 29 Feb 2016 17:23:39 +0000 (18:23 +0100)]
s3/passdb/py_passdb.c: free frame before returning

these talloc frames are freed *after* the return instruction and are
never executed. this fixes potential memory leaks.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue Mar  1 12:08:40 CET 2016 on sn-devel-144

3 years agoctdb-tests: Override local daemon configuration from the environment
Martin Schwenke [Fri, 26 Feb 2016 09:08:11 +0000 (20:08 +1100)]
ctdb-tests: Override local daemon configuration from the environment

Anything starting with CTDB_ is appended to each node's configuration
file.

This is made slightly more difficult because the "env" command doesn't
necessarily quote values for consumption by the shell.  The strategy
used here is a bit fragile (assumes double-quotes, no nested quotes)
but this is test code and only developers are expected to use this
override.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Mar  1 08:56:09 CET 2016 on sn-devel-144

3 years agoctdb-tests: Change local daemon startup to use ctdbd_wrapper
Martin Schwenke [Fri, 26 Feb 2016 08:36:25 +0000 (19:36 +1100)]
ctdb-tests: Change local daemon startup to use ctdbd_wrapper

This uses a configuration file which can be more easily overridden
that explicit command-line options.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-tests: Simplify handling of public addresses for local daemons
Martin Schwenke [Fri, 26 Feb 2016 05:51:50 +0000 (16:51 +1100)]
ctdb-tests: Simplify handling of public addresses for local daemons

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-scripts: Allow configuration file to be overridden
Martin Schwenke [Fri, 26 Feb 2016 05:47:59 +0000 (16:47 +1100)]
ctdb-scripts: Allow configuration file to be overridden

For testing only (so not documented), set CTDBD_CONF.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agolib/util: Add strv_util.[ch] containing new function strv_split()
Martin Schwenke [Mon, 29 Feb 2016 04:18:52 +0000 (15:18 +1100)]
lib/util: Add strv_util.[ch] containing new function strv_split()

strv_split() adds to a strv by splitting a string on separators.

Tests included.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agoctdb: Fix detection of gnukfreebsd
Steven Chamberlain [Thu, 11 Feb 2016 02:27:29 +0000 (02:27 +0000)]
ctdb: Fix detection of gnukfreebsd

GNU/kFreeBSD's platform name is 'gnukfreebsd', not just 'kfreebsd'.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Tue Mar  1 05:42:23 CET 2016 on sn-devel-144

3 years agolib/util/util.c: move null-check before use
Aurelien Aptel [Thu, 25 Feb 2016 13:11:10 +0000 (14:11 +0100)]
lib/util/util.c: move null-check before use

moves a null pointer check *before* the pointer is used in
the strlen() call

- still allocate the `fname` array on the stack
- still compiles under C90 definition/code mixing rules

Signed-off-by: Aurelien Aptel <aaptel@suse.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): Tue Mar  1 02:25:22 CET 2016 on sn-devel-144

3 years agotorture:smb2: fix skip message if share is not CA
Michael Adam [Mon, 29 Feb 2016 00:52:42 +0000 (01:52 +0100)]
torture:smb2: fix skip message if share is not CA

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agotorture:smb2: skip replay5 test if server does not support persistent handles
Michael Adam [Mon, 29 Feb 2016 00:52:07 +0000 (01:52 +0100)]
torture:smb2: skip replay5 test if server does not support persistent handles

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agotorture:smb2: skip replay3 if server does not support Multi-Channel
Michael Adam [Mon, 29 Feb 2016 00:51:23 +0000 (01:51 +0100)]
torture:smb2: skip replay3 if server does not support Multi-Channel

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib/util: Add tests for strv_addn()
Martin Schwenke [Mon, 29 Feb 2016 09:04:19 +0000 (20:04 +1100)]
lib/util: Add tests for strv_addn()

Also some other minor test cleanups.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Feb 29 15:18:17 CET 2016 on sn-devel-144

3 years agolib/util: Add strv_addn()
Volker Lendecke [Mon, 29 Feb 2016 04:15:04 +0000 (15:15 +1100)]
lib/util: Add strv_addn()

strv_addn() adds some number of characters from an existing string.
This is useful for parsing.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoRevert "lib/util: Expose strv_addn() for adding string with specified length"
Martin Schwenke [Mon, 29 Feb 2016 08:49:39 +0000 (19:49 +1100)]
Revert "lib/util: Expose strv_addn() for adding string with specified length"

This reverts commit 0c61dd15137b4603bd47b3d6ae18ded6bd18ffae.

The intention of strv_addn() is to be able to add some number of
characters from an existing string.  This implementation carelessly
assumes that the old _strv_append() added the trailing NUL to form a
valid strv.  That's not true.

New implementation to follow.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agosmbd:smb2_creat: remove outdated TODO comments
Michael Adam [Sun, 28 Feb 2016 00:46:47 +0000 (01:46 +0100)]
smbd:smb2_creat: remove outdated TODO comments

Leases have meanwhile been implemented and the
TODO has been taken care of.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allson <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Feb 28 08:16:26 CET 2016 on sn-devel-144

3 years agosmbXsrv_client: factor fetch-locking of global record into function
Michael Adam [Sat, 27 Feb 2016 00:58:45 +0000 (01:58 +0100)]
smbXsrv_client: factor fetch-locking of global record into function

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbXsrv_session: factor fetch-locking of local record into function
Michael Adam [Sat, 27 Feb 2016 00:37:34 +0000 (01:37 +0100)]
smbXsrv_session: factor fetch-locking of local record into function

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbXsrv_session: factor fetch-locking of global record into function
Michael Adam [Sat, 27 Feb 2016 00:26:16 +0000 (01:26 +0100)]
smbXsrv_session: factor fetch-locking of global record into function

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbXsrv_tcon: factor fetch-locking of local record into function
Michael Adam [Sat, 27 Feb 2016 00:06:13 +0000 (01:06 +0100)]
smbXsrv_tcon: factor fetch-locking of local record into function

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbXsrv_tcon: factor fetch-locking of global record into function
Michael Adam [Fri, 26 Feb 2016 23:52:59 +0000 (00:52 +0100)]
smbXsrv_tcon: factor fetch-locking of global record into function

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/libsmb/clirap2.c: use actual buffer size
Aurelien Aptel [Thu, 25 Feb 2016 13:39:10 +0000 (14:39 +0100)]
s3/libsmb/clirap2.c: use actual buffer size

data used to be a stack allocated array but was changed to a heap
allocated buffer by commit 95a81a3. Update sizeof(data) to data_size.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Feb 27 05:25:40 CET 2016 on sn-devel-144

3 years agosmbXsrv_open: factor fetch-locking of local record into function
Michael Adam [Thu, 25 Feb 2016 23:53:22 +0000 (00:53 +0100)]
smbXsrv_open: factor fetch-locking of local record into function

smbXsrv_open_local_fetch_locked()

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): Fri Feb 26 22:35:28 CET 2016 on sn-devel-144

3 years agosmbXsrv_open: factor fetch-locking of global record into function
Michael Adam [Thu, 25 Feb 2016 23:41:24 +0000 (00:41 +0100)]
smbXsrv_open: factor fetch-locking of global record into function

smbXsrv_open_global_fetch_locked()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib/util: Add tests for strv
Martin Schwenke [Fri, 26 Feb 2016 04:23:31 +0000 (15:23 +1100)]
lib/util: Add tests for strv

These are blackbox tests against most of the API.

It would be possible to write tests that check the internals of the
strv are as expected but that probably doesn't add much value.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib/util/idtree.c: fix UB by using uint in left-shift
Aurelien Aptel [Thu, 25 Feb 2016 12:58:01 +0000 (13:58 +0100)]
lib/util/idtree.c: fix UB by using uint in left-shift

Using negative values on the left-side of a left-shift operation is an
Undefined Behaviour in C.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
3 years agoselftest: Add a blackbox test for smbget
Christian Ambach [Sat, 6 Feb 2016 09:30:29 +0000 (10:30 +0100)]
selftest: Add a blackbox test for smbget

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Fri Feb 26 14:40:55 CET 2016 on sn-devel-144

3 years agoselftest: add a helper for the smbget binary
Christian Ambach [Thu, 4 Feb 2016 20:41:08 +0000 (21:41 +0100)]
selftest: add a helper for the smbget binary

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agoselftest: Reduce code duplication
Christian Ambach [Wed, 17 Feb 2016 23:48:04 +0000 (00:48 +0100)]
selftest: Reduce code duplication

Factor out a createuser sub.

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:utils/smbget fix option parsing
Christian Ambach [Sat, 20 Feb 2016 20:11:51 +0000 (21:11 +0100)]
s3:utils/smbget fix option parsing

* use proper values for val in poptOption
* popt does not support bool, so set them via the switch statement
* abort when option parsing reported errors

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agoWHATSNEW: document removal of -P in smbget
Christian Ambach [Wed, 17 Feb 2016 21:57:59 +0000 (22:57 +0100)]
WHATSNEW: document removal of -P in smbget

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:utils/smbget update manpage with -P option removal
Christian Ambach [Wed, 17 Feb 2016 18:25:59 +0000 (19:25 +0100)]
s3:utils/smbget update manpage with -P option removal

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:utils/smbget remove -P option
Christian Ambach [Mon, 15 Feb 2016 21:25:11 +0000 (22:25 +0100)]
s3:utils/smbget remove -P option

as agreed on samba-technical list.
It does not really provide a useful function but can cause confusion

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:utils/smbget improve check of write() result
Christian Ambach [Mon, 8 Feb 2016 22:27:09 +0000 (23:27 +0100)]
s3:utils/smbget improve check of write() result

check that all bytes in the buffer have been written

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:utils/smbget abort recursive download on error
Christian Ambach [Mon, 8 Feb 2016 22:25:04 +0000 (23:25 +0100)]
s3:utils/smbget abort recursive download on error

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:utils/smbget another int -> bool conversion
Christian Ambach [Mon, 8 Feb 2016 22:24:36 +0000 (23:24 +0100)]
s3:utils/smbget another int -> bool conversion

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:libads: setup the msDS-SupportedEncryptionTypes attribute on ldap_add
Stefan Metzmacher [Fri, 22 Jan 2016 08:57:04 +0000 (09:57 +0100)]
s3:libads: setup the msDS-SupportedEncryptionTypes attribute on ldap_add

We may not have the permission to modify the object after creation.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bj@sernet.de>
Reviewed-by: Günther Deschner <gd@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Feb 26 11:30:03 CET 2016 on sn-devel-144

3 years agoctdb: Drop unnecessary defines of TEVENT_DEPRECATED
Martin Schwenke [Wed, 24 Feb 2016 05:05:34 +0000 (16:05 +1100)]
ctdb: Drop unnecessary defines of TEVENT_DEPRECATED

These have been scattered around the code so that
tevent_loop_allow_nesting() can be called.  However, only the main
daemon and some tests currently use nested event loops.
TEVENT_DEPRECATED is already defined in the places where it is needed.

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): Fri Feb 26 07:11:29 CET 2016 on sn-devel-144

3 years agovfs_gpfs: Fix compile after change in get_nt_acl_fn
Christof Schmitt [Thu, 25 Feb 2016 20:42:21 +0000 (13:42 -0700)]
vfs_gpfs: Fix compile after change in get_nt_acl_fn

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Feb 26 01:21:21 CET 2016 on sn-devel-144

3 years agos3/lib/netapi/tests/netuser.c: fix wrong closing paren
Aurelien Aptel [Thu, 25 Feb 2016 13:17:46 +0000 (14:17 +0100)]
s3/lib/netapi/tests/netuser.c: fix wrong closing paren

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Revewied-by: Jeremy Allison <jra@samba.org>
3 years agos3/vfs_btrfs.c: use sizeof() instead of ARRAY_SIZE()
Aurelien Aptel [Thu, 25 Feb 2016 14:55:07 +0000 (15:55 +0100)]
s3/vfs_btrfs.c: use sizeof() instead of ARRAY_SIZE()

The `unused` member being set to zero is an uint64_t array. We want the
byte size here.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: ignore SVHDX create context
Uri Simchoni [Thu, 25 Feb 2016 05:08:06 +0000 (07:08 +0200)]
smbd: ignore SVHDX create context

According to discussions with dochelp@microsoft.com, an SMB
server should ignore an SVHDX_OPEN_DEVICE_CONTEXT or
SVHDX_OPEN_DEVICE_CONTEXT_V2 create context if it does not
support the RSVD protocol. This is contrary to [MS-SMB2] rev 48.0
which states (3.3.5.9.14) that the open should fail in this case.

Failing the create fails Windows backup if the SMB dialect is
SMB3.0.2 or higher.

Hopefully a new revision of MS-SMB2 will clear this up in the future.

Meanwhile, this patch modifies smbd to ignore the
SVHDX_OPEN_DEVICE_CONTEXT by default. This can be overriden by a VFS
module if a VFS module adds support for RSVD.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
3 years agoVFS: Modify rmdir to take a const struct smb_filename * instead of const char *
Jeremy Allison [Wed, 24 Feb 2016 22:02:45 +0000 (14:02 -0800)]
VFS: Modify rmdir to take a const struct smb_filename * instead of const char *

Preparing to reduce use of lp_posix_pathnames().

Uses the same techniques as commit 616d068f0cebb8e50a855b6e30f36fccb7f5a3c8
(synthetic_smb_fname()) to cope with modules that
modify the incoming pathname.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Feb 25 20:46:49 CET 2016 on sn-devel-144

3 years agovfs:ceph: Fix mkdir_fn to take struct smb_filename * insted of char *
Jeremy Allison [Wed, 24 Feb 2016 22:00:27 +0000 (14:00 -0800)]
vfs:ceph: Fix mkdir_fn to take struct smb_filename * insted of char *

Missed in previous VFS change.

Signed-off-by: Jeremy Allison <jra@samba.org>
3 years agovfs:glusterfs: Fix mkdir_fn to take struct smb_filename * instead of char *
Jeremy Allison [Wed, 24 Feb 2016 21:58:16 +0000 (13:58 -0800)]
vfs:glusterfs: Fix mkdir_fn to take struct smb_filename * instead of  char *

Missed in previous VFS change.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agolib/util: Expose strv_addn() for adding string with specified length
Martin Schwenke [Thu, 25 Feb 2016 04:35:44 +0000 (15:35 +1100)]
lib/util: Expose strv_addn() for adding string with specified length

This is just a rename of previously static function _strv_append().

strv is now more useful for parsing.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Feb 25 13:43:31 CET 2016 on sn-devel-144

3 years agosamba-tool: Support preloading multiple users
Andrew Bartlett [Wed, 24 Feb 2016 03:39:38 +0000 (16:39 +1300)]
samba-tool: Support preloading multiple users

Based on patches by Adrian Cochrane

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Feb 25 07:58:55 CET 2016 on sn-devel-144

3 years agopython: Allow optional multi-value arguements for samba-tool commands
Andrew Bartlett [Wed, 24 Feb 2016 23:42:09 +0000 (12:42 +1300)]
python: Allow optional multi-value arguements for samba-tool commands

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agos3: VFS: Modify mkdir to take a const struct smb_filename * instead of const char *
Jeremy Allison [Tue, 23 Feb 2016 21:14:03 +0000 (13:14 -0800)]
s3: VFS: Modify mkdir to take a const struct smb_filename * instead of const char *

Preparing to reduce use of lp_posix_pathnames().

Uses the same techniques as commit 616d068f0cebb8e50a855b6e30f36fccb7f5a3c8
(synthetic_smb_fname()) to cope with modules that
modify the incoming pathname.

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 Feb 24 16:05:55 CET 2016 on sn-devel-144

3 years agoctdb-client: Add missing initialisation of calldata
Amitay Isaacs [Sat, 21 Nov 2015 12:36:00 +0000 (23:36 +1100)]
ctdb-client: Add missing initialisation of calldata

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): Wed Feb 24 11:57:23 CET 2016 on sn-devel-144

3 years agoctdb-client: Keep trying to migrate till record lock is obtained
Amitay Isaacs [Fri, 20 Nov 2015 05:22:41 +0000 (16:22 +1100)]
ctdb-client: Keep trying to migrate till record lock is obtained

If a record is not on a local node, then it is migrated from remote node.
However, before the client can get a lock on the record, it's possible
for the record to get migrated away.  In that case, repeat migration.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-client: Remove TALLOC_CTX argument from sync functions
Amitay Isaacs [Wed, 18 Nov 2015 04:15:16 +0000 (15:15 +1100)]
ctdb-client: Remove TALLOC_CTX argument from sync functions

There is no allocated memory returned from these functions.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-client: Add async version of set/remove message handler functions
Amitay Isaacs [Wed, 18 Nov 2015 04:11:37 +0000 (15:11 +1100)]
ctdb-client: Add async version of set/remove message handler functions

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-client: Add sync API for waiting for recovery
Amitay Isaacs [Tue, 17 Nov 2015 05:58:26 +0000 (16:58 +1100)]
ctdb-client: Add sync API for waiting for recovery

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-client: Drop TALLOC_CTX argument from ctdb_attach
Amitay Isaacs [Tue, 17 Nov 2015 05:52:54 +0000 (16:52 +1100)]
ctdb-client: Drop TALLOC_CTX argument from ctdb_attach

The database context returned is allocated off the client and is not
allocated from user-supplied TALLOC_CTX.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-client: Add new API for ctdb_client_wait_timeout()
Amitay Isaacs [Tue, 10 Nov 2015 05:59:21 +0000 (16:59 +1100)]
ctdb-client: Add new API for ctdb_client_wait_timeout()

This is similar to ctdb_client_wait() with additional timeout argument.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-client: Do not use sync functions in async computation
Amitay Isaacs [Fri, 6 Nov 2015 06:08:48 +0000 (17:08 +1100)]
ctdb-client: Do not use sync functions in async computation

This leads to nested event loops.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-client: Do not use sync functions in async computation
Amitay Isaacs [Fri, 6 Nov 2015 04:44:27 +0000 (15:44 +1100)]
ctdb-client: Do not use sync functions in async computation

This leads to nested event loops.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoidmap_script: Parallelize script calls
Volker Lendecke [Wed, 17 Feb 2016 13:01:47 +0000 (14:01 +0100)]
idmap_script: Parallelize script calls

Fixes a case I've seen where a user with 200 group memberships timed out and
can now log in.

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): Wed Feb 24 01:17:25 CET 2016 on sn-devel-144

3 years agolib: Avoid an unnecessary cast
Volker Lendecke [Mon, 22 Feb 2016 10:59:52 +0000 (11:59 +0100)]
lib: Avoid an unnecessary cast

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agolib: Remove "includes.h" from util_file.c
Volker Lendecke [Tue, 16 Feb 2016 16:09:43 +0000 (17:09 +0100)]
lib: Remove "includes.h" from util_file.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agolib: Add file_pload_send/recv
Volker Lendecke [Tue, 16 Feb 2016 16:01:04 +0000 (17:01 +0100)]
lib: Add file_pload_send/recv

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agolib: Add "mem_ctx" to file_lines_pload
Volker Lendecke [Tue, 16 Feb 2016 15:29:01 +0000 (16:29 +0100)]
lib: Add "mem_ctx" to file_lines_pload

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agolib: Remove an unimplemented prototype
Volker Lendecke [Tue, 16 Feb 2016 15:24:29 +0000 (16:24 +0100)]
lib: Remove an unimplemented prototype

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agolib: Extract sys_popen()
Volker Lendecke [Tue, 16 Feb 2016 14:58:52 +0000 (15:58 +0100)]
lib: Extract sys_popen()

This was added by Jeremy with 3cf31a194f5, do the (C) accordingly

sys_popen is a pretty isolated functionality, and I'd like to use it
soon without "includes.h", needed by "proto.h"

Except for one malloc->talloc this is supposed to be a 1:1 copy

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agolib: Remove sys_waitpid
Volker Lendecke [Tue, 16 Feb 2016 14:46:06 +0000 (15:46 +0100)]
lib: Remove sys_waitpid

We have waitpid in libreplace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agolib: Fix whitespace
Volker Lendecke [Tue, 16 Feb 2016 13:59:53 +0000 (14:59 +0100)]
lib: Fix whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agolib: Move data_blob_list_item to source4
Volker Lendecke [Sat, 20 Feb 2016 09:07:11 +0000 (10:07 +0100)]
lib: Move data_blob_list_item to source4

It's only used in dcesrv_call_state.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agosmbd: Fix line length & whitespace in write_file
Volker Lendecke [Thu, 14 Jan 2016 10:51:39 +0000 (11:51 +0100)]
smbd: Fix line length & whitespace in write_file

No code change intended. This file just looked to hard to read.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agopy_xattr: Fix a "ignoring return value" warning
Volker Lendecke [Wed, 13 Jan 2016 10:15:36 +0000 (11:15 +0100)]
py_xattr: Fix a "ignoring return value" warning

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agowinbindd: return trust parameters when listing trusts
Uri Simchoni [Tue, 9 Feb 2016 22:38:11 +0000 (00:38 +0200)]
winbindd: return trust parameters when listing trusts

When asking a child domain process to list trusts on that domain,
return (along with trust domain names and SID) the trust properties -
flags, type, and attributes.

Use those attributes to initialize domain object.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Feb 23 22:02:16 CET 2016 on sn-devel-144

3 years agowinbindd: initialize foreign domain as AD based on trust
Uri Simchoni [Tue, 9 Feb 2016 22:32:23 +0000 (00:32 +0200)]
winbindd: initialize foreign domain as AD based on trust

Based on trust parameters, initialize the active_directory
member of domain object to true.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbindd: introduce add_trusted_domain_from_tdc()
Uri Simchoni [Tue, 9 Feb 2016 22:26:45 +0000 (00:26 +0200)]
winbindd: introduce add_trusted_domain_from_tdc()

This is purely a refactoring patch -
Add a routine that adds a winbindd domain object based on
domain trust cache entry. add_trusted_domain() becomes
a wrapper for this new routine.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3/winbindd: Add missing space in debug message.
Karolin Seeger [Tue, 23 Feb 2016 09:12:10 +0000 (10:12 +0100)]
s3/winbindd: Add missing space in debug message.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Tue Feb 23 14:20:01 CET 2016 on sn-devel-144

3 years agoctdb-recovery: Limit scope of reclock latency statistics
Martin Schwenke [Mon, 1 Feb 2016 00:46:05 +0000 (11:46 +1100)]
ctdb-recovery: Limit scope of reclock latency statistics

It does not make sense to update this statistic for the timeout case,
since this could skew the statistic.  To keep it simple, just update
it for the usual case where there is lock contention, since this is
the usual case.  So the daemon statistic measures time to test the
lock and the corresponding recovery daemon statistic measures time to
take the lock.

Additionally, the recovery daemon will eventually use this code to
take the lock, and the method of updating the latency statistic will
need to be pushed further out to a configurable handler that depends
on the calling context.

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): Tue Feb 23 10:32:06 CET 2016 on sn-devel-144

3 years agoctdb-recovery: Negate the status when checking the recovery lock
Martin Schwenke [Thu, 28 Jan 2016 04:07:30 +0000 (15:07 +1100)]
ctdb-recovery: Negate the status when checking the recovery lock

Have 0 indicate that the lock was taken.  This allows non-zero values
to be used to indicate why the lock could not be taken.  EACCES means
lock contention.

For now use just EACCES to cover all failures, since
ctdb_recovery_lock() returns a bool and details of other errors will
be lost.  ctdb_recovery_lock() will undergo some big changes, so don't
try to fix this now.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-recovery: Clean up status handling from recmode child
Martin Schwenke [Thu, 28 Jan 2016 03:59:18 +0000 (14:59 +1100)]
ctdb-recovery: Clean up status handling from recmode child

This currently returns an incorrect error when the expected number of
bytes are not read.  Separate out the different cases to clarify the
logic and avoid reporting the wrong error.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-recovery: Don't bother ensuring file descriptor is -1
Martin Schwenke [Mon, 11 Jan 2016 03:50:14 +0000 (14:50 +1100)]
ctdb-recovery: Don't bother ensuring file descriptor is -1

This is already done before the destructor is assigned.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-recovery: Don't store recmode in recovery mode state
Martin Schwenke [Mon, 11 Jan 2016 02:58:54 +0000 (13:58 +1100)]
ctdb-recovery: Don't store recmode in recovery mode state

The callbacks that use this value are only ever called if recovery
mode is being set to NORMAL.  So do not check if recmode is NORMAL
either.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb: Use ctdb_wait_for_process_to_exit()
Martin Schwenke [Tue, 8 Dec 2015 03:20:59 +0000 (14:20 +1100)]
ctdb: Use ctdb_wait_for_process_to_exit()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-common: New function ctdb_wait_for_process_to_exit()
Martin Schwenke [Tue, 8 Dec 2015 03:12:46 +0000 (14:12 +1100)]
ctdb-common: New function ctdb_wait_for_process_to_exit()

This pattern is used quite a few times in the CTDB code.  Many
instances use ctdb_kill() but for signal 0 this just calls kill(2)
anyway.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-recovery: Drop redundant status send when setting recovery mode
Martin Schwenke [Tue, 8 Dec 2015 03:21:33 +0000 (14:21 +1100)]
ctdb-recovery: Drop redundant status send when setting recovery mode

The child process writes the status into the pipe before looping to
wait.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-recovery: Include lib/util/time.h instead of samba_util.h
Martin Schwenke [Tue, 16 Feb 2016 02:41:21 +0000 (13:41 +1100)]
ctdb-recovery: Include lib/util/time.h instead of samba_util.h

Less is more...

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agotorture:smb2: improve torture_comments in connect test
Michael Adam [Mon, 22 Feb 2016 23:27:11 +0000 (00:27 +0100)]
torture:smb2: improve torture_comments in connect test

Signed-off-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Feb 23 04:50:53 CET 2016 on sn-devel-144

3 years agotorture:smb2: fix memory leak in connect test.
Michael Adam [Mon, 22 Feb 2016 22:23:13 +0000 (23:23 +0100)]
torture:smb2: fix memory leak in connect test.

Signed-off-by: Michael Adam <obnox@samba.org>
3 years agotorture:smb2: rewrite connect test to use torture_asserts for create errors
Michael Adam [Mon, 22 Feb 2016 15:22:14 +0000 (16:22 +0100)]
torture:smb2: rewrite connect test to use torture_asserts for create errors

let torture_smb2_createfile propagate errors

Signed-off-by: Michael Adam <obnox@samba.org>
3 years agotorture:smb2: rewrite connect test to use torture_asserts
Michael Adam [Mon, 22 Feb 2016 13:32:44 +0000 (14:32 +0100)]
torture:smb2: rewrite connect test to use torture_asserts

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agowinbindd: move a variable into scope
Michael Adam [Mon, 22 Feb 2016 14:18:26 +0000 (15:18 +0100)]
winbindd: move a variable into scope

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3-kerberos: avoid entering a password change dialogue also when using MIT.
Günther Deschner [Mon, 15 Feb 2016 11:58:07 +0000 (12:58 +0100)]
s3-kerberos: avoid entering a password change dialogue also when using MIT.

Without this fix, for accounts with an expired password, a password change
process is initiated and - due to the prompter - this fails with a confusing
error message:

"kerberos_kinit_password Administrator@W2K12DOM.BER.REDHAT.COM failed: Password
mismatch
Failed to join domain: failed to connect to AD: Password mismatch"

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agowinbind: Remove unused WINBINDD_UID_TO_SID
Volker Lendecke [Tue, 9 Feb 2016 08:36:37 +0000 (09:36 +0100)]
winbind: Remove unused WINBINDD_UID_TO_SID

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): Mon Feb 22 23:39:13 CET 2016 on sn-devel-144

3 years agonss_aix: Hack away WINBINDD_UID_TO_SID
Volker Lendecke [Tue, 9 Feb 2016 08:42:28 +0000 (09:42 +0100)]
nss_aix: Hack away WINBINDD_UID_TO_SID

To do a proper xids2sids conversion I need a build environment.

Everyone who needs this and can build AIX please speak up!

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agowinbind: Remove unused WINBINDD_GID_TO_SID
Volker Lendecke [Tue, 9 Feb 2016 08:36:37 +0000 (09:36 +0100)]
winbind: Remove unused WINBINDD_GID_TO_SID

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>