samba.git
4 years agolib: Add g_lock_seqnum()
Volker Lendecke [Tue, 5 Nov 2019 15:36:59 +0000 (16:36 +0100)]
lib: Add g_lock_seqnum()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib: Add g_lock_wake_watchers()
Volker Lendecke [Mon, 4 Nov 2019 15:03:52 +0000 (16:03 +0100)]
lib: Add g_lock_wake_watchers()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agotorture: Test g_lock_watch_data_send()/recv()
Volker Lendecke [Thu, 31 Oct 2019 10:45:36 +0000 (11:45 +0100)]
torture: Test g_lock_watch_data_send()/recv()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib: Add g_lock_watch_data_send/recv()
Volker Lendecke [Wed, 30 Oct 2019 15:12:11 +0000 (16:12 +0100)]
lib: Add g_lock_watch_data_send/recv()

Same concept as dbwrap_watched_watch_send/recv: Get informed if the
underlying data of a record changes. This utilizes the watched
database that g_lock is based upon anyway. To avoid spurious wakeups
by pure g_lock operations this patch adds a sequence number for the
data that is stored in the g_lock data field.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib: Allow DBWRAP_LOCK_ORDER_NONE in db_open()
Volker Lendecke [Thu, 21 Nov 2019 14:20:33 +0000 (15:20 +0100)]
lib: Allow DBWRAP_LOCK_ORDER_NONE in db_open()

locking.tdb will not have a LOCK_ORDER anymore, this will be done by
the code in g_lock.c. We need to allow opening a database with dbwrap
without having a lock order.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agodbwrap: Make dbwrap_lock_order_[un]lock() public
Volker Lendecke [Thu, 21 Nov 2019 14:19:16 +0000 (15:19 +0100)]
dbwrap: Make dbwrap_lock_order_[un]lock() public

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agodbwrap: Simplify dbwrap_lock_order_[un]lock()
Volker Lendecke [Thu, 21 Nov 2019 12:23:39 +0000 (13:23 +0100)]
dbwrap: Simplify dbwrap_lock_order_[un]lock()

Directly pass the database name and lock order to the core functions,
avoid passing struct db_context.

In the next steps these functions will become public: locking.tdb will
be based on g_lock.c to avoid holding a tdb-level locking.tdb mutex
while doing complex file system operations like unlink() which can
take ages on FAT for example.

This means that g_lock.c will participate in the dbwrap lock order
protection and needs access to dbwrap_lock_order_[un]lock() without
providing a direct db_context.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosrvsvc: Move brl_get_locks() out of enum_file_fn()
Volker Lendecke [Tue, 21 Apr 2020 12:54:25 +0000 (14:54 +0200)]
srvsvc: Move brl_get_locks() out of enum_file_fn()

With share_infos.tdb this is a locking order violation:
share_infos.tdb is level 4, brlock.tdb is level 2. Avoid this by first
walking the share_infos.tdb and then fetching all the brlock entries.

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu May 14 22:06:32 UTC 2020 on sn-devel-184

4 years agotest: Show that netfileenum is broken
Volker Lendecke [Mon, 11 May 2020 09:08:54 +0000 (11:08 +0200)]
test: Show that netfileenum is broken

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agorpcclient: Make netfileenum cmd print the path names
Volker Lendecke [Mon, 11 May 2020 09:09:02 +0000 (11:09 +0200)]
rpcclient: Make netfileenum cmd print the path names

Needed for the next commit testing netfileenum

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agorpcclient: Use struct initializers in cmd_srvsvc_net_file_enum()
Volker Lendecke [Wed, 22 Apr 2020 11:21:40 +0000 (13:21 +0200)]
rpcclient: Use struct initializers in cmd_srvsvc_net_file_enum()

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agosrvsvc: Collect file ids in enum_file_fn()
Volker Lendecke [Tue, 21 Apr 2020 12:32:16 +0000 (14:32 +0200)]
srvsvc: Collect file ids in enum_file_fn()

Will be used a few patches down

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agosrvsvc: Use a struct initializer in net_enum_files()
Volker Lendecke [Tue, 21 Apr 2020 12:42:50 +0000 (14:42 +0200)]
srvsvc: Use a struct initializer in net_enum_files()

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agosrvsvc: Directly use "ctr3->count" instead of "i"
Volker Lendecke [Tue, 21 Apr 2020 12:24:48 +0000 (14:24 +0200)]
srvsvc: Directly use "ctr3->count" instead of "i"

