samba.git
2 years agolib: Save a few bytes of .text
Volker Lendecke [Sun, 12 Nov 2017 13:55:40 +0000 (14:55 +0100)]
lib: Save a few bytes of .text

Looks surprising, but this does save bytes if you look at the object with
"size".

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agorpcclient: Avoid a ZERO_STRUCT, save a few bytes .text
Volker Lendecke [Sun, 12 Nov 2017 13:48:24 +0000 (14:48 +0100)]
rpcclient: Avoid a ZERO_STRUCT, save a few bytes .text

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolib: Avoid a ZERO_STRUCT, save a few bytes .text
Volker Lendecke [Sun, 12 Nov 2017 13:48:24 +0000 (14:48 +0100)]
lib: Avoid a ZERO_STRUCT, save a few bytes .text

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Avoid an "else"
Volker Lendecke [Fri, 4 Aug 2017 08:44:59 +0000 (10:44 +0200)]
smbd: Avoid an "else"

We always return in the if-branch before. The else is redundant

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoutil_tdb: Make a few functions static
Volker Lendecke [Thu, 3 Aug 2017 15:08:48 +0000 (17:08 +0200)]
util_tdb: Make a few functions static

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agopassdb: Fix a typo
Volker Lendecke [Fri, 4 Aug 2017 12:47:17 +0000 (14:47 +0200)]
passdb: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibcli: Fix a signed/unsigned hickup
Volker Lendecke [Mon, 13 Nov 2017 07:53:04 +0000 (08:53 +0100)]
libcli: Fix a signed/unsigned hickup

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agonetsamlogon_cache: Use ndr_pull_struct_blob_all
Volker Lendecke [Thu, 3 Aug 2017 15:03:26 +0000 (17:03 +0200)]
netsamlogon_cache: Use ndr_pull_struct_blob_all

Be a bit more strict for error checking

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agotevent: version 0.9.34 tevent-0.9.34
Stefan Metzmacher [Mon, 13 Nov 2017 10:05:04 +0000 (11:05 +0100)]
tevent: version 0.9.34

