bbaumbach/samba-autobuild/.git
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>
4 years agos3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in smbd_check_access...
Jeremy Allison [Tue, 14 Apr 2020 04:27:34 +0000 (21:27 -0700)]
s3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in smbd_check_access_rights().

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_check_access...
Jeremy Allison [Tue, 14 Apr 2020 04:26:29 +0000 (21:26 -0700)]
s3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in smbd_check_access_rights().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: pysmbd. Change SMB_VFS_GET_NT_ACL() to SMB_VFS_GET_NT_ACL_AT() in get_nt_acl_conn().
Jeremy Allison [Mon, 13 Apr 2020 22:28:01 +0000 (15:28 -0700)]
s3: pysmbd. Change SMB_VFS_GET_NT_ACL() to SMB_VFS_GET_NT_ACL_AT() in get_nt_acl_conn().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: torture: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in cmd_get_nt_acl().
Jeremy Allison [Mon, 13 Apr 2020 22:26:05 +0000 (15:26 -0700)]
s3: torture: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in cmd_get_nt_acl().

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 directory_has_def...
Jeremy Allison [Mon, 13 Apr 2020 22:24:07 +0000 (15:24 -0700)]
s3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in directory_has_default_acl().

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 get_nt_acl_no_snum().
Jeremy Allison [Mon, 13 Apr 2020 22:22:30 +0000 (15:22 -0700)]
s3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in get_nt_acl_no_snum().

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 user_can_read_file().
Jeremy Allison [Mon, 13 Apr 2020 22:01:35 +0000 (15:01 -0700)]
s3: smbd: Change SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT() in user_can_read_file().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: zfsacl. Add zfsacl_get_nt_acl_at().
Jeremy Allison [Mon, 13 Apr 2020 21:15:44 +0000 (14:15 -0700)]
s3: VFS: zfsacl. Add zfsacl_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: unityed_media. Add um_get_nt_acl_at().
Jeremy Allison [Mon, 13 Apr 2020 21:12:58 +0000 (14:12 -0700)]
s3: VFS: unityed_media. Add um_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: snapper. Add snapper_gmt_get_nt_acl_at().
Jeremy Allison [Mon, 13 Apr 2020 21:09:24 +0000 (14:09 -0700)]
s3: VFS: snapper. Add snapper_gmt_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: shadow_copy2. Add shadow_copy2_get_nt_acl_at().
Jeremy Allison [Mon, 13 Apr 2020 21:05:03 +0000 (14:05 -0700)]
s3: VFS: shadow_copy2. Add shadow_copy2_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs4acl_xattr: Add nfs4acl_xattr_get_nt_acl_at().
Jeremy Allison [Mon, 13 Apr 2020 21:04:28 +0000 (14:04 -0700)]
s3: VFS: vfs4acl_xattr: Add nfs4acl_xattr_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: media_harmony: Add mh_get_nt_acl_at().
Jeremy Allison [Mon, 13 Apr 2020 20:59:06 +0000 (13:59 -0700)]
s3: VFS: media_harmony: Add mh_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: gpfs. Add gpfsacl_get_nt_acl_at().
Jeremy Allison [Mon, 13 Apr 2020 20:54:03 +0000 (13:54 -0700)]
s3: VFS: gpfs. Add gpfsacl_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: Add null notice of get_nt_acl_at_fn().
Jeremy Allison [Mon, 13 Apr 2020 20:50:30 +0000 (13:50 -0700)]
s3: VFS: Add null notice of get_nt_acl_at_fn().

Not strictly needed but glusterfs seems to use
this as a reminder that these functions are not
implemented but pass down to the default.