To me this was not very transparent, and now that we have "ctr3" a
single indirect looks okay

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agosrvsvc: Use a struct assignment in enum_file_fn()
Volker Lendecke [Tue, 21 Apr 2020 12:21:49 +0000 (14:21 +0200)]
srvsvc: Use a struct assignment in enum_file_fn()

Looks nicer than 5 complex array references...

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agosrvsvc: Introduce ctx3 helper var in enum_file_fn()
Volker Lendecke [Tue, 21 Apr 2020 12:16:41 +0000 (14:16 +0200)]
srvsvc: Introduce ctx3 helper var in enum_file_fn()

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agovfs: remove root_dir_fid arg from SMB_VFS_CREATE_FILE()
Ralph Boehme [Thu, 14 May 2020 13:59:33 +0000 (15:59 +0200)]
vfs: remove root_dir_fid arg from SMB_VFS_CREATE_FILE()

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 May 14 19:43:27 UTC 2020 on sn-devel-184

4 years agosmbd: move processing of root_dir_fid outside of SMB_VFS_CREATE_FILE()
Ralph Boehme [Thu, 14 May 2020 11:42:05 +0000 (13:42 +0200)]
smbd: move processing of root_dir_fid outside of SMB_VFS_CREATE_FILE()

The only two callers that pass a root_dir_fid != 0 are reply_ntcreate_and_X()
and call_nt_transact_create(). By moving root_dir_fid processing outside of
SMB_VFS_CREATE_FILE() we can avoid rewriting get_relative_fid_filename() to work
with *AT semantics and dirfsps.

Bonus points: the previous code in both functions passed fname to
filename_convert() which can't really have worked as it is relative to
root_dir_fid so filename_convert() will not be able to stat() the relative path
and it's components.

The only test I can find that uses a root dir_fid is raw.samba3rootdirfid and
that uses a handle on the share root which will work.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos4/torture: add a *real* root_dir_fid test
Ralph Boehme [Thu, 14 May 2020 12:22:16 +0000 (14:22 +0200)]
s4/torture: add a *real* root_dir_fid test

raw.samba3rootdirfid tests with the share root directory as root_dir_fid handle,
that doesn't cover the case where the relative name has more then one path
component. It only works because in unix_convert() we run into the creating file
optimasation.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agotestprogs: Add 'net ads join' test for fips
Andreas Schneider [Wed, 13 May 2020 14:33:14 +0000 (16:33 +0200)]
testprogs: Add 'net ads join' test for fips

Signed-off-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 May 14 14:27:26 UTC 2020 on sn-devel-184

4 years agolib:param: Fix memory leak in lpcfg_load_internal()
awalker [Mon, 6 Apr 2020 19:50:41 +0000 (15:50 -0400)]
lib:param: Fix memory leak in lpcfg_load_internal()

Signed-off-by: awalker <awalker@ixsystems.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed May 13 17:34:43 UTC 2020 on sn-devel-184

4 years agoctdb: increase TasksMax limit, the systemd default is just 512
Ralph Boehme [Tue, 12 May 2020 13:30:05 +0000 (15:30 +0200)]
ctdb: increase TasksMax limit, the systemd default is just 512

In 2015 systemd introduced a TasksMax which limits the number of processes in a
unit:

https://lists.freedesktop.org/archives/systemd-devel/2015-November/035006.html

The default of 512 may be too low in certain situations leading to vfork()
failing with errno=EAGAIN when trying to spawn lock-helper processes.

With the default for LockProcessesPerDB being 200 the increased TasksMax limit
should cover the problematic scenario.

Additional background: the failing vfork()s have been seen on production
clusters and were tracked down to being logged in the context of ctdb calling
tdb_repack().

Links:

https://github.com/systemd/systemd/commit/9ded9cd14cc03c67291b10a5c42ce5094ba0912f
https://www.suse.com/support/kb/doc/?id=000015901
https://success.docker.com/article/how-to-reserve-resource-temporarily-unavailable-errors-due-to-tasksmax-setting
https://www.percona.com/blog/2019/01/02/tasksmax-another-setting-that-can-cause-mysql-error-messages/

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed May 13 13:30:12 UTC 2020 on sn-devel-184

