]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
6 years agofuzz: add a fuzzer for parsing ldb controls
Douglas Bagnall [Thu, 9 Jan 2020 04:40:02 +0000 (17:40 +1300)] 
fuzz: add a fuzzer for parsing ldb controls

We have had issues here in the past.

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): Sun Jan 12 21:21:30 UTC 2020 on sn-devel-184

6 years agoldb controls: fix typo in bypassoperational message
Douglas Bagnall [Thu, 9 Jan 2020 06:19:56 +0000 (19:19 +1300)] 
ldb controls: fix typo in bypassoperational message

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agofuzz_ldap_decode: do not print to stdout
Douglas Bagnall [Thu, 9 Jan 2020 04:01:22 +0000 (17:01 +1300)] 
fuzz_ldap_decode: do not print to stdout

The fuzzer doesn't care and it slows things down

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agodecode_ndr_X_crash: always find pipe in honggfuzz file
Douglas Bagnall [Thu, 12 Dec 2019 23:08:47 +0000 (12:08 +1300)] 
decode_ndr_X_crash: always find pipe in honggfuzz file

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agovfs_ceph: drop support for pre-hammer libcephfs versions
David Disseldorp [Thu, 9 Jan 2020 15:01:22 +0000 (16:01 +0100)] 
vfs_ceph: drop support for pre-hammer libcephfs versions

The last Ceph Hammer release (0.94.10) came in Feb 2017, as is no longer
supported upstream. Drop support for building Samba vfs_ceph against
version prior to 0.94.0.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Sat Jan 11 14:59:36 UTC 2020 on sn-devel-184

6 years agovfs_ceph: drop support for building without statx
David Disseldorp [Thu, 9 Jan 2020 16:11:39 +0000 (17:11 +0100)] 
vfs_ceph: drop support for building without statx

libcephfs statx became available with the Kraken (11.2.0) release of
Ceph in Jan 2017. Versions prior to this are no longer supported
upstream, so we can drop support within Samba vfs_ceph.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
6 years agos3: smbd: msdfs: Change create_msdfs_link() to call SMB_VFS_CREATE_DFS_PATHAT().
Jeremy Allison [Thu, 9 Jan 2020 22:21:46 +0000 (14:21 -0800)] 
s3: smbd: msdfs: Change create_msdfs_link() to call SMB_VFS_CREATE_DFS_PATHAT().

No change in the (rather strange) logic.

First step in abstracting MSDFS storage from direct symlink calls.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan 10 21:05:25 UTC 2020 on sn-devel-184

6 years agos3: VFS: Implement create_dfs_pathat() in time_audit.
Jeremy Allison [Thu, 9 Jan 2020 21:36:08 +0000 (13:36 -0800)] 
s3: VFS: Implement create_dfs_pathat() in time_audit.

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agos3: VFS: Implement create_dfs_pathat() in full_audit.
Jeremy Allison [Thu, 9 Jan 2020 21:33:23 +0000 (13:33 -0800)] 
s3: VFS: Implement create_dfs_pathat() in full_audit.

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agos3: VFS: Implement create_dfs_pathat() in snapper.
Jeremy Allison [Thu, 9 Jan 2020 21:13:29 +0000 (13:13 -0800)] 
s3: VFS: Implement create_dfs_pathat() in snapper.

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agos3: VFS: Implement create_dfs_pathat() in shadow_copy2.
Jeremy Allison [Thu, 9 Jan 2020 21:06:36 +0000 (13:06 -0800)] 
s3: VFS: Implement create_dfs_pathat() in shadow_copy2.

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agos3: VFS: Implement create_dfs_pathat() in gluster.
Jeremy Allison [Thu, 9 Jan 2020 22:48:33 +0000 (14:48 -0800)] 
s3: VFS: Implement create_dfs_pathat() in gluster.

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agos3: VFS: Implement create_dfs_pathat() in ceph.
Jeremy Allison [Thu, 9 Jan 2020 22:39:43 +0000 (14:39 -0800)] 
s3: VFS: Implement create_dfs_pathat() in ceph.

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agos3: VFS: Add SMB_VFS_CREATE_DFS_PATHAT().
Jeremy Allison [Thu, 9 Jan 2020 18:13:14 +0000 (10:13 -0800)] 
s3: VFS: Add SMB_VFS_CREATE_DFS_PATHAT().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agondr basic: Check ndr_token_store return code
Gary Lockyer [Tue, 7 Jan 2020 20:39:30 +0000 (09:39 +1300)] 
ndr basic: Check ndr_token_store return code