* Remove unused select backend
* Fix a race condition in tevent_threaded_schedule_immediate()
  (bug #13130)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Nov 13 18:02:46 CET 2017 on sn-devel-144

2 years agos3:passdb: Fix a memory leak in secrets_fetch_or_upgrade_domain_info()
Andreas Schneider [Thu, 2 Nov 2017 20:49:43 +0000 (21:49 +0100)]
s3:passdb: Fix a memory leak in secrets_fetch_or_upgrade_domain_info()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Nov 13 14:05:46 CET 2017 on sn-devel-144

2 years agovfs_fruit: Unlink memory on error
Andreas Schneider [Thu, 2 Nov 2017 20:48:21 +0000 (21:48 +0100)]
vfs_fruit: Unlink memory on error

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos4: torture: kernel oplocks. Add smb2.kernel-oplocks.kernel_oplocks8
Jeremy Allison [Thu, 9 Nov 2017 17:59:23 +0000 (09:59 -0800)]
s4: torture: kernel oplocks. Add smb2.kernel-oplocks.kernel_oplocks8

Test if the server blocks whilst waiting on a kernel lease held by
a non-smbd process.

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

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 Nov 11 20:12:26 CET 2017 on sn-devel-144

2 years agos3: smbd: kernel oplocks. Replace retry_open() with setup_kernel_oplock_poll_open().
Jeremy Allison [Thu, 9 Nov 2017 20:48:15 +0000 (12:48 -0800)]
s3: smbd: kernel oplocks. Replace retry_open() with setup_kernel_oplock_poll_open().

If a O_NONBLOCK open fails with EWOULDBLOCK, this code changes smbd to
do a retry open every second, until either the timeout or we get a successful
open. If we're opening a file that has a kernel lease set by a non-smbd
process, this is the best we can do.

Prior to this, smbd would block on the second open on such a leased file
(not using O_NONBLOCK) which freezes active clients.

Regression test to follow.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agolibsmbclient: Allow server (NetApp) to return STATUS_INVALID_PARAMETER from an echo.
Jeremy Allison [Fri, 8 Sep 2017 23:20:34 +0000 (16:20 -0700)]
libsmbclient: Allow server (NetApp) to return STATUS_INVALID_PARAMETER from an echo.

It does this if we send a session ID of zero. The server still replied.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Nov 11 08:44:37 CET 2017 on sn-devel-144

2 years agovfs: remove SMB_VFS_INIT_SEARCH_OP
Uri Simchoni [Fri, 10 Nov 2017 19:53:58 +0000 (21:53 +0200)]
vfs: remove SMB_VFS_INIT_SEARCH_OP

This VFS is no longer being called, hence removed.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_unityed_media: remove handling of init_search_op
Uri Simchoni [Fri, 10 Nov 2017 19:50:17 +0000 (21:50 +0200)]
vfs_unityed_media: remove handling of init_search_op

init_search_op is about to be removed from the VFS in
a following commit. In the meantime, removing it poses
no issue because he underlying impementation is a no-op.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_media_harmony: remove handling of init_search_op
Uri Simchoni [Fri, 10 Nov 2017 19:48:26 +0000 (21:48 +0200)]
vfs_media_harmony: remove handling of init_search_op

This VFS function is about to be removed in a following commit.
In the meantime, not handling it by vfs_media_harmony poses no
issue because the underlying implenentation is a no-op.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_time_audit: remove init_search_op implementation
Uri Simchoni [Fri, 10 Nov 2017 19:47:29 +0000 (21:47 +0200)]
vfs_time_audit: remove init_search_op implementation

This VFS call is about to be removed in a following commit.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_glusterfs: remove init_search_op handling
Uri Simchoni [Fri, 10 Nov 2017 19:39:54 +0000 (21:39 +0200)]
vfs_glusterfs: remove init_search_op handling

This VFS function is about to be removed. It can be
removed by a separate commit because both the glusterfs
and the default implementations are no-ops.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoVFS examples: remove init_search_ops
Uri Simchoni [Fri, 10 Nov 2017 19:20:47 +0000 (21:20 +0200)]
VFS examples: remove init_search_ops

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: remove dptr_init_search_op()
Uri Simchoni [Fri, 10 Nov 2017 19:38:41 +0000 (21:38 +0200)]
smbd: remove dptr_init_search_op()

This function is now not being used.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: remove calls to dptr_init_search_op() from TRANS2 search code
Uri Simchoni [Fri, 10 Nov 2017 19:35:54 +0000 (21:35 +0200)]
smbd: remove calls to dptr_init_search_op() from TRANS2 search code

dptr_init_search_op() invokes VFS operations which are no-op in all
in-tree VFS modules. Furthermore, it's not being called by the SMB2
search code, so probably it's not being used by any out-of-tree VFS
module either.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: remove calls to dptr_init_search_op()
Uri Simchoni [Fri, 10 Nov 2017 19:32:49 +0000 (21:32 +0200)]
smbd: remove calls to dptr_init_search_op()

dptr_init_search_op() invokes a VFS operation which is
a no-op in all in-tree VFS modules. Furthermore,
dptr_init_search_op() is not being called from SMB2 search
code, which hints that no out-of-tree VFS module needs it.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs: Remove aio_linux
Volker Lendecke [Fri, 10 Nov 2017 11:09:36 +0000 (12:09 +0100)]
vfs: Remove aio_linux

Triggered by https://bugzilla.samba.org/show_bug.cgi?id=13128 I think
this module should go. Once Linux aio will do what Samba needs, this
might be worth another look.

What we should instead do soon is support Linux preadv2 and the
RWF_NOWAIT flag to avoid the thread context switch whenever possible.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agotevent: Fix a race condition
Volker Lendecke [Fri, 10 Nov 2017 20:22:26 +0000 (21:22 +0100)]
tevent: Fix a race condition

We can't rely on tctx to exist after we unlocked the mutex. It took a
while, but this does lead to data corruption. If *tctx is replaced with
something where tctx->wakeup_fd points to a real, existing file
descriptor, we're screwed. And by screwed, this means file corruption
on disk.

Again. I am not tall enough for this business.

http://bholley.net/blog/2015/must-be-this-tall-to-write-multi-threaded-code.html

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

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): Sat Nov 11 03:20:09 CET 2017 on sn-devel-144

2 years agolibcli: Fix a typo
Volker Lendecke [Mon, 30 Oct 2017 12:46:04 +0000 (13:46 +0100)]
libcli: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Richard Sharpe <sharpe@samba.org>
2 years agos4: torture: kernel_oplocks. Create a regression test case for bug #13058.
Jeremy Allison [Fri, 3 Nov 2017 19:02:17 +0000 (12:02 -0700)]
s4: torture: kernel_oplocks. Create a regression test case for bug #13058.