4 years agos3: libsmbclient: Finish unifing bad iconv behavior across CORE NT1 SMB2 protocols.
Jeremy Allison [Mon, 11 May 2020 22:58:27 +0000 (15:58 -0700)]
s3: libsmbclient: Finish unifing bad iconv behavior across CORE NT1 SMB2 protocols.

On bad name conversion, exit the directory listing with an error, but leave the
connection intact. We were already checking for finfo->name == NULL here,
but were ignoring it and not reporting an error.

Remove the knownfail.d/bad_iconv file as we now
behave the same across CORE/NT1/SMB2.

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

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 May 12 21:32:44 UTC 2020 on sn-devel-184

4 years agos3: libsmb: In SMB2 return NT_STATUS_INVALID_NETWORK_RESPONSE if name conversion...
Jeremy Allison [Mon, 11 May 2020 19:23:49 +0000 (12:23 -0700)]
s3: libsmb: In SMB2 return NT_STATUS_INVALID_NETWORK_RESPONSE if name conversion ended up with a NULL filename.

Can happen if namelen == 0.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: libsmb: In SMB1 old protocol - return NT_STATUS_INVALID_NETWORK_RESPONSE if name...
Jeremy Allison [Mon, 11 May 2020 19:34:10 +0000 (12:34 -0700)]
s3: libsmb: In SMB1 old protocol - return NT_STATUS_INVALID_NETWORK_RESPONSE if name conversion ended up with a NULL filename.

Can happen if namelen == 0.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: selftest: Add test_smbclient_iconv.sh to check client behavior on bad name conver...
Jeremy Allison [Mon, 11 May 2020 22:37:00 +0000 (15:37 -0700)]
s3: selftest: Add test_smbclient_iconv.sh to check client behavior on bad name conversion.

SMB2 and NT1 fail this, CORE already returns NT_STATUS_INVALID_NETWORK_RESPONSE
on bad conversion.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: selftest: Add share definition [bad_iconv] in fileserver.
Jeremy Allison [Mon, 11 May 2020 21:10:54 +0000 (14:10 -0700)]
s3: selftest: Add share definition [bad_iconv] in fileserver.

Creates a utf8 valid filename within that is invalid in CP850.
Useful to test smbclient list directory character set conversions.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agovfs_io_uring: retry after a short writes in vfs_io_uring_pwrite_completion()
Stefan Metzmacher [Fri, 8 May 2020 11:30:17 +0000 (13:30 +0200)]
vfs_io_uring: retry after a short writes in vfs_io_uring_pwrite_completion()

We need to be prepared for short writes from the kernel depending on
the state of the page cache.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_io_uring: retry after a short read in vfs_io_uring_pread_completion()
Stefan Metzmacher [Fri, 8 May 2020 11:30:17 +0000 (13:30 +0200)]
vfs_io_uring: retry after a short read in vfs_io_uring_pread_completion()

We need to be prepared for short reads from the kernel depending on
the state of the page cache. Windows and Mac clients don't
expect short reads for files, so we need to retry ourself.

For the future we may be able to play with some io_uring flags
in order to avoid the retries in userspace, but for now we just fix
the data corruption bug...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_io_uring: protect vfs_io_uring_fsync_completion() against invalid results
Stefan Metzmacher [Fri, 8 May 2020 09:38:56 +0000 (11:38 +0200)]
vfs_io_uring: protect vfs_io_uring_fsync_completion() against invalid results

We should never get back a value > 0.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_io_uring: protect vfs_io_uring_pwrite_completion() against invalid results
Stefan Metzmacher [Fri, 8 May 2020 09:38:56 +0000 (11:38 +0200)]
vfs_io_uring: protect vfs_io_uring_pwrite_completion() against invalid results

We should never get more acked than we asked for.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_io_uring: protect vfs_io_uring_pread_completion() against invalid results
Stefan Metzmacher [Fri, 8 May 2020 09:38:56 +0000 (11:38 +0200)]
vfs_io_uring: protect vfs_io_uring_pread_completion() against invalid results

