nivanova/samba-autobuild/.git
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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

3 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>
3 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>
3 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>
3 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

3 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

3 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

3 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>
3 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

3 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

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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

3 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>
3 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>
3 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>
3 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>
3 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

3 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>
3 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

3 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

3 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>
3 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

3 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

3 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

3 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

3 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>
3 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>
3 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>
3 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>
3 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>
3 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

3 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

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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

3 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>
3 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

3 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>
3 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>
3 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

3 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

3 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>
3 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>
3 years agoctdb-tests: Wait for ctdb_eventd to start, fail if it doesn't
Martin Schwenke [Wed, 25 Oct 2017 07:52:10 +0000 (18:52 +1100)]
ctdb-tests: Wait for ctdb_eventd 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>
3 years agoctdb-tests: Allow wait_until() to be used in unit tests
Martin Schwenke [Wed, 25 Oct 2017 01:04:49 +0000 (12:04 +1100)]
ctdb-tests: Allow wait_until() to be used in unit tests

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>
3 years agos3:vfs_glusterfs: Fix a double free in vfs_gluster_getwd()
Andreas Schneider [Wed, 25 Oct 2017 17:39:34 +0000 (19:39 +0200)]
s3:vfs_glusterfs: Fix a double free in vfs_gluster_getwd()

Found by cppcheck.

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

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): Thu Oct 26 09:34:40 CEST 2017 on sn-devel-144

3 years agolinked attribute tests: correct add_all_at_once test
Douglas Bagnall [Tue, 24 Oct 2017 23:57:09 +0000 (12:57 +1300)]
linked attribute tests: correct add_all_at_once test

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Oct 26 05:36:11 CEST 2017 on sn-devel-144

3 years agolinked_attribute tests: helper assert function for expected LdbError
Douglas Bagnall [Tue, 24 Oct 2017 22:57:50 +0000 (11:57 +1300)]
linked_attribute tests: helper assert function for expected LdbError

The logic involved in asserting that a function raises an LdbError with
a particular error value has shown itself to be too complicated for me
to repeat too often.

To test this function, you would want a put a test in a bit like this:

    def test_assertRaisesLdbError(self):
        for i in [1, 2, ldb.ERR_ENTRY_ALREADY_EXISTS, 999]:
            def f(*args, **kwargs):
                raise ldb.LdbError(i, 'msg %s' % i)
            self.assertRaisesLdbError(i, 'a message', f, 'la la', la='la')

            def f2(*args, **kwargs):
                raise ldb.LdbError(i + 1, 'msg %s' % i)
            def f3(*args, **kwargs):
                pass
            for f in (f2, f3):
                try:
                    self.assertRaisesLdbError(i, 'a message', f, 'la la', la='la')
                except AssertionError as e:
                    print i, e, f
                    pass
                else:
                    print i, f
                    self.fail('assertRaisesLdbError() failed to fail!')

..but a self-testing test-tester is getting a too meta to run in every
autobuild.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoreplmd: use check_parsed_dn_duplicates() more widely
Douglas Bagnall [Tue, 24 Oct 2017 23:31:08 +0000 (12:31 +1300)]
replmd: use check_parsed_dn_duplicates() more widely

replmd_add_fix_la() was already making the same check; here we move it
a bit earlier.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agolinked attribute tests: fix logic for add test
Douglas Bagnall [Tue, 24 Oct 2017 23:17:05 +0000 (12:17 +1300)]
linked attribute tests: fix logic for add test

We were ensuring that when we got an LdbError it was the right type,
but we weren't ensuring we got one at all.

The new test doesn't fail.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agolinked attribute tests: ensure duplicate deletes fail
Douglas Bagnall [Tue, 24 Oct 2017 23:13:57 +0000 (12:13 +1300)]
linked attribute tests: ensure duplicate deletes fail

We can't remove the same thing twice in the same message.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoreplmd: check for duplicate values in MOD_REPLACE case
Douglas Bagnall [Tue, 24 Oct 2017 21:12:09 +0000 (10:12 +1300)]
replmd: check for duplicate values in MOD_REPLACE case

Because we already have a sorted parsed_dn list, this is a simple
linear scan.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agolinked attribute tests: test against duplicates in replace
Douglas Bagnall [Tue, 24 Oct 2017 21:54:42 +0000 (10:54 +1300)]
linked attribute tests: test against duplicates in replace

We should not be able to introduce duplicate links using MOD_REPLACE.
It turns out we could and weren't testing.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos4:scripting: Fix ntstatus_gen.h generation on 32bit
Andreas Schneider [Wed, 25 Oct 2017 15:37:24 +0000 (17:37 +0200)]
s4:scripting: Fix ntstatus_gen.h generation on 32bit

The hex() function results in different output on 32bit systems. It adds
a L for long for some numbers. Thus we have a different header file.

This patch makes sure we have a consistent file generation on different
paltforms.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Wed Oct 25 22:28:39 CEST 2017 on sn-devel-144

3 years agos3: smbclient: Test we can rename with a name containing.
Jeremy Allison [Mon, 23 Oct 2017 22:40:04 +0000 (15:40 -0700)]
s3: smbclient: Test we can rename with a name containing.

Samba always allowed this anyway, but it's a good place
to ensure we don't regress.

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

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): Tue Oct 24 23:32:58 CEST 2017 on sn-devel-144

3 years agos3: smbclient: Ensure we call client_clean_name() before all operations on remote...
Jeremy Allison [Fri, 20 Oct 2017 22:09:38 +0000 (15:09 -0700)]
s3: smbclient: Ensure we call client_clean_name() before all operations on remote pathnames.

This allows names containing .. components to be resolved on the client side
before being sent to the server. Relative names work in SMB1 but not in SMB2.
Fix both client.c and clitar.c

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3: client: Add new utility function client_clean_name().
Jeremy Allison [Sat, 21 Oct 2017 00:08:08 +0000 (00:08 +0000)]
s3: client: Add new utility function client_clean_name().

Correctly canonicalizes a remote pathname removing '..'
elements before sending to a remote server. '..' elements
work in SMB1 pathnames, but not in SMB2.

Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agoctdb-client: Fix CID 1419820
Amitay Isaacs [Wed, 18 Oct 2017 05:16:27 +0000 (16:16 +1100)]
ctdb-client: Fix CID 1419820

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Oct 23 19:45:08 CEST 2017 on sn-devel-144

3 years agoctdb-tools: Drop duplicate output from dbstatistics
Amitay Isaacs [Fri, 13 Oct 2017 01:57:08 +0000 (12:57 +1100)]
ctdb-tools: Drop duplicate output from dbstatistics

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agopython: Port tests of samba.messaging to Python 3 compatible form.
Lumir Balhar [Thu, 14 Sep 2017 07:31:17 +0000 (09:31 +0200)]
python: Port tests of samba.messaging 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>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Oct 23 15:40:48 CEST 2017 on sn-devel-144

3 years agopython: Port samba.messaging module to Python 3 compatible form.
Lumir Balhar [Thu, 14 Sep 2017 07:30:28 +0000 (09:30 +0200)]
python: Port samba.messaging module 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>