It implements the following test case:

1. client of smbd-1 opens the file and sets the oplock.
2. client of smbd-2 tries to open the file. open() fails(EAGAIN) and open is deferred.
3. client of smbd-1 sends oplock break request to the client.
4. client of smbd-1 closes the file.
5. client of smbd-1 opens the file and sets the oplock.
6. client of smbd-2 calls defer_open_done(), sees that the file lease was not changed
and does not reschedule open.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2 years agoRevert "s3/smbd: fix deferred open with streams and kernel oplocks"
Jeremy Allison [Fri, 3 Nov 2017 21:47:01 +0000 (21:47 +0000)]
Revert "s3/smbd: fix deferred open with streams and kernel oplocks"

This reverts commit b35a296a27a0807c780f2a9e7af2f2e93feefaa8.

This was the cause of

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

1. client of smbd-1 opens the file and sets the oplock.
2. client of smbd-2 tries to open the file. open() fails(EAGAIN) and open is deferred.
3. client of smbd-1 sends oplock break request to the client.
4. client of smbd-1 closes the file.
5. client of smbd-1 opens the file and sets the oplock.
6. client of smbd-2 calls defer_open_done(), sees that the file lease was not changed
and does not reschedule open.

and is no longer needed now vfs_streams_xattr.c no longer opens
the base file internally.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2 years agovfs_glusterfs: include glusterfs/api/glfs.h without relying on -I options
Niels de Vos [Tue, 31 Oct 2017 14:52:49 +0000 (15:52 +0100)]
vfs_glusterfs: include glusterfs/api/glfs.h without relying on -I options

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

The glfs.h header file has always resided under glusterfs/api/ in the
standard include directory. The glusterfs-api.pc file adds the unneeded
-I${includedir}/glusterfs compiler option. This option will be removed
from future versions of the pkg-config file.

This change can safely be backported to older versions if there is a
need to have them build against glusterfs-3.13 or newer.

URL: https://review.gluster.org/18576
CC: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Nov  9 22:37:30 CET 2017 on sn-devel-144

2 years agosmbc_opendir should not return EEXIST with invalid login credentials
David Mulder [Thu, 2 Nov 2017 14:25:11 +0000 (08:25 -0600)]
smbc_opendir should not return EEXIST with invalid login credentials

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
Autobuild-User(master): Jim McDonough <jmcd@samba.org>
Autobuild-Date(master): Thu Nov  9 01:49:06 CET 2017 on sn-devel-144

2 years agopython: tests: Add tests for samba.posix_eadb module
Lumir Balhar [Tue, 24 Oct 2017 07:01:16 +0000 (09:01 +0200)]
python: tests: Add tests for samba.posix_eadb module

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Nov  8 21:54:59 CET 2017 on sn-devel-144

2 years agopython: Port ntvfs posix bindings to Python 3 compatible form
Lumir Balhar [Tue, 24 Oct 2017 07:00:11 +0000 (09:00 +0200)]
python: Port ntvfs posix bindings to Python 3 compatible form

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agoctdb-tests: Fix some harmless CIDs
Martin Schwenke [Tue, 7 Nov 2017 22:22:29 +0000 (09:22 +1100)]
ctdb-tests: Fix some harmless CIDs

CID 1420632: Resource leaks (RESOURCE LEAK)
CID 1420631: Security best practices violations (TOCTOU)
CID 1417432: Resource leaks (RESOURCE LEAK)
CID 1417429: Security best practices violations (TOCTOU)
CID 1417427: Resource leaks (RESOURCE LEAK)

These are all in test code and constrained to the test environment, so
can't result in privilege escape.  No backport necessary.  However, we
might as well get them off the list.

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): Wed Nov  8 11:28:40 CET 2017 on sn-devel-144

2 years agomanpages: add vfs_nfs4acl_xattr.8
Ralph Boehme [Mon, 23 Oct 2017 16:56:37 +0000 (18:56 +0200)]
manpages: add vfs_nfs4acl_xattr.8

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov  8 04:27:28 CET 2017 on sn-devel-144

2 years agoselftest: run raw.acls test with XDR NFS41 ACLs
Ralph Boehme [Thu, 19 Oct 2017 12:24:03 +0000 (14:24 +0200)]
selftest: run raw.acls test with XDR NFS41 ACLs

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoselftest: run raw.acls tests against a share with XDR NFS4 ACLs
Ralph Boehme [Thu, 7 Sep 2017 15:29:03 +0000 (17:29 +0200)]
selftest: run raw.acls tests against a share with XDR NFS4 ACLs

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_nfs4acl_xattr: add XDR backend
Ralph Boehme [Wed, 18 Oct 2017 18:48:37 +0000 (20:48 +0200)]
vfs_nfs4acl_xattr: add XDR backend