We should never get back more than we asked for.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_io_uring: split out a vfs_io_uring_pwrite_submit() function
Stefan Metzmacher [Fri, 8 May 2020 09:17:51 +0000 (11:17 +0200)]
vfs_io_uring: split out a vfs_io_uring_pwrite_submit() function

This can be reused when we add handling for short writes.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_io_uring: split out a vfs_io_uring_pread_submit() function
Stefan Metzmacher [Fri, 8 May 2020 09:17:51 +0000 (11:17 +0200)]
vfs_io_uring: split out a vfs_io_uring_pread_submit() function

This can be reused when we add handling for short reads.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_io_uring: split out a vfs_io_uring_request_submit() function
Stefan Metzmacher [Fri, 8 May 2020 09:17:51 +0000 (11:17 +0200)]
vfs_io_uring: split out a vfs_io_uring_request_submit() function

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_io_uring: avoid stack recursion of vfs_io_uring_queue_run()
Stefan Metzmacher [Fri, 8 May 2020 19:29:53 +0000 (21:29 +0200)]
vfs_io_uring: avoid stack recursion of vfs_io_uring_queue_run()

Instead we remember if recursion was triggered and jump to
the start of the function again from the end.

This should make it safe to be called from the completion_fn().

This is hideously complex stuff, so document the hell
out of it.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_io_uring: make use of sys_valid_io_range() in vfs_io_uring_pwrite_send()
Stefan Metzmacher [Fri, 8 May 2020 11:17:05 +0000 (13:17 +0200)]
vfs_io_uring: make use of sys_valid_io_range() in vfs_io_uring_pwrite_send()

This makes the follow up commits easier as we don't have to care
about overflows.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_io_uring: make use of sys_valid_io_range() in vfs_io_uring_pread_send()
Stefan Metzmacher [Fri, 8 May 2020 11:17:05 +0000 (13:17 +0200)]
vfs_io_uring: make use of sys_valid_io_range() in vfs_io_uring_pread_send()

This makes the follow up commits easier as we don't have to care
about overflows.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_io_uring: move error handling out of vfs_io_uring_fsync_recv()
Stefan Metzmacher [Fri, 8 May 2020 08:52:52 +0000 (10:52 +0200)]
vfs_io_uring: move error handling out of vfs_io_uring_fsync_recv()

We should do that as early as possible and that's in
vfs_io_uring_fsync_completion().

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_io_uring: move error handling out of vfs_io_uring_pwrite_recv()
Stefan Metzmacher [Fri, 8 May 2020 08:52:52 +0000 (10:52 +0200)]
vfs_io_uring: move error handling out of vfs_io_uring_pwrite_recv()

We should do that as early as possible and that's in
vfs_io_uring_pwrite_completion().

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_io_uring: move error handling out of vfs_io_uring_pread_recv()
Stefan Metzmacher [Fri, 8 May 2020 08:52:52 +0000 (10:52 +0200)]
vfs_io_uring: move error handling out of vfs_io_uring_pread_recv()

We should do that as early as possible and that's in
vfs_io_uring_pread_completion().

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_io_uring: introduce vfs_io_uring_request->completion_fn()
Stefan Metzmacher [Fri, 8 May 2020 08:42:59 +0000 (10:42 +0200)]
vfs_io_uring: introduce vfs_io_uring_request->completion_fn()

We'll need to add more logic than a simple _tevent_req_done()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_io_uring: replace vfs_io_uring_request->state with _tevent_req_data()
Stefan Metzmacher [Fri, 8 May 2020 08:39:52 +0000 (10:39 +0200)]
vfs_io_uring: replace vfs_io_uring_request->state with _tevent_req_data()

We don't need a direct pointer to the state...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_io_uring: fix the prefix for parametric options from 'vfs_io_uring' to 'io_uring'
Stefan Metzmacher [Wed, 6 May 2020 10:05:47 +0000 (03:05 -0700)]
vfs_io_uring: fix the prefix for parametric options from 'vfs_io_uring' to 'io_uring'

