gd/samba-autobuild/.git
6 years agoreplace: Link to -lbsd when building replace.c by hand
Andrew Bartlett [Sat, 14 Oct 2017 09:38:18 +0000 (22:38 +1300)]
replace: Link to -lbsd when building replace.c by hand

This ensures that we correctly detect HAVE_IFACE_GETIFADDRS
et al, which are based on a "build the source" style test.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agos3:cli_netlogon: let rpccli_connect_netlogon() retry once after NT_STATUS_NETWORK_ACC...
Stefan Metzmacher [Wed, 18 Oct 2017 11:36:59 +0000 (13:36 +0200)]
s3:cli_netlogon: let rpccli_connect_netlogon() retry once after NT_STATUS_NETWORK_ACCESS_DENIED

Otherwise we could easily endup with an endless loop.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:cli_netlogon: make sure rpccli_connect_netlogon only returns NT_STATUS_OK on success
Stefan Metzmacher [Wed, 18 Oct 2017 11:36:59 +0000 (13:36 +0200)]
s3:cli_netlogon: make sure rpccli_connect_netlogon only returns NT_STATUS_OK on success

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:tests: Fix the smblcient utimes test in Europe
Andreas Schneider [Thu, 19 Oct 2017 16:03:27 +0000 (18:03 +0200)]
s3:tests: Fix the smblcient utimes test in Europe

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 20 03:37:31 CEST 2017 on sn-devel-144

6 years agos4:smbd: Add missing unistd.h include to fix build of process_prefork
Andreas Schneider [Thu, 19 Oct 2017 15:27:23 +0000 (17:27 +0200)]
s4:smbd: Add missing unistd.h include to fix build of process_prefork

error: implicit declaration of function ‘getpgrp’; did you mean ‘getpt’?
[-Werror=implicit-function-declaration]

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agonwrap: Fix strotoul checks for NSS_WRAPPER_MAX_HOSTENTS
Douglas Bagnall [Thu, 19 Oct 2017 08:56:15 +0000 (10:56 +0200)]
nwrap: Fix strotoul checks for NSS_WRAPPER_MAX_HOSTENTS

The env and endptr pointers need to be dereferenced, but that is not
enough: we don't really want to regard an empty string (*env == '\0')
as a valid number.

Found by GCC 8.0.0 20170705 (experimental).