I'll remove all these when I remove get_nt_acl_fn()
completely.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: ceph_snapshots. Add ceph_snap_gmt_get_nt_acl_at().
Jeremy Allison [Mon, 13 Apr 2020 20:49:36 +0000 (13:49 -0700)]
s3: VFS: ceph_snapshots. Add ceph_snap_gmt_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: catia. Add catia_get_nt_acl_at().
Jeremy Allison [Mon, 13 Apr 2020 20:46:44 +0000 (13:46 -0700)]
s3: VFS: catia. Add catia_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: aixacl2: Add aixjfs2_get_nt_acl_at().
Jeremy Allison [Mon, 13 Apr 2020 20:41:57 +0000 (13:41 -0700)]
s3: VFS: aixacl2: Add aixjfs2_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: afsacl. Add afsacl_get_nt_acl_at().
Jeremy Allison [Mon, 13 Apr 2020 20:39:03 +0000 (13:39 -0700)]
s3: VFS: afsacl. Add afsacl_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: acl_tdb. Add acl_tdb_get_nt_acl().
Jeremy Allison [Mon, 13 Apr 2020 20:33:44 +0000 (13:33 -0700)]
s3: VFS: acl_tdb. Add acl_tdb_get_nt_acl().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: acl_xattr: Add acl_xattr_get_nt_acl_at().
Jeremy Allison [Mon, 13 Apr 2020 20:32:07 +0000 (13:32 -0700)]
s3: VFS: acl_xattr: Add acl_xattr_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: full_audit. Add smb_full_audit_get_nt_acl_at().
Jeremy Allison [Mon, 13 Apr 2020 21:20:54 +0000 (14:20 -0700)]
s3: VFS: full_audit. Add smb_full_audit_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: time_audit. Add smb_time_audit_get_nt_acl_at().
Jeremy Allison [Mon, 13 Apr 2020 21:17:53 +0000 (14:17 -0700)]
s3: VFS: time_audit. Add smb_time_audit_get_nt_acl_at().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: Add SMB_VFS_GET_NT_ACL_AT().
Jeremy Allison [Fri, 10 Apr 2020 00:35:49 +0000 (17:35 -0700)]
s3: VFS: Add SMB_VFS_GET_NT_ACL_AT().

Currently identical to SMB_VFS_GET_NT_ACL().

Next, add to all VFS modules that implement
get_nt_acl and eventually remove get_nt_acl.

NB. Modules that use smb_vfs_assert_all_fns()
have SMB_VFS_GET_NT_ACL_AT() will not build
until they have this function added.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: acl_common: Add a dirfsp parameter to validate_nt_acl_blob().
Jeremy Allison [Tue, 14 Apr 2020 19:43:51 +0000 (12:43 -0700)]
s3: VFS: acl_common: Add a dirfsp parameter to validate_nt_acl_blob().

This sucks, as it's the only function that I've been
unable to easily split into a _fsp and a _pathname version,
it just does too much. Bite the bullet and add a dirfsp
parameter as well as the fsp and smb_fname parameters.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_common and callers. Change get_nt_acl_common() -> get_nt_acl_common_at().
Jeremy Allison [Mon, 13 Apr 2020 20:29:48 +0000 (13:29 -0700)]
s3: VFS: vfs_common and callers. Change get_nt_acl_common() -> get_nt_acl_common_at().

Add in the dirfsp parameter. Fix all callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_acl_common: Remove unused stat_fsp_or_smb_fname().
Jeremy Allison [Mon, 13 Apr 2020 19:54:57 +0000 (12:54 -0700)]
s3: VFS: vfs_acl_common: Remove unused stat_fsp_or_smb_fname().

Done separately to minimize the diff in the previous patch.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: ACLs. Remove smb_fname argument to get_nt_acl_common().
Jeremy Allison [Mon, 13 Apr 2020 19:53:58 +0000 (12:53 -0700)]
s3: VFS: ACLs. Remove smb_fname argument to get_nt_acl_common().

As a bonus stat_fsp_or_smb_fname() is no longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: acl_xattr: Change acl_xattr_fget_nt_acl() to use fget_nt_acl_common().
Jeremy Allison [Mon, 13 Apr 2020 19:42:49 +0000 (12:42 -0700)]
s3: VFS: acl_xattr: Change acl_xattr_fget_nt_acl() to use fget_nt_acl_common().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: acl_tdb: Change acl_tdb_fget_nt_acl() to use fget_nt_acl_common().
Jeremy Allison [Mon, 13 Apr 2020 19:41:31 +0000 (12:41 -0700)]
s3: VFS: acl_tdb: Change acl_tdb_fget_nt_acl() to use fget_nt_acl_common().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: ACLs. Switch fset_nt_acl_common() over to using fget_acl_blob_fn().
Jeremy Allison [Mon, 13 Apr 2020 19:29:22 +0000 (12:29 -0700)]
s3: VFS: ACLs. Switch fset_nt_acl_common() over to using fget_acl_blob_fn().