Add a NFS4 ACL backend that stores the ACL blob in an XDR encoded xattr,
by default in "security.nfs4acl_xdr".

This backend is enabled by setting "nfs4acl_xattr:encoding = xdr" in a
share definition.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_nfs4acl_xattr: implement take-ownership as in vfs_acl_common
Ralph Boehme [Mon, 23 Oct 2017 10:46:07 +0000 (12:46 +0200)]
vfs_nfs4acl_xattr: implement take-ownership as in vfs_acl_common

This allows take-ownership to work if the user has SEC_STD_WRITE_OWNER.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_nfs4acl_xattr: add POSIX mode check and reset
Ralph Boehme [Wed, 18 Oct 2017 18:45:05 +0000 (20:45 +0200)]
vfs_nfs4acl_xattr: add POSIX mode check and reset

The vfs_nfs4acl_xattr VFS module is supposed to work the same as
vfs_acl_xattr|tdb with "ignore system acls" set to true. That is,
filesystem permissions should never restrict access and the actual
access checks are done by smbd in userspace.

To better cope with POSIX mode changes via other protocols (eg NFS) or
local filesystem access, add the following tweaks:

o validate ACL blob: if POSIX mode is not 0777/0666 discard the ACL blob
  from the xattr and synthesize a default ACL based on the POSIX mode

o when setting an ACL, check and reset POSIX mode to 0777/0666

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_nfs4acl_xattr: do xattr ops as root
Ralph Boehme [Mon, 23 Oct 2017 12:15:12 +0000 (14:15 +0200)]
vfs_nfs4acl_xattr: do xattr ops as root

This ensures we can always fetch the ACL xattr blob when we wanted,
unrestricted of filesystem permissions or Linux xattr security namespace
restrictions.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoselftest: test vfs_nfs4acl_xattr with NFS 4.1 ACLs
Ralph Boehme [Mon, 23 Oct 2017 12:05:19 +0000 (14:05 +0200)]
selftest: test vfs_nfs4acl_xattr with NFS 4.1 ACLs

Only tests with "nfs4:mode = simple" as mode special is supposed to be
broken anyway and simple is recommended.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agonfs4acls: update default NFS4 ACL version to 4.1
Ralph Boehme [Thu, 2 Nov 2017 11:45:48 +0000 (12:45 +0100)]
nfs4acls: update default NFS4 ACL version to 4.1

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoselftest: add explicit default NFS4 acl version
Ralph Boehme [Mon, 23 Oct 2017 11:35:49 +0000 (13:35 +0200)]
selftest: add explicit default NFS4 acl version

This is the current default, just make it explicit. A subsequent commit
will bump the default to 4.1.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_nfs4acl_xattr: add support for NFS 4.1 ACL flags in the NDR backend
Ralph Boehme [Thu, 19 Oct 2017 13:40:52 +0000 (15:40 +0200)]
vfs_nfs4acl_xattr: add support for NFS 4.1 ACL flags in the NDR backend

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibrpc/idl: add NFS 4.1 ACL flags
Ralph Boehme [Thu, 19 Oct 2017 20:44:38 +0000 (22:44 +0200)]
librpc/idl: add NFS 4.1 ACL flags

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_nfs4acl_xattr: move the meat of the implementation to a seperate file
Ralph Boehme [Tue, 17 Oct 2017 10:02:53 +0000 (12:02 +0200)]
vfs_nfs4acl_xattr: move the meat of the implementation to a seperate file

This is in preperation of modularizing the storage backend. Currently we
store the NFS4 ACL as an IDL/NDR encoded blob in a xattr.

Later commits will add a different backend storing the NFS4 ACL as an
XDR encoded blob in a xattr.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_nfs4acl_xattr: fsp->fh->fd can legally be -1
Ralph Boehme [Mon, 23 Oct 2017 14:38:51 +0000 (16:38 +0200)]
vfs_nfs4acl_xattr: fsp->fh->fd can legally be -1

We only open the underlying file if the open access mode contains