This is what the manpage describes.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: VFS: default. Change pwrite() -> sys_pwrite_full() in SMB_VFS_PWRITE_SEND() to...
Jeremy Allison [Thu, 7 May 2020 19:48:49 +0000 (12:48 -0700)]
s3: VFS: default. Change pwrite() -> sys_pwrite_full() in SMB_VFS_PWRITE_SEND() to protect against short writes.

Note that as sys_pwrite_full() deals with the EINTR case
we can remove the do {} while loop here.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3: VFS: default. Change pread() -> sys_pread_full() in SMB_VFS_PREAD_SEND() to prote...
Jeremy Allison [Thu, 7 May 2020 19:45:10 +0000 (12:45 -0700)]
s3: VFS: default. Change pread() -> sys_pread_full() in SMB_VFS_PREAD_SEND() to protect against short reads.

Note that as sys_pread_full() deals with the EINTR case
we can remove the do {} while loop here.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3: VFS: default. Change sys_pwrite() -> sys_pwrite_full() in SMB_VFS_PWRITE() to...
Jeremy Allison [Thu, 7 May 2020 19:44:26 +0000 (12:44 -0700)]
s3: VFS: default. Change sys_pwrite() -> sys_pwrite_full() in SMB_VFS_PWRITE() to protect against short writes.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3: VFS: default. Change sys_pread() -> sys_pread_full() in SMB_VFS_PREAD() to protec...
Jeremy Allison [Thu, 7 May 2020 19:43:34 +0000 (12:43 -0700)]
s3: VFS: default. Change sys_pread() -> sys_pread_full() in SMB_VFS_PREAD() to protect against short reads.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3: VFS: aio_fork: Change sys_pwrite() -> sys_pwrite_full() to protect against short...
Jeremy Allison [Thu, 7 May 2020 19:42:53 +0000 (12:42 -0700)]
s3: VFS: aio_fork: Change sys_pwrite() -> sys_pwrite_full() to protect against short writes.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3: VFS: aio_fork: Change sys_pread() -> sys_pread_full() to protect against short...
Jeremy Allison [Thu, 7 May 2020 19:42:10 +0000 (12:42 -0700)]
s3: VFS: aio_fork: Change sys_pread() -> sys_pread_full() to protect against short reads.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agosmbd: add vfs_valid_{pread,pwrite}_range() checks where needed
Stefan Metzmacher [Mon, 11 May 2020 16:18:24 +0000 (18:18 +0200)]
smbd: add vfs_valid_{pread,pwrite}_range() checks where needed

I checked all callers of SMB_VFS_PWRITE[_SEND](),
all callers of SMB_VFS_PREAD[_SEND]() and also
places where we append to the file and allocate
more space.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:smbd: add vfs_valid_{pread,pwrite}_range() helper functions
Stefan Metzmacher [Mon, 11 May 2020 20:00:37 +0000 (22:00 +0200)]
s3:smbd: add vfs_valid_{pread,pwrite}_range() helper functions

These implement the SMB2 visible behavior of the [MS-FSA]
2.1.5.2 Server Requests a Read and 2.1.5.3 Server Requests a Write
constraints. Note that offset < 0 is not allowed over SMB.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:smbd: handle 0 length writes as no-op.
Stefan Metzmacher [Mon, 11 May 2020 16:18:24 +0000 (18:18 +0200)]
s3:smbd: handle 0 length writes as no-op.

They should never touch the SMB_VFS layer
and they never trigger an DISK_FULL error.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmb2_server: fix smbd_smb2_request_verify_sizes() for SMB2_OP_WRITE
Stefan Metzmacher [Mon, 11 May 2020 16:18:24 +0000 (18:18 +0200)]
smb2_server: fix smbd_smb2_request_verify_sizes() for SMB2_OP_WRITE

Writes with a length of 0 are allowed.

The readfile related check we had before was not really useful
as min_dyn_len can only every be 0 or 1 (and for SMB2_OP_WRITE it's
always 1). So we checked
  if (unread_bytes > 0) {
     if (unread_bytes < 1) {
       return error;
     }
  }

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib: util: Add sys_pwrite_full().
Jeremy Allison [Thu, 7 May 2020 19:34:32 +0000 (12:34 -0700)]
lib: util: Add sys_pwrite_full().

A pwrite wrapper that will deal with EINTR and never return a short
write unless the file system returns an error. Copes with the
unspecified edge condition of pwrite returning zero by changing
the return to -1, errno = ENOSPC.