Fix for

*** CID 1457529:  Error handling issues  (CHECKED_RETURN)
/librpc/ndr/ndr_basic.c: 786 in ndr_push_full_ptr()
...
ID 1457529:  Error handling issues  (CHECKED_RETURN)
    Calling "ndr_token_store" without checking return value (as is done
    elsewhere 14 out of 17 times).

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Thu Jan  9 21:49:00 UTC 2020 on sn-devel-184

6 years agovfs_ceph: assert renameat() fsps match cwd
David Disseldorp [Thu, 9 Jan 2020 17:20:39 +0000 (18:20 +0100)] 
vfs_ceph: assert renameat() fsps match cwd

As discussed with Jeremy in bug 14232, the vfs_ceph.renameat_fn
implementation currently ignores srcfsp and dstfsp. As a result,
relative smb_fname_src/smb_fname_dest paths will be processed as
relative to cwd.
This is currently a valid assumption, as srcfsp and dstfsp should
always match conn->cwd_fsp. Add an assert to clarify this.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jan  9 20:20:05 UTC 2020 on sn-devel-184

6 years agontlm_auth: Add type-safety instead of a simple cast
Volker Lendecke [Sun, 5 Jan 2020 13:11:54 +0000 (14:11 +0100)] 
ntlm_auth: Add type-safety instead of a simple cast

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agontlm_auth: Add a NULL check
Volker Lendecke [Sun, 5 Jan 2020 13:11:20 +0000 (14:11 +0100)] 
ntlm_auth: Add a NULL check

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agoprinting: Avoid EBADF from EPOLL_CTL_DEL
Volker Lendecke [Thu, 9 Jan 2020 13:43:02 +0000 (14:43 +0100)] 
printing: Avoid EBADF from EPOLL_CTL_DEL

TALLOC_FREE the fde before closing the fd. Otherwise the fde
destructor tries to remove a nonexisting fd from the epoll set.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agoprinting: Align integer types
Volker Lendecke [Thu, 9 Jan 2020 13:42:43 +0000 (14:42 +0100)] 
printing: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos3-rpcclient: add clusapi_resume_node command.
Günther Deschner [Mon, 9 May 2016 10:10:22 +0000 (12:10 +0200)] 
s3-rpcclient: add clusapi_resume_node command.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jan  9 01:15:34 UTC 2020 on sn-devel-184

6 years agos3-rpcclient: add clusapi_pause_node command.
Günther Deschner [Mon, 9 May 2016 10:07:47 +0000 (12:07 +0200)] 
s3-rpcclient: add clusapi_pause_node command.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos3-rpcclient: give slightly better descriptions to clusapi commands
Günther Deschner [Wed, 8 Jan 2020 16:25:13 +0000 (17:25 +0100)] 
s3-rpcclient: give slightly better descriptions to clusapi commands

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibrpc: pidlify spoolss_EnumPerMachineConnections
Günther Deschner [Mon, 23 Dec 2019 15:53:37 +0000 (16:53 +0100)] 
librpc: pidlify spoolss_EnumPerMachineConnections

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibrpc/ndr: provide infrastructure for NDR_SPOOLSS_{PUSH|PULL}_ENUM macros
Günther Deschner [Tue, 7 Jan 2020 13:58:15 +0000 (14:58 +0100)] 
librpc/ndr: provide infrastructure for NDR_SPOOLSS_{PUSH|PULL}_ENUM macros