FILE_READ_DATA|FILE_WRITE_DATA|FILE_APPEND_DATA|FILE_EXECUTE

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_nfs4acl_xattr: refactoring
Ralph Boehme [Mon, 23 Oct 2017 14:35:52 +0000 (16:35 +0200)]
vfs_nfs4acl_xattr: refactoring

Refactor the code in preperation of factoring out ACL blob to smb4acl
and vice versa mapping functions.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_nfs4acl_xattr: code polish
Ralph Boehme [Thu, 19 Oct 2017 19:53:40 +0000 (21:53 +0200)]
vfs_nfs4acl_xattr: code polish

README.Coding adjustments, DEBUG macro modernisation, variable name
sanitizing. No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_nfs4acl_xattr: modernize ACL inheritance
Ralph Boehme [Mon, 16 Oct 2017 16:05:51 +0000 (18:05 +0200)]
vfs_nfs4acl_xattr: modernize ACL inheritance

This changes the way ACL inheritance is achieved in this
module.

Previously the module recursed to the next parent directory until the
share root was reached or a directory with an ACL xattr. If the share
root didn't contain an ACL xattr either a default ACL would be used.

This commit removed this recursive scanning and replaces it with the
same mechanism used by vfs_acl_xattr: by setting "inherit acls = yes"
just let smbd do the heavy lefting and inheritance.

For any file without ACL xattr we still synthesize a default ACL,
leveraging the existing default ACL function used by vfs_acl_xattr.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_nfs4acl_xattr: add a runtime configuration object
Ralph Boehme [Thu, 19 Oct 2017 14:34:44 +0000 (16:34 +0200)]
vfs_nfs4acl_xattr: add a runtime configuration object

No change in behaviour, all option defaults are set to the original
behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibrpc/idl: add versions consts to nfs4acl.idl
Ralph Boehme [Thu, 19 Oct 2017 12:22:00 +0000 (14:22 +0200)]
librpc/idl: add versions consts to nfs4acl.idl

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibrpc/idl: rename NFS4 ACL xattr name
Ralph Boehme [Thu, 2 Nov 2017 11:17:48 +0000 (12:17 +0100)]
librpc/idl: rename NFS4 ACL xattr name

The "system" xattr namespace is reserved for the kernel. Any attempt to
use xattrs in that namesspace will fail with EOPNOTSUPP, regardless of
priveleges. In autobuild we're using the xattr_tdb VFS module, so it
works there.

Using the "security" namespace instead makes this module generally
usable with Linux filesystem xattrs as storage backend.

Additionally prefix the xattr name with "_ndr". This is in preperation
of later commits that add a ACL blob marshalling format based on XDR. To
avoid xattr name collision, both format will use distinct xattr names by
default.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibrpc/idl: rename NFS4 ACL xattr name define
Ralph Boehme [Thu, 19 Oct 2017 10:29:47 +0000 (12:29 +0200)]
librpc/idl: rename NFS4 ACL xattr name define

No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_nfs4acl_xattr: move interesting functions pointers to the top
Ralph Boehme [Thu, 19 Oct 2017 13:50:07 +0000 (15:50 +0200)]
vfs_nfs4acl_xattr: move interesting functions pointers to the top

Move interesting functions to the top of the vfs_fn_pointers struct, no
change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_nfs4acl_xattr: remove a layer of indirection
Ralph Boehme [Mon, 16 Oct 2017 15:04:01 +0000 (17:04 +0200)]
vfs_nfs4acl_xattr: remove a layer of indirection

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3/posix_acls: add default ACL style "everyone"
Ralph Boehme [Tue, 17 Oct 2017 13:18:52 +0000 (15:18 +0200)]
s3/posix_acls: add default ACL style "everyone"

This synthesizes an ACL with a single ACE with full permissions for
everyone. Not used for now, this comes later.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3/smbd: make make_default_filesystem_acl public
Ralph Boehme [Thu, 28 Sep 2017 05:53:48 +0000 (07:53 +0200)]
s3/smbd: make make_default_filesystem_acl public

This will be used by another VFS module in a subsequent commit.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_acl_common: directly pass default_acl_style
Ralph Boehme [Thu, 28 Sep 2017 05:48:59 +0000 (07:48 +0200)]
vfs_acl_common: directly pass default_acl_style

This is in preperation of moving make_default_filesystem_acl() and
making it globally accessible. No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoselftest: split out failing owner related subtest from samba3.raw.acls.create_file|dir
Ralph Boehme [Thu, 7 Sep 2017 15:26:58 +0000 (17:26 +0200)]
selftest: split out failing owner related subtest from samba3.raw.acls.create_file|dir

