1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

122051 Commits

Author SHA1 Message Date
Jeremy Allison
1df02b7d7a 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>
2020-05-07 19:27:34 +00:00
Jeremy Allison
6db910cf60 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>
2020-05-07 19:27:34 +00:00
Jeremy Allison
773b6e1740 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>
2020-05-07 19:27:34 +00:00
Jeremy Allison
2437dcc5ac 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>
2020-05-07 19:27:34 +00:00
Jeremy Allison
d825d31f7a 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>
2020-05-07 19:27:34 +00:00
Jeremy Allison
b45716487b 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>
2020-05-07 19:27:34 +00:00
Jeremy Allison
42651479e5 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>
2020-05-07 19:27:34 +00:00
Jeremy Allison
b7847aa25a 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>
2020-05-07 19:27:34 +00:00
Jeremy Allison
441980d42d 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>
2020-05-07 19:27:34 +00:00
Jeremy Allison
d902ea5215 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>
2020-05-07 19:27:34 +00:00
Jeremy Allison
936b9aee5e 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>
2020-05-07 19:27:34 +00:00
Jeremy Allison
4ac3fde1a9 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>
2020-05-07 19:27:34 +00:00
Jeremy Allison
ac333c569d 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>
2020-05-07 19:27:34 +00:00
Jeremy Allison
14df5d20a8 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
2020-05-07 18:03:16 +00:00
Jeremy Allison
155883e85c 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>
2020-05-07 16:24:42 +00:00
Stefan Metzmacher
afd3bd01eb 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
2020-05-07 16:23:39 +00:00
Stefan Metzmacher
fe3380d369 interface: clarify the quoting for advanced "interfaces" options
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-07 14:44:40 +00:00
Steven Noonan
5944ec38cd 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>
2020-05-07 14:44:40 +00:00
Stefan Metzmacher
d39636acea 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>
2020-05-07 14:44:40 +00:00
Stefan Metzmacher
4ccb581609 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>
2020-05-07 14:44:39 +00:00
Amit Kumar
c83ce5f4f9 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
2020-05-07 10:38:29 +00:00
Amit Kumar
2a7fc40fb3 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>
2020-05-07 08:59:31 +00:00
Gary Lockyer
3d2dd6296d 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
2020-05-06 22:53:02 +00:00
Gary Lockyer
79b371da80 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>
2020-05-06 21:15:42 +00:00
Volker Lendecke
04da0c344e 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
2020-05-06 11:58:42 +00:00
Ralph Boehme
a3d1ac2a59 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>
2020-05-06 10:18:39 +00:00
Ralph Boehme
aa5f19ddf1 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>
2020-05-06 10:18:38 +00:00
Ralph Boehme
6557777c86 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>
2020-05-06 10:18:38 +00:00
Ralph Boehme
1b74a4a3bb 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>
2020-05-06 10:18:38 +00:00
Amitay Isaacs
23c2195e2c 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
2020-05-06 01:47:16 +00:00
Amitay Isaacs
a59fd8164c 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>
2020-05-06 00:06:40 +00:00
Amitay Isaacs
e595d2a1fd wscript_build: Remove duplicate recursion in source4/smbd
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-05-06 00:06:40 +00:00
Amitay Isaacs
93408f60cb 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>
2020-05-06 00:06:40 +00:00
Jeremy Allison
8d22b9edff 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
2020-05-05 20:55:41 +00:00
Jeremy Allison
35be625b09 s3: torture: Add samba3.blackbox.NT1.shadow_copy_torture.
Runs the SMB1 root @GMT-pathname open test.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 19:18:44 +00:00
Jeremy Allison
9881c3f9ab s4: torture: Add an SMB1-specific open root of share with @GMT-path test - base.smb1-twrp-openroot
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 19:18:43 +00:00
Jeremy Allison
c3377b4c02 s3: torture: Add call to smbtorture smb2.twrp.openroot
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 19:18:43 +00:00
Jeremy Allison
2b8ea97709 s4: torture: Add smb2.twrp.openroot test.
Opens the root of a share over SMB2 with a zero-length
filename and a timewarp token.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 19:18:43 +00:00
Jeremy Allison
2992891e27 s3: smbd: Move the initialization of the filename and the call to canonicalize_snapshot_path() *before* zero-length string checks.
canonicalize_snapshot_path() may eat the incoming pathname in total
for SMB1, so we need to check after that call.

Fix the zero-length string check to look at state->smb_fname->base_name
instead of state->orig_path.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 19:18:43 +00:00
Jeremy Allison
8019b3d0af smbd: Update description of canonicalize_snapshot_path().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-05-05 19:18:43 +00:00
Ralph Boehme
773b98c11e vfs_snapper: remove @GMT token stripping from snapper_gmt_strip_snapshot()
Leaving the exercize of removing the now unneeded stripped logic to a future
patchset.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-05 19:18:43 +00:00
Ralph Boehme
2dd21e650c vfs_ceph_snapshots: remove @GMT token stripping from ceph_snap_gmt_strip_snapshot()
Leaving the exercize of removing the now unneeded stripped logic to a future
patchset.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-05 19:18:43 +00:00
Ralph Boehme
3a52e3f0f8 vfs_ceph_snapshots: fix return value of ceph_snap_gmt_strip_snapshot()
The function returns ints and the callers expect ints. Declaring bool while
returning ints works, as generally compilers implement bools as ints.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-05 19:18:43 +00:00
Ralph Boehme
55877f958a smbd: remove processing of @GMT tokens from the SMB2 server
Setting this flag was a hokey hack to trigger @GMT token processing in
filename_convert(). Now that all internal processing is based on struct
smb_filename.NTTIME twrp, we can remove this hack.

With this change, paths containing @GMT tokens received over SMB2 are
subsequently processed unchanged, the @GMT token is not stripped and will hit
the filesystem, mostly resulting in NT_STATUS_NOT_FOUND failures which is the
same behaviour as Windows.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-05 19:18:43 +00:00
Ralph Boehme
f689f3cb22 smbd: pass ucf_flags to canonicalize_snapshot_path()
No change in behaviour. ucf_flags are just now checked *inside*
canonicalize_snapshot_path() instead of the caller.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-05 19:18:43 +00:00
Ralph Boehme
6e364c5453 smbd: strip @GMT token in canonicalize_snapshot_path()
smbd and all previous-versions implementing VFS modules have been patched to
work with struct smb_filename.NTTIME twrp, so we can now safely strip @GMT
tokens from paths.

This also means that "@GMT-something/foo" and "foo" will both come out as "foo",
so we have to take care of the stat-cache now and change it to take and use an
additional twrp arg.

At the same time remove @GMT stripping from shadow_copy2. In theory this could
be made a seperate commit, but due to the absolute path and pstripped logic, it
felt too cumbersome to attempt this.

Leaving the exercize of removing the now unneeded stripped logic to a future
patchset.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-05 19:18:43 +00:00
Ralph Boehme
28763125cf smbd: pass translated_path as const to stat_cache_add()
Prepares for doing more stuff with the translated_path in a subsequent commit.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-05 19:18:43 +00:00
Ralph Boehme
1130c64f49 smbd: realign stat_cache_add() args in unix_convert()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-05 19:18:43 +00:00
Ralph Boehme
6e8ffcff46 smbd: realigning a complex if expression in unix_convert()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-05 19:18:42 +00:00
Ralph Boehme
8632f7eaba vfs_ceph_snapshots: use struct smb_filename.twrp instead of @GMT string token
@GMT tokens are still validated and stripped, but the previous version timestamp
is taken from the struct smb_filename twrp member.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-05 19:18:42 +00:00