The new macros allow the same macro convenience for enum functions without
level discriminator.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibrpc: better naming for NDR_SPOOLSS_{PUSH|PULL}_ENUM variants
Günther Deschner [Mon, 23 Dec 2019 15:50:28 +0000 (16:50 +0100)] 
librpc: better naming for NDR_SPOOLSS_{PUSH|PULL}_ENUM variants

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos4-torture: add test for spoolss_EnumPerMachineConnections
Günther Deschner [Fri, 20 Dec 2019 12:43:25 +0000 (13:43 +0100)] 
s4-torture: add test for spoolss_EnumPerMachineConnections

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos4-torture: add test for spoolss AddPerMachineConnection
Günther Deschner [Sun, 22 Sep 2019 01:34:56 +0000 (03:34 +0200)] 
s4-torture: add test for spoolss AddPerMachineConnection

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos3-rpcclient: add delpermachineconnection command
Günther Deschner [Sun, 22 Sep 2019 01:34:27 +0000 (03:34 +0200)] 
s3-rpcclient: add delpermachineconnection command

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos3-rpcclient: add addpermachineconnection command
Günther Deschner [Mon, 23 Dec 2019 11:42:53 +0000 (12:42 +0100)] 
s3-rpcclient: add addpermachineconnection command

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos3-rpcclient: add enumpermachineconnections command
Günther Deschner [Thu, 1 Dec 2016 20:32:18 +0000 (21:32 +0100)] 
s3-rpcclient: add enumpermachineconnections command

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos3-rpcclient: properly check and initialize buffers in getdriverpackagepath
Günther Deschner [Thu, 19 Dec 2019 12:49:53 +0000 (13:49 +0100)] 
s3-rpcclient: properly check and initialize buffers in getdriverpackagepath

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibrpc: add IDL for spoolss_EnumPerMachineConnections
Günther Deschner [Thu, 1 Dec 2016 20:31:52 +0000 (21:31 +0100)] 
librpc: add IDL for spoolss_EnumPerMachineConnections

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos3-rpcclient: add cmd_spoolss_get_core_printer_drivers
Günther Deschner [Mon, 19 Sep 2016 15:03:44 +0000 (17:03 +0200)] 
s3-rpcclient: add cmd_spoolss_get_core_printer_drivers

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agolibrpc: fix IDL for spoolss_GetCorePrinterDrivers()
Günther Deschner [Tue, 7 Jan 2020 14:52:40 +0000 (15:52 +0100)] 
librpc: fix IDL for spoolss_GetCorePrinterDrivers()

The charset determination makes it more difficult to deal with the real
REG_MULTI_SZ nature of that element.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos3: lib: dbwrap: Set rec->value_valid to avoid backtrace in `smbstatus`
Anoop C S [Wed, 8 Jan 2020 18:24:24 +0000 (10:24 -0800)] 
s3: lib: dbwrap: Set rec->value_valid to avoid backtrace in `smbstatus`

Following backtrace is observed on executing `smbstatus` with at least
one SMB client connection established:

PANIC: assert failed at ../../lib/dbwrap/dbwrap.c(82): rec->value_valid
PANIC (pid 350270): assert failed: rec->value_valid
BACKTRACE: 15 stack frames:
 #0 /usr/local/lib/libsamba-util.so.0(log_stack_trace+0x1f)
[0x7fbbd9b32047]
 #1 /usr/local/lib/libsmbconf.so.0(smb_panic_s3+0x74) [0x7fbbd9c1e6ff]
 #2 /usr/local/lib/libsamba-util.so.0(smb_panic+0x28) [0x7fbbd9b32012]
 #3 /usr/local/lib/samba/libdbwrap-
samba4.so(dbwrap_record_get_value+0x86) [0x7fbbd95800ac]
 #4 /usr/local/lib/samba/libsmbd-base-samba4.so(+0x28f563)
[0x7fbbd999e563]
 #5 /usr/local/lib/samba/libsamba-cluster-support-samba4.so(+0x7851)
[0x7fbbd92c7851]
 #6 /usr/local/lib/samba/libsamba-cluster-support-
samba4.so(ctdbd_traverse+0x4ca) [0x7fbbd92cc641]
 #7 /usr/local/lib/samba/libsamba-cluster-support-samba4.so(+0x73eb)
[0x7fbbd92c73eb]
 #8 /usr/local/lib/samba/libsamba-cluster-support-samba4.so(+0x7a52)
[0x7fbbd92c7a52]
 #9 /usr/local/lib/samba/libdbwrap-samba4.so(dbwrap_traverse_read+0x35)
[0x7fbbd9580de5]
 #10 /usr/local/lib/samba/libsmbd-base-