All the other subtests in samba3.raw.acls.create_file|dir pass with
nfs4acl_xattr, it's just the subtest that tries to set the owner which
fails with everything else then acl_xattr.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoctdb-tests: Add sock_daemon test for stale socket handling
Martin Schwenke [Fri, 3 Nov 2017 05:24:46 +0000 (16:24 +1100)]
ctdb-tests: Add sock_daemon test for stale socket handling

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 Nov  7 07:51:02 CET 2017 on sn-devel-144

2 years agoctdb-common: Fix stale socket removal
Amitay Isaacs [Fri, 3 Nov 2017 05:00:04 +0000 (16:00 +1100)]
ctdb-common: Fix stale socket removal

Sockets need to be created from sock_daemon_run_send().  This means
that stale socket removal can depend on the PID file context being
initialised.

Also fix associated test.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-scripts: Don't bother checking PID file when starting ctdbd
Martin Schwenke [Mon, 23 Oct 2017 00:50:51 +0000 (11:50 +1100)]
ctdb-scripts: Don't bother checking PID file when starting ctdbd

This is an optimisation that can cause incorrect results.  If ctdbd
was killed and there is a stale PID file then this will often cause
"CTDB exited during initialisation".  The wrapper reads the old PID
from the PID file, finds the PID gone, complains and exits.

It is better to drop this code and finally get this right.  If ctdbd
does exit early then it will take CTDB_STARTUP_TIMEOUT (default 10)
seconds before the wrapper fails.  That's not too bad...

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: Have fake daemon log when it parses public IPs
Martin Schwenke [Fri, 13 Oct 2017 01:49:05 +0000 (12:49 +1100)]
ctdb-tests: Have fake daemon log when it parses public IPs

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-common: Ensure unused bytes in union are initialised
Martin Schwenke [Wed, 18 Oct 2017 09:08:19 +0000 (20:08 +1100)]
ctdb-common: Ensure unused bytes in union are initialised

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agos4: torture: Add smb2 FIND_and_set_DOC test case.
Ralph Wuerthner [Fri, 27 Oct 2017 12:59:32 +0000 (14:59 +0200)]
s4: torture: Add smb2 FIND_and_set_DOC test case.

Regression tests doing an SMB2_find followed by
a set delete on close and then close on a directory.

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

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sun Nov  5 12:31:12 CET 2017 on sn-devel-144

2 years agos3: smbd: Fix delete-on-close after smb2_find
Ralph Wuerthner [Fri, 3 Nov 2017 22:33:28 +0000 (22:33 +0000)]
s3: smbd: Fix delete-on-close after smb2_find

Both dptr_create() and can_delete_directory_fsp() are calling OpenDir_fsp()
to get a directory handle. This causes an issue when delete-on-close is
set after smb2_find because both directory handle instances share the same
underlying file descriptor. In addition the SMB_ASSERT() in destructor
smb_Dir_destructor() gets triggered.

To avoid this use OpenDir() instead of OpenDir_fsp().

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

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 years agovfs_fruit: avoid dereferencing a freed object in an error case
Ralph Boehme [Fri, 3 Nov 2017 13:56:43 +0000 (14:56 +0100)]
vfs_fruit: avoid dereferencing a freed object in an error case

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Nov  3 19:05:05 CET 2017 on sn-devel-144

2 years agos4-smbtorture: Show that the KDC provides no protection from CVE-2017-11103
Andrew Bartlett [Wed, 12 Jul 2017 12:38:29 +0000 (00:38 +1200)]
s4-smbtorture: Show that the KDC provides no protection from CVE-2017-11103

The server name in the AS-REQ is unprotected, sadly.

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

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 Nov  2 07:16:50 CET 2017 on sn-devel-144

2 years agos4-smbtorture: Add test krb5.kdc to prove fix for CVE-2017-11103
Andrew Bartlett [Wed, 12 Jul 2017 05:48:46 +0000 (17:48 +1200)]
s4-smbtorture: Add test krb5.kdc to prove fix for CVE-2017-11103

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 years agovfs_zfsacl: fix compilation error
Ralph Boehme [Sat, 28 Oct 2017 14:13:16 +0000 (16:13 +0200)]
vfs_zfsacl: fix compilation error

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Nov  2 03:16:11 CET 2017 on sn-devel-144