Thread-safe so may be used as a replacement for pwrite
inside pwrite_do() thread functions.

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agolib: util: Add sys_pread_full().
Jeremy Allison [Thu, 7 May 2020 19:32:48 +0000 (12:32 -0700)]
lib: util: Add sys_pread_full().

A pread wrapper that will deal with EINTR and never return a short
read unless pread returns zero meaning EOF.

Thread-safe so may be used as a replacement for pread
inside pread_do() thread functions.

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agolib: util: Add sys_valid_io_range()
Stefan Metzmacher [Fri, 8 May 2020 11:06:54 +0000 (13:06 +0200)]
lib: util: Add sys_valid_io_range()

This implements the contraints of
[MS-FSA] 2.1.5.2 Server Requests a Read.

The special handling of [MS-FSA] 2.1.5.3 Server Requests a Write
with offset < 0, should be handled by higher layers!
Which means the check can also be used for writes.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos4:torture: add tests to test the SMB2 read/write offset/length boundaries
Stefan Metzmacher [Mon, 11 May 2020 10:37:41 +0000 (12:37 +0200)]
s4:torture: add tests to test the SMB2 read/write offset/length boundaries

[MS-FSA] 2.1.5.2 Server Requests a Read and
2.1.5.3 Server Requests a Write define some contraints.

These tests demonstrate that ((int64_t)offset) < 0) is
not allowed for both reads and writes for SMB.
Also the special case for writes at offset -2 is not possible
nor the append mode with offset < 0.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3/locking: prime flags in a fresh sharemode data object
Ralph Boehme [Mon, 11 May 2020 09:35:04 +0000 (11:35 +0200)]
s3/locking: prime flags in a fresh sharemode data object

This is needed to prime the logic in share_mode_flags_restrict() for the
following scenario:

* (First) CREATE on a file with FILE_SHARE_NONE and
  access_mask=FILE_READ_ATTRIBUTES (a stat-open).

* share_mode_flags_restrict() gets called with

    share_mode_flags_restrict(flags=0,
                              access_mask=0x80,
                              share_mode=0,
                              lease_type=UINT32_MAX)

  and returns a value where none of the FILE_SHARE_* flags is set.

As a result share_mode_data.flags doesn't reflect the share-modes in effect.

This doesn't change any current visible behaviour outside of open_mode_check(),
but it avoids calling share_mode_forall_entries() in open_mode_check_fn().

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

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 May 12 19:52:48 UTC 2020 on sn-devel-184

4 years agosmbd: fix for bug 14375
Ralph Boehme [Sat, 9 May 2020 13:13:54 +0000 (15:13 +0200)]
smbd: fix for bug 14375

... with many thanks to an enthusiastic Samba user from Poland for helping to
track this down.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agosmbd: make conflicting_access available to other functions
Ralph Boehme [Mon, 11 May 2020 11:42:39 +0000 (13:42 +0200)]
smbd: make conflicting_access available to other functions

The next commit adds more users of conflicting_access.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos4/torture: reproducer for bug 14375
Ralph Boehme [Sat, 9 May 2020 13:29:15 +0000 (15:29 +0200)]
s4/torture: reproducer for bug 14375

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agoselftest: split a knownfail entry
Ralph Boehme [Mon, 11 May 2020 13:56:58 +0000 (15:56 +0200)]
selftest: split a knownfail entry

Lists the two existing subtests indidivually in preparation of adding a third
that is going to pass against ad_dc_ntvfs.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agowinbind.service: drop quotes from $WINBINDOPTIONS variable
Marcos Mello [Fri, 8 May 2020 10:56:32 +0000 (07:56 -0300)]
winbind.service: drop quotes from $WINBINDOPTIONS variable

systemd parser splits arguments at whitespaces respecting quotes
when necessary.

Signed-off-by: Marcos Mello <marcosfrm@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue May 12 12:27:11 UTC 2020 on sn-devel-184

4 years agoDrop NotifyAccess=all from systemd units
Marcos Mello [Fri, 8 May 2020 10:44:51 +0000 (07:44 -0300)]
Drop NotifyAccess=all from systemd units