samba4.so(smbXsrv_tcon_global_traverse+0xc5) [0x7fbbd999e7d9]
 #11 smbstatus(connections_forall_read+0x114) [0x55d17872b8ee]
 #12 smbstatus(main+0x7b2) [0x55d17872a2f3]
 #13 /lib64/libc.so.6(__libc_start_main+0xf3) [0x7fbbd93a21a3]
 #14 smbstatus(_start+0x2e) [0x55d17872894e]
Can not dump core: corepath not set up

Assertion on rec->value_valid fails as it is uninitialized in the
following functions:

traverse_read_callback
traverse_persistent_callback_read

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan  8 23:24:58 UTC 2020 on sn-devel-184

6 years agodocs-xml/winbindnssinfo: clarify interaction with idmap_ad etc.
Björn Jacke [Tue, 7 Jan 2020 09:21:18 +0000 (10:21 +0100)] 
docs-xml/winbindnssinfo: clarify interaction with idmap_ad etc.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14122
RN: docs: clarify interaction between winbind nss info and idmap backend

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Jan  8 15:37:46 UTC 2020 on sn-devel-184

6 years agovfs_gpfs: Update message for requesting sharemode on stream
Christof Schmitt [Mon, 6 Jan 2020 23:08:56 +0000 (16:08 -0700)] 
vfs_gpfs: Update message for requesting sharemode on stream

User newer debug macro and print full path to affected file.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan  8 01:26:46 UTC 2020 on sn-devel-184

6 years agovfs_gpfs: Log failed gpfs_set_share call as error
Christof Schmitt [Mon, 6 Jan 2020 21:52:14 +0000 (14:52 -0700)] 
vfs_gpfs: Log failed gpfs_set_share call as error

Any other error code from gpfs_set_share should never happen. Print a
error message in case this is ever encountered.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_gpfs: Print message when share modes are disabled in file system
Christof Schmitt [Mon, 6 Jan 2020 21:49:39 +0000 (14:49 -0700)] 
vfs_gpfs: Print message when share modes are disabled in file system

GPFS file systems can be configured without support for share modes. As
this results in an unique error code, print a message explaining this
situation and the required config changes.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_gpfs: Explicitly log when share mode has been denied
Christof Schmitt [Mon, 6 Jan 2020 21:42:05 +0000 (14:42 -0700)] 
vfs_gpfs: Explicitly log when share mode has been denied

As this denies access to a file, provide a better error message for
easier troubleshooting.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_gpfs: Use early return in sharemode function
Christof Schmitt [Mon, 6 Jan 2020 21:40:07 +0000 (14:40 -0700)] 
vfs_gpfs: Use early return in sharemode function

This removes one level of indentation.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_gpfs: Switch share mode helper function to return int
Christof Schmitt [Mon, 6 Jan 2020 21:25:22 +0000 (14:25 -0700)] 
vfs_gpfs: Switch share mode helper function to return int

Follow the convention to return 0 on success and -1 when hitting an
error.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_gpfs: Remove logging for unsupported file system
Christof Schmitt [Mon, 6 Jan 2020 21:23:41 +0000 (14:23 -0700)] 
vfs_gpfs: Remove logging for unsupported file system

The gpfs_set_share API call has been around for a long time and
definitely all supported GPFS versions have it. Remove the check and
fallback for old versions without this API.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_gpfs: Only clear sharemode on close when sharemode has been taken
Christof Schmitt [Mon, 6 Jan 2020 21:14:17 +0000 (14:14 -0700)] 
vfs_gpfs: Only clear sharemode on close when sharemode has been taken

This avoids a redundant error message in case the call to acquire the
sharemode had failed before.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_gpfs: Log error if clearing of sharemode fails on close
Christof Schmitt [Mon, 6 Jan 2020 21:07:29 +0000 (14:07 -0700)] 
vfs_gpfs: Log error if clearing of sharemode fails on close

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_gpfs: Add comment explaining why sharemode is dropped in close call.
Christof Schmitt [Mon, 6 Jan 2020 21:00:32 +0000 (14:00 -0700)] 
vfs_gpfs: Add comment explaining why sharemode is dropped in close call.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_gpfs: Remove unncessary check from close function
Christof Schmitt [Mon, 6 Jan 2020 20:53:13 +0000 (13:53 -0700)] 
vfs_gpfs: Remove unncessary check from close function