[2095/4103] Compiling lib/nss_wrapper/nss_wrapper.c
../lib/nss_wrapper/nss_wrapper.c: In function "nwrap_init":
../lib/nss_wrapper/nss_wrapper.c:1571:13: warning: comparison between pointer and zero character constant [-Wpointer-compare]
   if (((env != '\0') && (endptr == '\0')) ||
                ^~
                ../lib/nss_wrapper/nss_wrapper.c:1571:9: note: did you mean to dereference the pointer?
   if (((env != '\0') && (endptr == '\0')) ||
            ^
            ../lib/nss_wrapper/nss_wrapper.c:1571:33: warning: comparison between pointer and zero character constant [-Wpointer-compare]
   if (((env != '\0') && (endptr == '\0')) ||
                                    ^~
                                    ../lib/nss_wrapper/nss_wrapper.c:1571:26: note: did you mean to dereference the pointer?
   if (((env != '\0') && (endptr == '\0')) ||

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-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): Thu Oct 19 16:42:17 CEST 2017 on sn-devel-144

6 years agopython: use communicate to fix Popen deadlock
Joe Guo [Fri, 15 Sep 2017 04:13:26 +0000 (16:13 +1200)]
python: use communicate to fix Popen deadlock

`Popen.wait()` will deadlock when using stdout=PIPE and/or stderr=PIPE and the
child process generates large output to a pipe such that it blocks waiting for
the OS pipe buffer to accept more data. Use communicate() to avoid that.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-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 19 09:27:16 CEST 2017 on sn-devel-144

6 years agopython: add a failed test to show Popen deadlock
Joe Guo [Fri, 15 Sep 2017 03:31:34 +0000 (15:31 +1200)]
python: add a failed test to show Popen deadlock

`Popen.wait()` will deadlock when using stdout=PIPE and/or stderr=PIPE and the
child process generates large output to a pipe such that it blocks waiting for
the OS pipe buffer to accept more data. Use communicate() to avoid that.

This patch is commited to show the issue, a fix patch will come later.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agosource4/smbd: replace DEBUG( with DBG_
Gary Lockyer [Sun, 10 Sep 2017 23:39:39 +0000 (11:39 +1200)]
source4/smbd: replace DEBUG( with DBG_

Update the debug logging to use the currently preferred debug macros

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agoselftest: set ad_dc process model to prefork
Gary Lockyer [Tue, 5 Sep 2017 00:31:52 +0000 (12:31 +1200)]
selftest: set ad_dc process model to prefork

Set the process model for ad_dc to prefork, so that the pre-fork gets
exercised during self test.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agosource4/smbd: add a prefork process model.
Gary Lockyer [Thu, 7 Sep 2017 02:30:15 +0000 (14:30 +1200)]
source4/smbd: add a prefork process model.

Add a pre fork process model to bound the number processes forked by
samba.  Currently workers are only pre-forked for the ldap server,  all
the other services have pre-fork support disabled.

When pre-fork support is disabled a new process is started for each
service, and requests are processed by that process.

This commit partially reverts commit
b5be45c453bd51373bade26c29828b500ba586ec.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agosource4/smbd: Fix code formatting after refactoring.
Gary Lockyer [Thu, 14 Sep 2017 21:15:35 +0000 (09:15 +1200)]
source4/smbd: Fix code formatting after refactoring.

Fix code formatting from the refactoring in the previous commits.
Done as a separate patch to make the changes to functionality easier
to review.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agoprocess_standard: Do not log at level 2 every time a child exits
Gary Lockyer [Mon, 18 Sep 2017 01:02:13 +0000 (13:02 +1200)]
process_standard: Do not log at level 2 every time a child exits

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agosource4/smbd: Do not overstamp the process model with "single"
Gary Lockyer [Mon, 18 Sep 2017 01:05:24 +0000 (13:05 +1200)]
source4/smbd: Do not overstamp the process model with "single"

Instead, except in RPC which is a special SNOWFLAKE, we rely on the struct
service_details in the init function.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agoprocess_standard: Honour proc_ctx->inhibit_fork_on_accept
Gary Lockyer [Thu, 19 Oct 2017 02:15:33 +0000 (15:15 +1300)]
process_standard: Honour proc_ctx->inhibit_fork_on_accept

This allows the service to control if it should fork per accept() without needing
to replace the whole process model with process_single.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agoprocess_standard: Move child pipe setup further down standard_accept_connection()
Gary Lockyer [Thu, 19 Oct 2017 02:14:16 +0000 (15:14 +1300)]
process_standard: Move child pipe setup further down standard_accept_connection()

This avoids cleaning up on error from accept() but more importantly
allows a future mode that acts like process_single and so has no child.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agoprocess_standard: Use the new process_context
Gary Lockyer [Mon, 18 Sep 2017 00:56:09 +0000 (12:56 +1200)]
process_standard: Use the new process_context

Use the new process_context to control the from_parent_fd
This avoids the use of global variables, and will in the next patch
allow process_standard to run as what was known as single without
over-stamping a different process model.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years ago source4/smbd: refactor the process model for prefork
Gary Lockyer [Thu, 14 Sep 2017 19:09:23 +0000 (07:09 +1200)]
 source4/smbd: refactor the process model for prefork

    Refactor the process model code to allow the addition of a prefork
    process model.

    - Add a process context to contain process model specific state
    - Add a service details structure to allow service to indicate which
      process model options they can support.

    In the new code the services advertise the features they support to the
    process model.  The process model context is plumbed through to allow the
    process model to keep track of the supported options, and any state
    the process model may require.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agotests: Add a blackbox test for smbcontrol
Gary Lockyer [Tue, 12 Sep 2017 23:21:02 +0000 (11:21 +1200)]
tests: Add a blackbox test for smbcontrol

Add tests to check that samba processes have started and that they can be
pinged.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agorpc_client: Fix wording in a DEBUG statement
Volker Lendecke [Wed, 18 Oct 2017 11:26:07 +0000 (13:26 +0200)]
rpc_client: Fix wording in a DEBUG statement

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): Thu Oct 19 04:57:44 CEST 2017 on sn-devel-144

6 years agoRemoved unused 'oplock contention limit' config parameter
Christof Schmitt [Tue, 17 Oct 2017 21:49:17 +0000 (14:49 -0700)]
Removed unused 'oplock contention limit' config parameter

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos3: tests: Add smbclient test for utimes command.
Jeremy Allison [Wed, 18 Oct 2017 20:54:22 +0000 (13:54 -0700)]
s3: tests: Add smbclient test for utimes command.

Signed-off-by: Jeremy Allison <jra@samba.org>
6 years agos3:Add a utimes command to smbclient so we can set the Windows times.
Richard Sharpe [Mon, 16 Oct 2017 20:51:51 +0000 (13:51 -0700)]
s3:Add a utimes command to smbclient so we can set the Windows times.

Add an update to the smbclient man page.

Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agodbcheck: Allow removal of one-way links to missing objects
Andrew Bartlett [Tue, 17 Oct 2017 10:01:51 +0000 (23:01 +1300)]
dbcheck: Allow removal of one-way links to missing objects

If dbcheck is not run within the tombstone lifetime, these links can
persist in the database forever.  The risk of unintentional information loss
is why these links are only removed within the same partition.  A
replication may be in progress which has created only one end of
the link, so we must keep that.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Rowland Penny <rpenny@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Oct 19 00:50:19 CEST 2017 on sn-devel-144

6 years agounittests: Fix missing include of signal.h
Lumir Balhar [Wed, 11 Oct 2017 19:02:24 +0000 (21:02 +0200)]
unittests: Fix missing include of signal.h

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 Oct 18 14:24:39 CEST 2017 on sn-devel-144

6 years agopython: Fix Python 2.6 compatibility
Lumir Balhar [Wed, 11 Oct 2017 19:00:29 +0000 (21:00 +0200)]
python: Fix Python 2.6 compatibility

PyErr_NewExceptionWithDoc() isn't available in Python 2.6 so it can
be used only in higher versions of Python.

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agotests: Improve tests of samba.registry Python module
Lumir Balhar [Wed, 11 Oct 2017 11:05:01 +0000 (13:05 +0200)]
tests: Improve tests of samba.registry Python module

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agopython: Port samba.registry module to Python 3 compatible form
Lumir Balhar [Wed, 11 Oct 2017 10:46:11 +0000 (12:46 +0200)]
python: Port samba.registry 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>
6 years agoctdb-tests: Add tests for event scripts with multiple '.'s
Amitay Isaacs [Thu, 12 Oct 2017 03:44:03 +0000 (14:44 +1100)]
ctdb-tests: Add tests for event scripts with multiple '.'s

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

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 Oct 18 10:19:48 CEST 2017 on sn-devel-144

6 years agoctdb-common: Ignore event scripts with multiple '.'s
Amitay Isaacs [Thu, 12 Oct 2017 03:42:59 +0000 (14:42 +1100)]
ctdb-common: Ignore event scripts with multiple '.'s

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

This avoids running event script copies left by a package manager.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agovfs_catia: Fix a potential memleak
Volker Lendecke [Mon, 16 Oct 2017 15:43:09 +0000 (17:43 +0200)]
vfs_catia: Fix a potential memleak

Together with the previous commit this fixes a memleak (twice) that
happens when vfs_catia is loaded with no mappings defined.

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Oct 17 18:53:48 CEST 2017 on sn-devel-144

6 years agovfs_catia: Fix a memory leak
Volker Lendecke [Tue, 17 Oct 2017 09:28:36 +0000 (11:28 +0200)]
vfs_catia: Fix a memory leak

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 years agovfs_catia: Make "srt_head" static to the module
Volker Lendecke [Tue, 17 Oct 2017 09:20:20 +0000 (11:20 +0200)]
vfs_catia: Make "srt_head" static to the module

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 years agoUpdate .ycm_extra_conf.py
Ralph Boehme [Tue, 17 Oct 2017 11:13:53 +0000 (13:13 +0200)]
Update .ycm_extra_conf.py

The previous commit removed many includes. Why? This commit adds back
includes generated by running the latest YCM-Generator/config_gen.py.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agos3/smbd: use correct access in get_file_handle_for_metadata
Ralph Boehme [Tue, 29 Aug 2017 14:08:06 +0000 (16:08 +0200)]
s3/smbd: use correct access in get_file_handle_for_metadata

All we want here is FILE_WRITE_ATTRIBUTES, not FILE_WRITE_DATA.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Oct 17 11:48:09 CEST 2017 on sn-devel-144

6 years agos3/smbd: fix access checks in set_ea_dos_attribute()
Ralph Boehme [Tue, 29 Aug 2017 13:55:19 +0000 (15:55 +0200)]
s3/smbd: fix access checks in set_ea_dos_attribute()

We wanted to set the DOS attributes and failed with permission denied
from the VFS/kernel/filesystem. Next thing we wanna do here is override
this if either

- "dos filemode = true" is set and the security descriptor gives the
  user write access or if

- the stored security descriptor has FILE_WRITE_ATTRIBUTES

The former was working, but the latter was not implemented at all.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos3/smbd: README.Coding fixes in set_ea_dos_attribute
Ralph Boehme [Thu, 12 Oct 2017 13:41:01 +0000 (15:41 +0200)]
s3/smbd: README.Coding fixes in set_ea_dos_attribute

While I'm at it, some README.Coding fixes in set_ea_dos_attribute.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_fruit: Replace closedir() by SMB_VFS_CLOSEDIR
Anoop C S [Fri, 13 Oct 2017 15:08:31 +0000 (20:38 +0530)]
vfs_fruit: Replace closedir() by SMB_VFS_CLOSEDIR

Pointer to directory 'dh' inside fruit_rmdir() is obtained using
SMB_VFS_OPENDIR. But this handle is closed directly by invoking
closedir() rather than SMB_VFS_CLOSEDIR. This will result in a
smbd crash if this handle was not obtained from local file system.
Therefore use SMB_VFS_CLOSEDIR corresponding to SMB_VFS_OPENDIR
to correctly close the directory handle.

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

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Mon Oct 16 19:56:55 CEST 2017 on sn-devel-144

6 years agodocs-xml: Fix a typo in manpage for vfs_fruit
Anoop C S [Mon, 16 Oct 2017 09:19:41 +0000 (14:49 +0530)]
docs-xml: Fix a typo in manpage for vfs_fruit

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-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 Oct 16 15:55:35 CEST 2017 on sn-devel-144

6 years agoctdb-tests: Check an unchecked return value
Martin Schwenke [Wed, 11 Oct 2017 08:16:25 +0000 (19:16 +1100)]
ctdb-tests: Check an unchecked return value

This can't fail but check it for completeness... just in case Coverity
decides to notice it.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Oct 16 09:27:17 CEST 2017 on sn-devel-144

6 years agoctdb-test: Fix CID 1419118 (Error handling issues)
Martin Schwenke [Wed, 11 Oct 2017 08:04:28 +0000 (19:04 +1100)]
ctdb-test: Fix CID 1419118 (Error handling issues)

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agoctdb-client: Fix a typo
Martin Schwenke [Tue, 10 Oct 2017 03:51:40 +0000 (14:51 +1100)]
ctdb-client: Fix a typo

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agoctdb-tests: Strengthen some tests
Martin Schwenke [Mon, 9 Oct 2017 03:56:00 +0000 (14:56 +1100)]
ctdb-tests: Strengthen some tests

Check for the expected result instead of just any failure.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agoctdb-protocol: Fix typo in type of return variable
Martin Schwenke [Mon, 9 Oct 2017 03:52:30 +0000 (14:52 +1100)]
ctdb-protocol: Fix typo in type of return variable

This causes failures to be folded down to 1, which is incorrect.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agoman pages: properly ident lists
Alexander Bokovoy [Fri, 6 Oct 2017 19:52:36 +0000 (22:52 +0300)]
man pages: properly ident lists

It took me some time (original bug was filed in 2013!) but now
lists in smb.conf.5 are properly idented.

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

Signed-Off-By: Alexander Bokovoy <ab@samba.org>
Reviewed-By: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Oct 14 11:31:07 CEST 2017 on sn-devel-144

6 years agosmb.conf.5: sort parameters alphabetically
Alexander Bokovoy [Fri, 6 Oct 2017 19:49:11 +0000 (22:49 +0300)]
smb.conf.5: sort parameters alphabetically

Content of each separate parameter description file is added
into a parameters.all.xml file before compiling smb.conf.5.

The issue is that POSIX file systems generally don't give any
promises over how glob-produced files are sorted. Thus, we need to sort
them in a predictable way.

This patch adds sorting based on a file name as a string. Since all
parameter files named after the parameter itself (plus .xml), we can
use file name sorting.

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

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-By: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoselftest: Add sanity-check RODC can't use cache to reveal secrets
Tim Beale [Mon, 2 Oct 2017 01:33:47 +0000 (14:33 +1300)]
selftest: Add sanity-check RODC can't use cache to reveal secrets

Bug 12977 highlighted that Samba only checks exop GetNcChanges requests
once, when they're first received. This makes sense because valid exop
requests should only ever involve a single request. For regular
(non-exop) GetNcChanges requests, the server stores a cache of the
object GUIDs to return.

What we don't want to happen is for a malicious/compromised RODC to use
this cache to circumvent privilege checks, and receive secrets that it's
normally not permitted to access (e.g. the administrator's password).

The specific scenario we're concerned about is:
- The RODC sends a regular GetNcChanges request for all objects (without
  secrets). (This causes the server to build its GUID array cache).
- The RODC then sends a follow-on request for the next chunk, but sets
  the REPL_SECRET exop this time.

The only thing inadvertently preventing Samba from leaking secrets in
this case is updating msDS-RevealedUsers for auditing. It's possible
that a future code change may alter the codepath and open up a
security-hole without realizing. This patch adds a test case so if that
ever did happen, the selftests would detect the problem.

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

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoselftest: prevent interpretation of escape sequences in test_give_owner.sh
Ralph Boehme [Fri, 13 Oct 2017 12:32:58 +0000 (14:32 +0200)]
selftest: prevent interpretation of escape sequences in test_give_owner.sh

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sat Oct 14 06:02:50 CEST 2017 on sn-devel-144

6 years agos4/torture: vfs_fruit: test xattr unpacking
Ralph Boehme [Wed, 11 Oct 2017 14:04:58 +0000 (16:04 +0200)]
s4/torture: vfs_fruit: test xattr unpacking

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Oct 13 21:44:02 CEST 2017 on sn-devel-144

6 years agos4/torture: vfs_fruit: replace AppleDouble data blob with xattr data
Ralph Boehme [Mon, 9 Oct 2017 14:18:18 +0000 (16:18 +0200)]
s4/torture: vfs_fruit: replace AppleDouble data blob with xattr data

The osx_adouble_w_xattr datablob is used to test conversion from sidecar
._ file metdata to Samba compatible ._ file.

The previous data blob didn't contain xattr data, the new one does.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agovfs_fruit: on-access conversion of AppleDouble xattr data
Ralph Boehme [Wed, 11 Oct 2017 10:58:59 +0000 (12:58 +0200)]
vfs_fruit: on-access conversion of AppleDouble xattr data

This finally adds on-access conversion of xattr data stored in sidecar
AppleDouble files.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agovfs_fruit: static string fruit_catia_maps
Ralph Boehme [Tue, 10 Oct 2017 17:13:36 +0000 (19:13 +0200)]
vfs_fruit: static string fruit_catia_maps

In a later commit these will be used somewhere else too.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agovfs_fruit: pass smb_fname to ad_convert
Ralph Boehme [Tue, 10 Oct 2017 14:15:49 +0000 (16:15 +0200)]
vfs_fruit: pass smb_fname to ad_convert

This will be needed in a later commit when converting xattrs in sidecar
AppleDouble files.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agovfs_fruit: unpack AppleDouble xattr header if present
Ralph Boehme [Tue, 10 Oct 2017 14:06:33 +0000 (16:06 +0200)]
vfs_fruit: unpack AppleDouble xattr header if present

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agovfs_fruit: allocate ad_data buffer up to AD_XATTR_MAX_HDR_SIZE bytes
Ralph Boehme [Tue, 10 Oct 2017 14:04:29 +0000 (16:04 +0200)]
vfs_fruit: allocate ad_data buffer up to AD_XATTR_MAX_HDR_SIZE bytes

This is in preperation of reading potential xattr header data from the
AppleDouble file, not just reading a fixed amount of bytes.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agovfs_fruit: add AppleDouble xattr structure definitions
Ralph Boehme [Tue, 10 Oct 2017 14:03:13 +0000 (16:03 +0200)]
vfs_fruit: add AppleDouble xattr structure definitions

Reference:
https://opensource.apple.com/source/xnu/xnu-4570.1.46/bsd/vfs/vfs_xattr.c

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agovfs_fruit: fix ftruncating resource fork
Ralph Boehme [Wed, 11 Oct 2017 16:11:12 +0000 (18:11 +0200)]
vfs_fruit: fix ftruncating resource fork

fruit_ftruncate_rsrc_adouble() is called to effectively ftruncate() the
._ AppleDouble file to the requested size.

The VFS function SMB_VFS_NEXT_FTRUNCATE() otoh would attempt to truncate
to fsp *stream* in any way the next VFS module seems fit. As we know
we're stacked with a streams module, the module will attempt to truncate
the stream. So we're not truncating the ._ file.

This went unnoticed as the AppleDouble file header contains the
authorative resource fork size that was updated correctly.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agovfs_catia: factor out mapping functions
Ralph Boehme [Wed, 11 Oct 2017 09:35:15 +0000 (11:35 +0200)]
vfs_catia: factor out mapping functions

This moves the core mapping functions to a seperate file and makes them
global.

string_replace_init_map() is called to parse a mapping in string and
produce a mapping object that can then be passed to
string_replace_allocate() to do the actual mapping of a string.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agoselftest: add some debugging to test_give_owner.sh
Ralph Boehme [Thu, 12 Oct 2017 15:07:15 +0000 (17:07 +0200)]
selftest: add some debugging to test_give_owner.sh

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): Fri Oct 13 01:22:05 CEST 2017 on sn-devel-144

6 years agoUpdated error message text and reduced its debug level
Marc Muehlfeld [Wed, 11 Oct 2017 07:49:45 +0000 (09:49 +0200)]
Updated error message text and reduced its debug level

Previously, "net rpc share add|remove" commands failed if no
"add|delete share command" parameter was set in smb.conf. However,
the error was only logged at level 10 and not very clear.
This patch updates the error message text and sets the log level of this
error to 1 to make it more obvious what is missing.

Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos4:heimdal_build: there's no need to define HAVE_KRB5_ADDRESSES twice
Stefan Metzmacher [Mon, 9 Oct 2017 10:39:52 +0000 (12:39 +0200)]
s4:heimdal_build: there's no need to define HAVE_KRB5_ADDRESSES twice

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Oct 11 12:33:42 CEST 2017 on sn-devel-144

6 years agokrb5_wrap: ADDRTYPE_INET6 is available in all supported MIT versions
Stefan Metzmacher [Mon, 9 Oct 2017 10:50:35 +0000 (12:50 +0200)]
krb5_wrap: ADDRTYPE_INET6 is available in all supported MIT versions

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
6 years agokrb5_wrap: KRB5_ADDRESS_INET6 is not a define in Heimdal
Stefan Metzmacher [Mon, 9 Oct 2017 10:50:35 +0000 (12:50 +0200)]
krb5_wrap: KRB5_ADDRESS_INET6 is not a define in Heimdal

All supported versions of Heimal already have KRB5_ADDRESS_INET6,
so there's no need for an explicit check.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
6 years agos3: spoolss: Extend publish_toggle test to check returned GUID string format
Samuel Cabrero [Thu, 5 Oct 2017 17:22:29 +0000 (19:22 +0200)]
s3: spoolss: Extend publish_toggle test to check returned GUID string format

Extend the rpc.spoolss.printer.addprinter.publish_toggle test to
check the format of the returned GUID string in GetPrinter info
level 7 structure.

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

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Oct 11 06:39:00 CEST 2017 on sn-devel-144

6 years agowinbindd: idmap_rid: error code for failing id-to-sid mapping request
Ralph Boehme [Mon, 9 Oct 2017 11:29:05 +0000 (13:29 +0200)]
winbindd: idmap_rid: error code for failing id-to-sid mapping request

NT_STATUS_NO_SUCH_DOMAIN triggers complete request failure in the parent
winbindd. By returning NT_STATUS_NONE_MAPPED winbindd lets the individual
mapping fail but keeps processing any remaining mapping requests.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Oct 10 19:57:37 CEST 2017 on sn-devel-144

6 years agowinbindd: idmap_rid: don't rely on the static domain list
Ralph Boehme [Mon, 25 Sep 2017 13:42:08 +0000 (15:42 +0200)]
winbindd: idmap_rid: don't rely on the static domain list

The domain list in the idmap child is inherited from the parent winbindd
process and may not contain all domains in case enumerating trusted
domains didn't finish before the first winbind request that triggers the
idmap child fork comes along.

The previous commits added the domain SID as an additional argument to
the wbint_UnixIDs2Sids request, storing the domain SID in struct
idmap_domain.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agowinbindd: pass domain SID to wbint_UnixIDs2Sids
Ralph Boehme [Mon, 25 Sep 2017 13:39:39 +0000 (15:39 +0200)]
winbindd: pass domain SID to wbint_UnixIDs2Sids

This makes the domain SID available to the idmap child for
wbint_UnixIDs2Sids mapping request. It's not used yet anywhere, this
comes in the next commit.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agowinbindd: add domain SID to idmap mapping domains
Ralph Boehme [Mon, 25 Sep 2017 11:25:57 +0000 (13:25 +0200)]
winbindd: add domain SID to idmap mapping domains

Fetch the domain SID for every domain in the idmap-domain map. This is
in preperation of passing the domain SID as an additional argument to
xid2sid requests to the idmap child.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agoctdb-tests: Add interactive test for tunnels
Amitay Isaacs [Fri, 11 Aug 2017 05:53:28 +0000 (15:53 +1000)]
ctdb-tests: Add interactive test for tunnels

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): Tue Oct 10 15:50:04 CEST 2017 on sn-devel-144

6 years agoctdb-tests: Add test for tunnels
Amitay Isaacs [Mon, 26 Jun 2017 08:06:18 +0000 (18:06 +1000)]
ctdb-tests: Add test for tunnels

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-protocol: Add tunnel id prefix for testing
Amitay Isaacs [Fri, 29 Sep 2017 02:16:21 +0000 (12:16 +1000)]
ctdb-protocol: Add tunnel id prefix for testing

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-client: Add client api for using tunnels
Amitay Isaacs [Thu, 6 Apr 2017 09:33:47 +0000 (19:33 +1000)]
ctdb-client: Add client api for using tunnels

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-protocol: Add protocol marshalling for CTDB_REQ_TUNNEL
Amitay Isaacs [Wed, 5 Apr 2017 06:25:42 +0000 (16:25 +1000)]
ctdb-protocol: Add protocol marshalling for CTDB_REQ_TUNNEL

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-client: Add client code for tunnel controls
Amitay Isaacs [Thu, 6 Apr 2017 08:58:18 +0000 (18:58 +1000)]
ctdb-client: Add client code for tunnel controls

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-protocol: Add protocol marshalling for tunnel controls
Amitay Isaacs [Thu, 6 Apr 2017 08:58:01 +0000 (18:58 +1000)]
ctdb-protocol: Add protocol marshalling for tunnel controls

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-daemon: Add code to process ctdb_req_tunnel packets
Amitay Isaacs [Thu, 6 Apr 2017 09:09:58 +0000 (19:09 +1000)]
ctdb-daemon: Add code to process ctdb_req_tunnel packets

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-protocol: Add req_tunnel counts to ctdb statistics
Amitay Isaacs [Thu, 6 Apr 2017 07:50:38 +0000 (17:50 +1000)]
ctdb-protocol: Add req_tunnel counts to ctdb statistics

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-daemon: Add implementation of tunnel controls
Amitay Isaacs [Thu, 6 Apr 2017 09:03:51 +0000 (19:03 +1000)]
ctdb-daemon: Add implementation of tunnel controls

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-protocol: Add controls to register/deregister tunnels
Amitay Isaacs [Thu, 6 Apr 2017 08:31:10 +0000 (18:31 +1000)]
ctdb-protocol: Add controls to register/deregister tunnels

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-protocol: Add REQ_TUNNEL packet type
Amitay Isaacs [Wed, 5 Apr 2017 06:07:10 +0000 (16:07 +1000)]
ctdb-protocol: Add REQ_TUNNEL packet type

This allows to tunnel new protocols using ctdb transport.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agowbinfo: return "NOT MAPPED" instead of "S-0-0" for unmapped id-to-sid
Ralph Boehme [Mon, 9 Oct 2017 11:25:21 +0000 (13:25 +0200)]
wbinfo: return "NOT MAPPED" instead of "S-0-0" for unmapped id-to-sid

Currently wbinfo --unix-ids-to-sids prints "S-0-0" for failed
mappings. Let it print "NOT MAPPED" instead.

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): Tue Oct 10 02:57:40 CEST 2017 on sn-devel-144

6 years agovfs_fake_acls: deny give-ownership
Ralph Boehme [Fri, 6 Oct 2017 13:25:54 +0000 (15:25 +0200)]
vfs_fake_acls: deny give-ownership

Windows doesn't allow giving ownership away unless the user has
SEC_PRIV_RESTORE privilege.

This follows from MS-FSA 2.1.5.1, so it's a property of the filesystem
layer, not the SMB layer. By implementing this restriction here, we can
now have test for this restriction.

Other filesystems may want to deliberately allow this behaviour --
although I'm not aware of any that does -- therefor I'm putting in this
restriction in the implementation of the chmod VFS function and not into
the caller.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_acl_common: fix take ownership vs give ownership
Ralph Boehme [Wed, 4 Oct 2017 20:27:24 +0000 (22:27 +0200)]
vfs_acl_common: fix take ownership vs give ownership

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_acl_common: factor out a variable declaration
Ralph Boehme [Wed, 4 Oct 2017 10:51:29 +0000 (12:51 +0200)]
vfs_acl_common: factor out a variable declaration

Just some refactoring, no change in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos3/smbd/posix_acls: return correct status in try_chown
Ralph Boehme [Wed, 4 Oct 2017 13:45:54 +0000 (15:45 +0200)]
s3/smbd/posix_acls: return correct status in try_chown

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agoselftest: tests for change ownership on a file
Ralph Boehme [Fri, 6 Oct 2017 13:31:20 +0000 (15:31 +0200)]
selftest: tests for change ownership on a file

This test verifies that SEC_STD_WRITE_OWNER only effectively grants
take-ownership permissions but NOT give-ownership. The latter requires
SeRestorePrivilege privilege.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agoselftest: fix samba3.blackbox.inherit_owner.default test script test_inherit_owner.sh
Ralph Boehme [Sat, 7 Oct 2017 07:11:56 +0000 (09:11 +0200)]
selftest: fix samba3.blackbox.inherit_owner.default test script test_inherit_owner.sh

Grant the test-user SeRestorePrivilege, this is needed for
give-ownership operations. And then granting SeRestorePrivilege requires
`net`, so add that as an additional argument to the script.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agoselftest: fix acl_xattr test script test_acl_xattr.sh
Ralph Boehme [Sun, 8 Oct 2017 09:17:12 +0000 (11:17 +0200)]
selftest: fix acl_xattr test script test_acl_xattr.sh

The two "nt_affects_chgrp" tests called the wrong function so the
function nt_affects_chgrp() was never run.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agoselftest: fix acl_xattr test: sn-devel unreliable gid
Ralph Boehme [Sun, 8 Oct 2017 06:51:05 +0000 (08:51 +0200)]
selftest: fix acl_xattr test: sn-devel unreliable gid

The "nt_affects_chgrp" kept failing in a full autobuild on sn-devel
because the actual gid of the created file as returned by smbclient -c
getfacl was reliably the unix gid of my account. It should have been the
mapped domusers group for the primary users "Domain Users"
group. Running the test individually or even the full set of
"samba3.blackbox" tests didn't trigger the error.

Looks like an issue with vfs_fake_acls and vfs_xattr_tdb, but I wasn't
able to track it down. As the test only really want to ensure that
smbcacls -G set the gid to the requested value, just remove the check
for the actual initial gid.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agoselftest: fix acl_xattr test: grep ouput before munging
Ralph Boehme [Sun, 8 Oct 2017 09:16:27 +0000 (11:16 +0200)]
selftest: fix acl_xattr test: grep ouput before munging

The check of the smbclient getfacl output for presence of a "^# group:"
line must be done before munging the saved output with a sed filter.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agoselftest: fix acl_xattr test: group, not user
Ralph Boehme [Sun, 8 Oct 2017 09:13:46 +0000 (11:13 +0200)]
selftest: fix acl_xattr test: group, not user

In nt_affects_chgrp() check for domadmins *group*, not user. This didn't
trigger an error as nt_affects_chgrp() isn't actually called, see next
commit.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agoselftest: fix acl_xattr test: changing owner
Ralph Boehme [Sun, 8 Oct 2017 09:12:48 +0000 (11:12 +0200)]
selftest: fix acl_xattr test: changing owner

Don't give ownership to user "force_user" as user "$USERNAME", this
would fail with NT_STATUS_INVALID_OWNER, instead just take ownership as
user "force_user". Adding a corresponding ACE for "force_user" with FULL
rights ensures this works.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos3: smbd: Currently if getwd() fails after a chdir(), we panic.
Jeremy Allison [Wed, 4 Oct 2017 19:43:22 +0000 (12:43 -0700)]
s3: smbd: Currently if getwd() fails after a chdir(), we panic.

Change this to return to the previous $cwd, and return -1 for the chdir().

If the return to the previous $cwd fails, still panic as we
can't return an unknown state.

Also do early return from failing SMB_VFS_CHDIR, reducing indentation level

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Ralph Böhme <slow@samba.org>
6 years agosmbcacls: no need to fetch the sd when changing ownership
Ralph Boehme [Fri, 6 Oct 2017 06:01:46 +0000 (08:01 +0200)]
smbcacls: no need to fetch the sd when changing ownership

Reading the SD may be denied but changing ownership could be allowed. As
we don't really need the server SD for the change ownership request,
don't fetch it.

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): Sat Oct  7 00:04:54 CEST 2017 on sn-devel-144

6 years agos3: spoolss: Fix GUID string format on GetPrinter info
Samuel Cabrero [Thu, 21 Sep 2017 07:53:35 +0000 (09:53 +0200)]
s3: spoolss: Fix GUID string format on GetPrinter info

Fix regression introduced by commit a4157e7c5d75 which removed the braces
around the printer GUID in the printer info level 7 structure.

MS-RPRN section 2.2 says this protocol uses curly-braced GUIDs so printers
are deleted from the directory by the domain controller's pruning service.

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

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Oct  6 05:21:25 CEST 2017 on sn-devel-144

6 years agoctdb-common: Make parse_ip() and parse_ipv4() static
Martin Schwenke [Tue, 19 Sep 2017 13:51:21 +0000 (23:51 +1000)]
ctdb-common: Make parse_ip() and parse_ipv4() static

parse_ip() has interface checking for IPv6 that is still used
indirectly by the IP takeover code via parse_ip_mask().  This will be
removed eventually.

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): Thu Oct  5 09:19:31 CEST 2017 on sn-devel-144

6 years agoctdb-common: Replace parse_ip() -> ctdb_sock_addr_from_string()
Martin Schwenke [Tue, 19 Sep 2017 13:44:31 +0000 (23:44 +1000)]
ctdb-common: Replace parse_ip() -> ctdb_sock_addr_from_string()

... and ctdb_sock_addr_set_port().

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-tests: Replace parse_ip() -> ctdb_sock_addr_from_string()
Martin Schwenke [Tue, 19 Sep 2017 13:38:31 +0000 (23:38 +1000)]
ctdb-tests: Replace parse_ip() -> ctdb_sock_addr_from_string()

... and ctdb_sock_addr_set_port() where required.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-tools: Replace parse_ip() -> ctdb_sock_addr_from_string()
Martin Schwenke [Tue, 19 Sep 2017 13:28:45 +0000 (23:28 +1000)]
ctdb-tools: Replace parse_ip() -> ctdb_sock_addr_from_string()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-common: Remove unused function parse_ip_port()
Martin Schwenke [Tue, 19 Sep 2017 13:19:00 +0000 (23:19 +1000)]
ctdb-common: Remove unused function parse_ip_port()

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