The implicit NotifyAccess=main is enough since Samba daemons do not
fork()/exit() anymore under systemd.

Signed-off-by: Marcos Mello <marcosfrm@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agolib ldb: Limit depth of ldb_parse_tree
Gary Lockyer [Tue, 21 Apr 2020 03:37:40 +0000 (15:37 +1200)]
lib ldb: Limit depth of ldb_parse_tree

Limit the number of nested conditionals allowed by ldb_parse tree to
128, to avoid potential stack overflow issues.

Credit Oss-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19508

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Sun May 10 23:21:08 UTC 2020 on sn-devel-184

4 years agolib util ASN.1: Panic on ASN.1 tag mismatch
Gary Lockyer [Tue, 28 Apr 2020 23:09:34 +0000 (11:09 +1200)]
lib util ASN.1: Panic on ASN.1 tag mismatch

If the ASN.1 depth is zero in asn1_end_tag, call smb_panic. Rather than
ignoring the condition.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4 cldap server tests: request size limit tests
Gary Lockyer [Tue, 28 Apr 2020 21:17:52 +0000 (09:17 +1200)]
s4 cldap server tests: request size limit tests

Add tests for packet size limits.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4 ldap server tests: request size limit tests
Gary Lockyer [Tue, 28 Apr 2020 01:55:04 +0000 (13:55 +1200)]
s4 ldap server tests: request size limit tests

Extra tests for ldap maximum request size limits.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoFix clang 9 for-loop-analysis warnings
Gary Lockyer [Mon, 4 May 2020 23:42:28 +0000 (11:42 +1200)]
Fix clang 9 for-loop-analysis warnings

Review-note: The for loop increment operation was changed and the
             trailing i++ was removed from the loop body.
             The resulting for statement is equivalent to the original

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri May  8 11:16:18 UTC 2020 on sn-devel-184

4 years agoFix clang 9 format-nonliteral warnings
Gary Lockyer [Tue, 5 May 2020 01:48:10 +0000 (13:48 +1200)]
Fix clang 9 format-nonliteral warnings

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agoFix clang 9 missing-field-initializer warnings
Gary Lockyer [Tue, 5 May 2020 01:47:39 +0000 (13:47 +1200)]
Fix clang 9 missing-field-initializer warnings

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agoFix clang 9 unused-function warnings
Gary Lockyer [Fri, 1 May 2020 03:03:10 +0000 (15:03 +1200)]
Fix clang 9 unused-function warnings

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agoFix clang 9 enum-conversion warnings
Gary Lockyer [Thu, 30 Apr 2020 23:58:52 +0000 (11:58 +1200)]
Fix clang 9 enum-conversion warnings

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agoFix clang 9 constant-conversion warnings
Gary Lockyer [Thu, 30 Apr 2020 23:41:08 +0000 (11:41 +1200)]
Fix clang 9 constant-conversion warnings

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agoFix clang 9 logical-not-parentheses warnings
Gary Lockyer [Thu, 30 Apr 2020 23:17:04 +0000 (11:17 +1200)]
Fix clang 9 logical-not-parentheses warnings

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agoFix clang 9 parentheses-equality warnings
Gary Lockyer [Thu, 30 Apr 2020 22:42:03 +0000 (10:42 +1200)]
Fix clang 9 parentheses-equality warnings

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agobuild: Allow developer builds with clang 9
Gary Lockyer [Thu, 30 Apr 2020 21:55:03 +0000 (09:55 +1200)]
build: Allow developer builds with clang 9

Disable clang warnings to allow samba to be compiled with clang 9.

Subsequent commits will fix offending code and re-enable the warnings.

However fixing cast-align warnings has been left for later.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: VFS: Complete the replacement of SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT().
Jeremy Allison [Tue, 14 Apr 2020 17:27:46 +0000 (10:27 -0700)]
s3: VFS: Complete the replacement of SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May  7 21:04:59 UTC 2020 on sn-devel-184