The fsp has a valid file descriptor when this function is called. No
need for the additional check.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_gpfs: Cleanup debug message file system share mode
Christof Schmitt [Fri, 3 Jan 2020 19:56:07 +0000 (12:56 -0700)] 
vfs_gpfs: Cleanup debug message file system share mode

Use the newer debug macro and the full variable names.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_gpfs: Cleanup clearing file system share mode
Christof Schmitt [Fri, 3 Jan 2020 18:40:50 +0000 (11:40 -0700)] 
vfs_gpfs: Cleanup clearing file system share mode

The VFS flock function is called with a zero access_mask to indicate
that the share mode should be cleared. Adjust the check to directly
check the access_mask and provide a better message to indicate this
case.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_gpfs: Move mapping to sharemode deny to helper function
Christof Schmitt [Mon, 30 Dec 2019 22:39:43 +0000 (15:39 -0700)] 
vfs_gpfs: Move mapping to sharemode deny to helper function

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_gpfs: Move mapping from access mask to sharemode allow to helper function
Christof Schmitt [Mon, 30 Dec 2019 22:33:03 +0000 (15:33 -0700)] 
vfs_gpfs: Move mapping from access mask to sharemode allow to helper function

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_gpfs: Remove check for open file in share mode function
Christof Schmitt [Mon, 30 Dec 2019 22:20:05 +0000 (15:20 -0700)] 
vfs_gpfs: Remove check for open file in share mode function

The calling code already ensures that the file is open with a valid file
descriptor.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_time_audit: Rename argument of flock function
Christof Schmitt [Fri, 3 Jan 2020 19:52:48 +0000 (12:52 -0700)] 
vfs_time_audit: Rename argument of flock function

MS-SMB2 and the smbd code refer to this field as share_access. Use the
same name in the function argument.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_streams_xattr: Rename argument of flock function
Christof Schmitt [Fri, 3 Jan 2020 19:51:17 +0000 (12:51 -0700)] 
vfs_streams_xattr: Rename argument of flock function

MS-SMB2 and the smbd code refer to this field as share_access. Use the
same name in the function argument.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_gpfs: Rename argument of flock function
Christof Schmitt [Fri, 3 Jan 2020 19:45:06 +0000 (12:45 -0700)] 
vfs_gpfs: Rename argument of flock function

MS-SMB2 and the smbd code refer to this field as share_access. Use the
same name in the function argument.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_glusterfs: Rename argument of flock function
Christof Schmitt [Fri, 3 Jan 2020 19:41:00 +0000 (12:41 -0700)] 
vfs_glusterfs: Rename argument of flock function

MS-SMB2 and the smbd code refer to this field as share_access. Use the
same name in the function argument.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_full_audit: Rename argument of flock function
Christof Schmitt [Fri, 3 Jan 2020 19:38:00 +0000 (12:38 -0700)] 
vfs_full_audit: Rename argument of flock function

MS-SMB2 and the smbd code refer to this field as share_access. Use the
same name in the function argument.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_ceph: Rename argument for flock function
Christof Schmitt [Fri, 3 Jan 2020 19:09:23 +0000 (12:09 -0700)] 
vfs_ceph: Rename argument for flock function

MS-SMB2 and the smbd code refer to this field as share_access. Use the
same name in the function argument.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_catia: Rename argument for flock function
Christof Schmitt [Fri, 3 Jan 2020 19:08:38 +0000 (12:08 -0700)] 
vfs_catia: Rename argument for flock function

MS-SMB2 and the smbd code refer to this field as share_access. Use the
same name in the function argument.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_not_implemented: Rename argument for flock function
Christof Schmitt [Fri, 3 Jan 2020 19:06:40 +0000 (12:06 -0700)] 
vfs_not_implemented: Rename argument for flock function

MS-SMB2 and the smbd code refer to this field as share_access. Use the
same name in the function argument.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs: Rename argument for kernel_flock function
Christof Schmitt [Fri, 3 Jan 2020 19:05:57 +0000 (12:05 -0700)] 
vfs: Rename argument for kernel_flock function

MS-SMB2 and the smbd code refer to this field as share_access. Use the
same name in the function argument.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agosystem: Rename argument for kernel_flock function
Christof Schmitt [Fri, 3 Jan 2020 18:58:38 +0000 (11:58 -0700)] 
system: Rename argument for kernel_flock function