Removes passing in smb_fname to fsp functions.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: acl_xattr.c: Add fget_acl_blob().
Jeremy Allison [Mon, 13 Apr 2020 19:24:14 +0000 (12:24 -0700)]
s3: VFS: acl_xattr.c: Add fget_acl_blob().

Separate from get_acl_blob() which took both an fsp and a pathname.
Commented out so we still compile.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: acl_tdb.c: Add fget_acl_blob().
Jeremy Allison [Mon, 13 Apr 2020 19:19:03 +0000 (12:19 -0700)]
s3: VFS: acl_tdb.c: Add fget_acl_blob().

Separate from get_acl_blob() which took both an fsp and a pathname.
Commented out so we still compile.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: Split out fget_nt_acl_common() from get_nt_acl_common().
Jeremy Allison [Mon, 13 Apr 2020 19:09:47 +0000 (12:09 -0700)]
s3: VFS: Split out fget_nt_acl_common() from get_nt_acl_common().

No change in logic and not yet used, just means it'll be
cleaner when we start adding the xxxAT() versions of SMB_VFS_GET_NT_ACL().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: RPC: Don't crash on trying to talloc_free(-1) if smb_iconv_open_ex() fails.
Jeremy Allison [Wed, 6 May 2020 19:36:00 +0000 (12:36 -0700)]
s3: RPC: Don't crash on trying to talloc_free(-1) if smb_iconv_open_ex() fails.

Assign output from smb_iconv_open_ex() to a temporary
handle. Only assign to mds_ctx->[handles] if correctly
opened otherwise we end up trying to call smb_iconv_close(-1).

MacOSX Catalina triggers this.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu May  7 18:03:16 UTC 2020 on sn-devel-184

4 years agos3: VFS: Remove now-unused variable in shadow_copy2_get_real_filename().
Jeremy Allison [Wed, 6 May 2020 18:30:51 +0000 (11:30 -0700)]
s3: VFS: Remove now-unused variable in shadow_copy2_get_real_filename().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agodocs-xml/smbdotconf: clarify the quoting for advanced "interfaces" options
Stefan Metzmacher [Thu, 7 May 2020 10:04:00 +0000 (12:04 +0200)]
docs-xml/smbdotconf: clarify the quoting for advanced "interfaces" options

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu May  7 16:23:40 UTC 2020 on sn-devel-184

4 years agointerface: clarify the quoting for advanced "interfaces" options
Stefan Metzmacher [Thu, 7 May 2020 10:04:00 +0000 (12:04 +0200)]
interface: clarify the quoting for advanced "interfaces" options

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agointerface: allow overriding speed/cap/if_index for named interfaces
Steven Noonan [Tue, 24 Sep 2019 05:53:40 +0000 (22:53 -0700)]
interface: allow overriding speed/cap/if_index for named interfaces

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agolib/socket: autodetect RSS using ETHTOOL_GRXRINGS
Stefan Metzmacher [Thu, 7 May 2020 09:06:03 +0000 (11:06 +0200)]
lib/socket: autodetect RSS using ETHTOOL_GRXRINGS

This is also used as part of 'ethtool -n rdma14' and
'ethtool -x rdma14'.

;#> ethtool -n rdma14
8 RX rings available
rxclass: Cannot get RX class rule count: Operation not supported
RX classification rule retrieval failed

;#> ethtool -x rdma14
RX flow hash indirection table for rdma14 with 8 RX ring(s):
    0:      0     1     2     3     4     5     6     7
    8:      0     1     2     3     4     5     6     7
RSS hash key:
Operation not supported
RSS hash function:
    toeplitz: on
    xor: off
    crc32: off

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agolib/socket: let query_iface_speed_from_name() initialize memory passed to syscalls
Stefan Metzmacher [Thu, 7 May 2020 09:06:03 +0000 (11:06 +0200)]
lib/socket: let query_iface_speed_from_name() initialize memory passed to syscalls

I'm not sure if struct initializers would take care of padding,
so I use ZERO_STRUCT().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agolib:util: Fix smbclient -l basename dir
Amit Kumar [Wed, 22 Apr 2020 11:53:42 +0000 (06:53 -0500)]
lib:util: Fix smbclient -l basename dir

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

Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Amit Kumar <amitkuma@redhat.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu May  7 10:38:29 UTC 2020 on sn-devel-184