2 years agogitlab-ci: add .gitlab-ci.yml
Joe Guo [Tue, 19 Sep 2017 21:33:27 +0000 (09:33 +1200)]
gitlab-ci: add .gitlab-ci.yml

Add .gitlab-ci.yml file, and define build jobs in groups.

Once gitlab-runner set up, builds and tests can be triggered
automatically in parallel when push to gitlab.
Also, with gitlab-runner autoscale mode, build instances
will be created and removed on demand.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Oct 31 15:32:16 CET 2017 on sn-devel-144

2 years agos4-torture: remove obsolete comment in libsmbclient torture suite.
Günther Deschner [Sat, 28 Oct 2017 09:10:07 +0000 (11:10 +0200)]
s4-torture: remove obsolete comment in libsmbclient torture suite.

Since smbc_setX calls now handle string allocation using malloc
themselves (since commit 2d41b1ab78639abe4ae030ff482573f464564dd7) we
indeed no longer need to provide malloced strings (the extra malloc
already got removed earlier).

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Oct 30 21:09:14 CET 2017 on sn-devel-144

2 years agorepl_meta_data: Initialise parent_dn to NULL
Andrew Bartlett [Mon, 16 Oct 2017 23:00:27 +0000 (12:00 +1300)]
repl_meta_data: Initialise parent_dn to NULL

Signed-off-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): Mon Oct 30 04:16:42 CET 2017 on sn-devel-144

2 years agorepl_meta_data: Explain that we do not truncate the DN at present
Andrew Bartlett [Mon, 16 Oct 2017 22:36:03 +0000 (11:36 +1300)]
repl_meta_data: Explain that we do not truncate the DN at present

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 years agorepl_meta_data: Use replmd_make_prefix_child_dn() in replmd_conflict_dn()
Andrew Bartlett [Mon, 16 Oct 2017 22:28:45 +0000 (11:28 +1300)]
repl_meta_data: Use replmd_make_prefix_child_dn() in replmd_conflict_dn()

Now both routines avoid the escape/unescape implicit in ldb_dn_add_child_fmt()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 years agorepl_meta_data: Split replmd_make_deleted_child_dn() into a helper function
Andrew Bartlett [Mon, 16 Oct 2017 22:27:49 +0000 (11:27 +1300)]
repl_meta_data: Split replmd_make_deleted_child_dn() into a helper function

This will allow it to be used in common with replmd_conflict_dn()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 years agorepl_meta_data: Move creation of deleted DN into helper: replmd_make_deleted_child_dn()
Andrew Bartlett [Mon, 16 Oct 2017 04:27:59 +0000 (17:27 +1300)]
repl_meta_data: Move creation of deleted DN into helper: replmd_make_deleted_child_dn()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 years agorepl_meta_data: Avoid printf() and use binary direct RDN creation for deleted objects
Andrew Bartlett [Mon, 16 Oct 2017 03:02:57 +0000 (16:02 +1300)]
repl_meta_data: Avoid printf() and use binary direct RDN creation for deleted objects

This makes it clearer that we are just replacing the RDN and ensures we do not
somehow create multiple components inside ldb_dn_add_child_fmt().

We also avoid an escape/un-escape round-trip.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 years agos3-auth: remove leftover prototype from auth_domain.
Günther Deschner [Sat, 28 Oct 2017 09:50:35 +0000 (11:50 +0200)]
s3-auth: remove leftover prototype from auth_domain.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Oct 30 00:15:07 CET 2017 on sn-devel-144

2 years agowinbindd: Remove a misleading comment
Volker Lendecke [Fri, 27 Oct 2017 12:01:41 +0000 (14:01 +0200)]
winbindd: Remove a misleading comment

The reality is a bit more complex than this comment indicates. We should never
suggest anywhere that we can connect to domains that we don't have a direct
trust account to. For the member case, it's "our" domain, and for the DC case,
it's the direct trusts. Everything else is pure luck.

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): Sat Oct 28 00:31:58 CEST 2017 on sn-devel-144

2 years agoprinting: Avoid an "extern current_user"
Volker Lendecke [Wed, 4 Oct 2017 11:30:13 +0000 (13:30 +0200)]
printing: Avoid an "extern current_user"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoprinting: Avoid an "extern current_user"
Volker Lendecke [Wed, 4 Oct 2017 11:27:43 +0000 (13:27 +0200)]
printing: Avoid an "extern current_user"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Fix the memory hierarchy in the unix token
Volker Lendecke [Wed, 4 Oct 2017 13:04:01 +0000 (15:04 +0200)]
smbd: Fix the memory hierarchy in the unix token