MS-SMB2 and the smbd code refer to this field as share_access. Use the
same name in the function argument.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agoauth: Simplify struct auth4_context
Volker Lendecke [Thu, 2 Jan 2020 21:58:06 +0000 (22:58 +0100)] 
auth: Simplify struct auth4_context

The fake async code has been pushed down into the 3 users, remove the sync
callback. Overall it's more lines of code, but the central interface is
simplified.

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): Mon Jan  6 23:34:00 UTC 2020 on sn-devel-184

6 years agontlm_auth: Replace winbind_pw_check() by _send and _recv
Volker Lendecke [Thu, 2 Jan 2020 16:22:36 +0000 (17:22 +0100)] 
ntlm_auth: Replace winbind_pw_check() by _send and _recv

This is just fake async, but it avoids one use of a sync function
pointer in auth4_context

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agontlm_auth: Replace local_pw_check() by _send and _recv
Volker Lendecke [Thu, 2 Jan 2020 16:22:36 +0000 (17:22 +0100)] 
ntlm_auth: Replace local_pw_check() by _send and _recv

This is just fake async, but it avoids one use of a sync function
pointer in auth4_context

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agoauth3: Replace auth3_check_password() by _send and _recv
Volker Lendecke [Thu, 2 Jan 2020 16:22:36 +0000 (17:22 +0100)] 
auth3: Replace auth3_check_password() by _send and _recv

This is just fake async, but it avoids one use of a sync function
pointer in auth4_context

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agowinbindd_pam.c: split winbindd_dual_pam_auth_samlogon
Isaac Boukris [Fri, 3 Jan 2020 14:39:34 +0000 (15:39 +0100)] 
winbindd_pam.c: split winbindd_dual_pam_auth_samlogon

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jan  6 20:33:55 UTC 2020 on sn-devel-184

6 years agoauth: Avoid casts in ntlm_check.c
Volker Lendecke [Fri, 3 Jan 2020 13:24:13 +0000 (14:24 +0100)] 
auth: Avoid casts in ntlm_check.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Mon Jan  6 03:12:20 UTC 2020 on sn-devel-184

6 years agoauth: Check for talloc failure in smb_sess_key_ntlmv2()
Volker Lendecke [Fri, 3 Jan 2020 13:04:02 +0000 (14:04 +0100)] 
auth: Check for talloc failure in smb_sess_key_ntlmv2()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
6 years agoauth: Slightly simplify smb_pwd_check_ntlmv1()
Volker Lendecke [Fri, 3 Jan 2020 13:10:00 +0000 (14:10 +0100)] 
auth: Slightly simplify smb_pwd_check_ntlmv1()

Do an early return for the failure case

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
6 years agoauth: Check for talloc failure in smb_pwd_check_ntlmv1()
Volker Lendecke [Fri, 3 Jan 2020 13:04:02 +0000 (14:04 +0100)] 
auth: Check for talloc failure in smb_pwd_check_ntlmv1()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
6 years agoauth: Slightly simplify smb_pwd_check_ntlmv2()
Volker Lendecke [Fri, 3 Jan 2020 13:10:00 +0000 (14:10 +0100)] 
auth: Slightly simplify smb_pwd_check_ntlmv2()

Do an early return for the failure case

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
6 years agoauth: Check for talloc failure in smb_pwd_check_ntlmv2()
Volker Lendecke [Fri, 3 Jan 2020 13:04:02 +0000 (14:04 +0100)] 
auth: Check for talloc failure in smb_pwd_check_ntlmv2()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
6 years agoauth: Remove the "typedef auth_methods"
Volker Lendecke [Fri, 3 Jan 2020 12:47:14 +0000 (13:47 +0100)] 
auth: Remove the "typedef auth_methods"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
6 years agowinbind: Fix CID 1456624 Uninitialized scalar variable
Volker Lendecke [Fri, 3 Jan 2020 11:42:03 +0000 (12:42 +0100)] 
winbind: Fix CID 1456624 Uninitialized scalar variable