4 years agoAdd a test for smbclient -l basename
Amit Kumar [Wed, 22 Apr 2020 11:53:33 +0000 (06:53 -0500)]
Add a test for smbclient -l basename

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

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agolib util asn1: modernize debug calls
Gary Lockyer [Tue, 5 May 2020 21:11:55 +0000 (09:11 +1200)]
lib util asn1: modernize debug calls

Replace DEBUG(0 with DBG_ERR(

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Wed May  6 22:53:02 UTC 2020 on sn-devel-184

4 years agos4 ldap_server: modernize debug calls
Gary Lockyer [Tue, 5 May 2020 21:10:32 +0000 (09:10 +1200)]
s4 ldap_server: modernize debug calls

Replace DEBUG(0 with DBG_ERR(

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agotest: Make local.event.*.fd1 a bit less flapping
Volker Lendecke [Tue, 5 May 2020 13:07:49 +0000 (15:07 +0200)]
test: Make local.event.*.fd1 a bit less flapping

One millisecond seems not enough on slow machines, make the timeout 10 msec

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): Wed May  6 11:58:42 UTC 2020 on sn-devel-184

4 years agovfs_shadow_copy2: implement case canonicalisation in shadow_copy2_get_real_filename()
Ralph Boehme [Tue, 5 May 2020 08:13:00 +0000 (10:13 +0200)]
vfs_shadow_copy2: implement case canonicalisation in shadow_copy2_get_real_filename()

unix_convert() can't do this for us in snapdirseverywhere mode, so we do it
ourselves.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: make get_real_filename_full_scan() public
Ralph Boehme [Thu, 23 Apr 2020 14:09:16 +0000 (16:09 +0200)]
smbd: make get_real_filename_full_scan() public

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoCI: add two tests for shadow_copy2 VFS module
Ralph Boehme [Tue, 21 Apr 2020 11:06:03 +0000 (13:06 +0200)]
CI: add two tests for shadow_copy2 VFS module

Note that the test "fetch a previous version of a regular file via non-canonical
basepath" doesn't fail by "luck" because it runs into the "creating file"
optimisation in unix_convert().

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_shadow_copy2: log caller location in shadow_copy2_strip_snapshot()
Ralph Boehme [Tue, 5 May 2020 08:09:01 +0000 (10:09 +0200)]
vfs_shadow_copy2: log caller location in shadow_copy2_strip_snapshot()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoctdb-build: Add messages_dgm build to ctdb
Amitay Isaacs [Fri, 28 Jun 2019 13:10:38 +0000 (23:10 +1000)]
ctdb-build: Add messages_dgm build to ctdb

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Wed May  6 01:47:16 UTC 2020 on sn-devel-184

4 years agolib/util: Build genrand for util core
Amitay Isaacs [Fri, 28 Jun 2019 13:07:34 +0000 (23:07 +1000)]
lib/util: Build genrand for util core

messages_dgm depends on genrand.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agowscript_build: Remove duplicate recursion in source4/smbd
Amitay Isaacs [Mon, 4 May 2020 06:32:38 +0000 (16:32 +1000)]
wscript_build: Remove duplicate recursion in source4/smbd

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agolib/messaging: Move messages_dgm out of source3
Amitay Isaacs [Fri, 28 Jun 2019 13:05:43 +0000 (23:05 +1000)]
lib/messaging: Move messages_dgm out of source3

... so CTDB can also use it.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agoRevert "smbd: fullpath based on fsp->fsp_name may contain an @GMT token"
Jeremy Allison [Tue, 5 May 2020 17:28:08 +0000 (10:28 -0700)]
Revert "smbd: fullpath based on fsp->fsp_name may contain an @GMT token"

This reverts commit e593c38f5a8602be497a29e145ccdd4f9cc595e7.

As stated in the original commit message, "When canonicalize_snapshot_path()
starts actually stripping off @GMT tokens, we can remove this again."

canonicalize_snapshot_path() now strips off @GMT tokens from
any SMB1 names, so this is now not needed anymore.

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): Tue May  5 20:55:42 UTC 2020 on sn-devel-184