4 years agos3: VFS: full_audit. Remove get_nt_acl_fn().
Jeremy Allison [Tue, 14 Apr 2020 17:20:10 +0000 (10:20 -0700)]
s3: VFS: full_audit. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: time_audit. Remove get_nt_acl_fn().
Jeremy Allison [Tue, 14 Apr 2020 17:19:05 +0000 (10:19 -0700)]
s3: VFS: time_audit. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: unityed_media. Remove get_nt_acl_fn().
Jeremy Allison [Tue, 14 Apr 2020 17:18:11 +0000 (10:18 -0700)]
s3: VFS: unityed_media. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: zfsacl. Remove get_nt_acl_fn().
Jeremy Allison [Tue, 14 Apr 2020 17:17:15 +0000 (10:17 -0700)]
s3: VFS: zfsacl. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: snapper. Remove get_nt_acl_fn().
Jeremy Allison [Tue, 14 Apr 2020 17:16:21 +0000 (10:16 -0700)]
s3: VFS: snapper. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: shadow_copy2. Remove get_nt_acl_fn().
Jeremy Allison [Tue, 14 Apr 2020 17:15:10 +0000 (10:15 -0700)]
s3: VFS: shadow_copy2. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: nfs4acl_xattr. Remove get_nt_acl_fn().
Jeremy Allison [Tue, 14 Apr 2020 17:13:52 +0000 (10:13 -0700)]
s3: VFS: nfs4acl_xattr. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: media_harmony. Remove get_nt_acl_fn().
Jeremy Allison [Tue, 14 Apr 2020 17:12:42 +0000 (10:12 -0700)]
s3: VFS: media_harmony. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: gpfs. Remove get_nt_acl_fn().
Jeremy Allison [Tue, 14 Apr 2020 17:11:44 +0000 (10:11 -0700)]
s3: VFS: gpfs. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: glusterfs. Remove NULL definition of get_nt_acl_fn().
Jeremy Allison [Tue, 14 Apr 2020 17:10:37 +0000 (10:10 -0700)]
s3: VFS: glusterfs. Remove NULL definition of get_nt_acl_fn().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: ceph_snapshots. Remove get_nt_acl_fn().
Jeremy Allison [Tue, 14 Apr 2020 17:09:33 +0000 (10:09 -0700)]
s3: VFS: ceph_snapshots. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: catia. Remove get_nt_acl_fn().
Jeremy Allison [Tue, 14 Apr 2020 17:08:27 +0000 (10:08 -0700)]
s3: VFS: catia. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: aixacl2. Remove get_nt_acl_fn().
Jeremy Allison [Tue, 14 Apr 2020 17:07:23 +0000 (10:07 -0700)]
s3: VFS: aixacl2. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: afsacl. Remove get_nt_acl_fn().
Jeremy Allison [Tue, 14 Apr 2020 17:06:22 +0000 (10:06 -0700)]
s3: VFS: afsacl. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: acl_xattr. Remove get_nt_acl_fn().
Jeremy Allison [Tue, 14 Apr 2020 17:05:21 +0000 (10:05 -0700)]
s3: VFS: acl_xattr. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: acl_tdb. Remove get_nt_acl_fn().
Jeremy Allison [Tue, 14 Apr 2020 17:04:13 +0000 (10:04 -0700)]
s3: VFS: acl_tdb. Remove get_nt_acl_fn().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: streams_xattr. Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in...
Jeremy Allison [Tue, 14 Apr 2020 21:18:00 +0000 (14:18 -0700)]
s3: VFS: streams_xattr. Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in streams_xattr_fget_nt_acl() fallback.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: acl_common: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in get_nt...
Jeremy Allison [Tue, 14 Apr 2020 19:48:29 +0000 (12:48 -0700)]
s3: VFS: acl_common: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in get_nt_acl_common_at().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: acl_common. s3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT...
Jeremy Allison [Tue, 14 Apr 2020 19:46:38 +0000 (12:46 -0700)]
s3: VFS: acl_common. s3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in validate_nt_acl_blob().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in inherit_new_acl().
Jeremy Allison [Tue, 14 Apr 2020 04:29:31 +0000 (21:29 -0700)]
s3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in inherit_new_acl().

Hard code at conn->cwd_fsp for now.

Last user of SMB_VFS_GET_NT_ACL(). This VFS function can
now be removed.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in smbd_calculate_ma...
Jeremy Allison [Tue, 14 Apr 2020 04:28:47 +0000 (21:28 -0700)]
s3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in smbd_calculate_maximum_allowed_access().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>