Coverity does not get that for (rc!=0) gnutls_error_to_ntstatus()
never returns NT_STATUS_OK

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
6 years agoauth3: Avoid a casts in auth3_check_password()
Volker Lendecke [Thu, 2 Jan 2020 14:02:44 +0000 (15:02 +0100)] 
auth3: Avoid a casts in auth3_check_password()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
6 years agoauth3: Simplify auth_get_ntlm_challenge()
Volker Lendecke [Fri, 3 Jan 2020 11:51:04 +0000 (12:51 +0100)] 
auth3: Simplify auth_get_ntlm_challenge()

Use generate_random_buffer() directly on the talloc'ed buffer

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
6 years agoauth3: Check for talloc failure
Volker Lendecke [Thu, 2 Jan 2020 11:41:16 +0000 (12:41 +0100)] 
auth3: Check for talloc failure

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
6 years agotests: Fix a typo
Volker Lendecke [Fri, 3 Jan 2020 11:28:49 +0000 (12:28 +0100)] 
tests: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
6 years agopython/loadparm: check for AD DC required VFS modules
Björn Jacke [Fri, 3 Jan 2020 14:29:34 +0000 (15:29 +0100)] 
python/loadparm: check for AD DC required VFS modules

same as the previous commit, just for python's testparm code

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

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Björn Jacke <bjacke@samba.org>
Autobuild-Date(master): Fri Jan  3 22:19:47 UTC 2020 on sn-devel-184

6 years agoloadparm: check for AD DC required VFS modules
David Disseldorp [Fri, 3 Jan 2020 13:31:28 +0000 (14:31 +0100)] 
loadparm: check for AD DC required VFS modules

When Samba is running as a domain controller and the "vfs objects"
parameter is not set, then the dfs_samba4 and acl_xattr modules are
automatically enabled.
However, if the "vfs objects" is defined, then the setting is left
as-is. This means that attempts to us other VFS modules have the side
effect of disabling the dfs_samba4 and acl_xattr modules, causing
unexpected behaviour, which is then blamed on the VFS modules that were
explicitly defined.

This change ensures that when running as a domain controller, Samba logs
an error if the required VFS modules are not enabled by an explicit
"vfs objects" definition.

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

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
6 years agosmbd: Remove an unused parameter from defer_open()
Volker Lendecke [Sun, 22 Dec 2019 17:20:12 +0000 (18:20 +0100)] 
smbd: Remove an unused parameter from defer_open()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Jan  3 01:30:24 UTC 2020 on sn-devel-184

6 years agosmbd: Avoid a "? True : False"
Volker Lendecke [Mon, 16 Dec 2019 15:47:38 +0000 (16:47 +0100)] 
smbd: Avoid a "? True : False"

VALID_STAT() already is a boolean expression

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
6 years agolsasd: Align integer types
Volker Lendecke [Sat, 7 Dec 2019 13:13:04 +0000 (14:13 +0100)] 
lsasd: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
6 years agodsdb: Align integer types
Volker Lendecke [Sun, 1 Dec 2019 15:21:12 +0000 (16:21 +0100)] 
dsdb: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
6 years agoaudit_log: Align integer types
Volker Lendecke [Sun, 1 Dec 2019 15:10:18 +0000 (16:10 +0100)] 
audit_log: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
6 years agontlm_auth: Fix a DEBUG message
Volker Lendecke [Mon, 30 Dec 2019 12:56:14 +0000 (13:56 +0100)] 
ntlm_auth: Fix a DEBUG message

This is not routine auth_generic_prepare

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
6 years agolib: Remove an unused variable from security_token_debug()
Volker Lendecke [Thu, 2 Jan 2020 10:15:48 +0000 (11:15 +0100)] 
lib: Remove an unused variable from security_token_debug()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
6 years agoctdb-tests: Skip some tests that don't work with IPv6
Martin Schwenke [Thu, 28 Nov 2019 03:00:58 +0000 (14:00 +1100)] 
ctdb-tests: Skip some tests that don't work with IPv6

See the comments added to the tests.

It may be possible to rewrite these so they do something sane for
IPv6... some other time.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Jan  3 00:00:55 UTC 2020 on sn-devel-184

6 years agoctdb-scripts: Strip square brackets when gathering connection info
Martin Schwenke [Fri, 13 Dec 2019 00:09:04 +0000 (11:09 +1100)] 
ctdb-scripts: Strip square brackets when gathering connection info