"groups" should hang off the token itself, not its parent

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolib: Use all_zero where appropriate
Volker Lendecke [Thu, 19 Oct 2017 15:52:31 +0000 (17:52 +0200)]
lib: Use all_zero where appropriate

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Remove an indentation level in smb2_negprot
Volker Lendecke [Thu, 19 Oct 2017 06:13:59 +0000 (08:13 +0200)]
smbd: Remove an indentation level in smb2_negprot

Do an early return. Best viewed with "git show -b"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosamba: Fix CID 1420179 Code maintainability issues UNUSED_VALUE
Volker Lendecke [Thu, 26 Oct 2017 19:13:52 +0000 (21:13 +0200)]
samba: Fix CID 1420179 Code maintainability issues UNUSED_VALUE

I don't think pid is used at all here.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosamba: Fix CID 1420180 Null pointer dereferences
Volker Lendecke [Thu, 26 Oct 2017 19:08:14 +0000 (21:08 +0200)]
samba: Fix CID 1420180 Null pointer dereferences

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos4:pyparam: Fix resource leaks on error
Andreas Schneider [Wed, 25 Oct 2017 17:25:20 +0000 (19:25 +0200)]
s4:pyparam: Fix resource leaks on error

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos4:torture: Avoid useless strdup in libsmbclient test
Andreas Schneider [Wed, 25 Oct 2017 17:23:02 +0000 (19:23 +0200)]
s4:torture: Avoid useless strdup in libsmbclient test

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibsmbclient: Use const for the user
Andreas Schneider [Wed, 25 Oct 2017 17:22:34 +0000 (19:22 +0200)]
libsmbclient: Use const for the user

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agotestprogs: Update the kpasswd setpassword test
Andreas Schneider [Fri, 20 Oct 2017 06:58:21 +0000 (08:58 +0200)]
testprogs: Update the kpasswd setpassword test

This has been fixed with b81ca4f9dcbb378a95fb3ac31bfd9a1cbe505d7d

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Oct 27 15:22:43 CEST 2017 on sn-devel-144

2 years agos4:kdc: Pass down the task to get access to model_ops for kpasswd server
Andreas Schneider [Thu, 19 Oct 2017 15:32:15 +0000 (17:32 +0200)]
s4:kdc: Pass down the task to get access to model_ops for kpasswd server

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos3:modules: Check correct variable for NULL in posixacl_xattr
Andreas Schneider [Wed, 25 Oct 2017 17:55:32 +0000 (19:55 +0200)]
s3:modules: Check correct variable for NULL in posixacl_xattr

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Oct 27 04:54:22 CEST 2017 on sn-devel-144

2 years agos3:passdb: Make sure the salt is fully initialized before passing
Andreas Schneider [Wed, 25 Oct 2017 17:50:57 +0000 (19:50 +0200)]
s3:passdb: Make sure the salt is fully initialized before passing

Otherwise the magic member is not initialized.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:secrets: Do not leak memory of pw and old_pw
Andreas Schneider [Wed, 25 Oct 2017 17:30:28 +0000 (19:30 +0200)]
s3:secrets: Do not leak memory of pw and old_pw

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:vfs_glusterfs: Use SAFE_FREE
Andreas Schneider [Thu, 26 Oct 2017 06:05:20 +0000 (08:05 +0200)]
s3:vfs_glusterfs: Use SAFE_FREE

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Oct 26 17:31:40 CEST 2017 on sn-devel-144

2 years agoctdb-tests: Process-exists unit tests should wait until PID is registered
Martin Schwenke [Wed, 25 Oct 2017 01:15:23 +0000 (12:15 +1100)]
ctdb-tests: Process-exists unit tests should wait until PID is registered

Otherwise the client registration can race with the check in the test.

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

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): Thu Oct 26 13:32:24 CEST 2017 on sn-devel-144

2 years agoctdb-tests: Wait for fake_ctdbd to start, fail if it doesn't
Martin Schwenke [Wed, 25 Oct 2017 06:52:04 +0000 (17:52 +1100)]
ctdb-tests: Wait for fake_ctdbd to start, fail if it doesn't

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: Skip starting fake_ctdbd when current node is disconnected
Martin Schwenke [Wed, 25 Oct 2017 10:43:56 +0000 (21:43 +1100)]
ctdb-tests: Skip starting fake_ctdbd when current node is disconnected

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>