ss added square brackets around IPv6 addresses in versions > 4.12.0
via commit aba9c23a6e1cb134840c998df14888dca469a485.  CentOS 7 added
this feature somewhere mid-release.  So, backward compatibility is
obviously needed.

As per the comment protocol/protocol_util.c should probably print and
parse such square brackets.  However, for backward compatibility the
brackets would have to be stripped in both places in
update_tickles()...  or added to the ss output when missing.  Best to
leave this until we have a connection tracking daemon.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoHappy New Year 2020!
Stefan Metzmacher [Wed, 1 Jan 2020 09:05:07 +0000 (10:05 +0100)] 
Happy New Year 2020!

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jan  1 12:04:52 UTC 2020 on sn-devel-184

6 years agolib: Fix contending with a READ lock
Volker Lendecke [Fri, 20 Dec 2019 15:20:00 +0000 (16:20 +0100)] 
lib: Fix contending with a READ lock

When contending a WRITE with an existing READ, the contender puts
himself into the exclusive slot, waiting for the READers to go
away. If the async lock request is canceled before we got the lock, we
need to remove ourselves again. This is done in the destructor of the
g_lock_lock_state. In the successful case, the destructor needs to go
away.

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): Sun Dec 22 18:57:17 UTC 2019 on sn-devel-184

6 years agotorture3: Add a test that contends with a READ, not a WRITE lock
Volker Lendecke [Sun, 22 Dec 2019 13:05:17 +0000 (14:05 +0100)] 
torture3: Add a test that contends with a READ, not a WRITE lock

This walks different code paths in the subsequent locker. And the one
that we did not test so far is in fact buggy

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agotorture3: Parametrize lock4_child()s locktype
Volker Lendecke [Sun, 22 Dec 2019 13:01:07 +0000 (14:01 +0100)] 
torture3: Parametrize lock4_child()s locktype

We'll call it twice soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agotorture3: Introduce "key" helper variable
Volker Lendecke [Sat, 21 Dec 2019 09:47:37 +0000 (10:47 +0100)] 
torture3: Introduce "key" helper variable

Call string_term_tdb_data() once instead of three times

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_zfsacl: fix issue with ACL inheritance in zfsacl
awalker [Fri, 30 Aug 2019 19:30:57 +0000 (15:30 -0400)] 
vfs_zfsacl: fix issue with ACL inheritance in zfsacl

Add parameter zfsacl:map_dacl_protected to address issue preventing Windows Clients
from disabling inheritance on ACLs. FreeBSD does not currently expose the ACL_PROTECTED
NFS4.1 flag, but it does expose ACE4_INHERITED_ACE. When the parameter is enabled,
map the absence of ACE4_INHERITED_ACE to SEC_DESC_DACL_PROTECTED.

See also the discussion at

https://gitlab.com/samba-team/samba/merge_requests/719

Signed-off-by: Andrew Walker <awalker@ixsystems.com>
Reviewed-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 Dec 20 23:24:54 UTC 2019 on sn-devel-184

6 years agovfs_zfsacl: pass config to zfs_get_nt_acl_common()
Ralph Boehme [Sat, 19 Oct 2019 13:37:45 +0000 (15:37 +0200)] 
vfs_zfsacl: pass config to zfs_get_nt_acl_common()

Not used for now, that comes next.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Walker <awalker@ixsystems.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_zfsacl: pass nfs4_params to smb_set_nt_acl_nfs4()
Ralph Boehme [Sat, 19 Oct 2019 13:36:15 +0000 (15:36 +0200)] 
vfs_zfsacl: pass nfs4_params to smb_set_nt_acl_nfs4()

Now that we parse nfs4_params in the VFS connect in this module, we can pass it
to smb_set_nt_acl_nfs4() which avoids having smb_set_nt_acl_nfs4() parse
it *every time* it's called.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Walker <awalker@ixsystems.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agovfs_zfsacl: add manpage entry for zfsacl:denymissingspecial
awalker [Fri, 30 Aug 2019 19:17:26 +0000 (15:17 -0400)] 
vfs_zfsacl: add manpage entry for zfsacl:denymissingspecial

Signed-off-by: Andrew Walker <awalker@ixsystems.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>