samba.git
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

4 years agos3: torture: Add samba3.blackbox.NT1.shadow_copy_torture.
Jeremy Allison [Tue, 5 May 2020 00:57:29 +0000 (17:57 -0700)]
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>
4 years agos4: torture: Add an SMB1-specific open root of share with @GMT-path test - base.smb1...
Jeremy Allison [Tue, 5 May 2020 00:56:46 +0000 (17:56 -0700)]
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>
4 years agos3: torture: Add call to smbtorture smb2.twrp.openroot
Jeremy Allison [Tue, 5 May 2020 00:08:30 +0000 (17:08 -0700)]
s3: torture: Add call to smbtorture smb2.twrp.openroot

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos4: torture: Add smb2.twrp.openroot test.
Jeremy Allison [Tue, 5 May 2020 00:07:40 +0000 (17:07 -0700)]
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>
4 years agos3: smbd: Move the initialization of the filename and the call to canonicalize_snapsh...
Jeremy Allison [Tue, 5 May 2020 02:29:17 +0000 (19:29 -0700)]
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>
4 years agosmbd: Update description of canonicalize_snapshot_path().
Jeremy Allison [Mon, 4 May 2020 19:53:21 +0000 (12:53 -0700)]
smbd: Update description of canonicalize_snapshot_path().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agovfs_snapper: remove @GMT token stripping from snapper_gmt_strip_snapshot()
Ralph Boehme [Mon, 4 May 2020 08:37:22 +0000 (10:37 +0200)]
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>
4 years agovfs_ceph_snapshots: remove @GMT token stripping from ceph_snap_gmt_strip_snapshot()
Ralph Boehme [Mon, 4 May 2020 08:21:41 +0000 (10:21 +0200)]
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>
4 years agovfs_ceph_snapshots: fix return value of ceph_snap_gmt_strip_snapshot()
Ralph Boehme [Mon, 4 May 2020 08:19:35 +0000 (10:19 +0200)]
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>
4 years agosmbd: remove processing of @GMT tokens from the SMB2 server
Ralph Boehme [Sun, 3 May 2020 17:07:08 +0000 (19:07 +0200)]
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>
4 years agosmbd: pass ucf_flags to canonicalize_snapshot_path()
Ralph Boehme [Mon, 4 May 2020 11:51:37 +0000 (13:51 +0200)]
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>
4 years agosmbd: strip @GMT token in canonicalize_snapshot_path()
Ralph Boehme [Thu, 30 Apr 2020 13:24:44 +0000 (15:24 +0200)]
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>
4 years agosmbd: pass translated_path as const to stat_cache_add()
Ralph Boehme [Tue, 5 May 2020 11:03:29 +0000 (13:03 +0200)]
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>
4 years agosmbd: realign stat_cache_add() args in unix_convert()
Ralph Boehme [Tue, 5 May 2020 11:00:00 +0000 (13:00 +0200)]
smbd: realign stat_cache_add() args in unix_convert()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: realigning a complex if expression in unix_convert()
Ralph Boehme [Tue, 5 May 2020 09:13:47 +0000 (11:13 +0200)]
smbd: realigning a complex if expression in unix_convert()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_ceph_snapshots: use struct smb_filename.twrp instead of @GMT string token
Ralph Boehme [Sat, 2 May 2020 09:45:11 +0000 (11:45 +0200)]
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>
4 years agovfs_ceph_snapshots: pass struct smb_filename to ceph_snap_gmt_strip_snapshot()
Ralph Boehme [Sat, 2 May 2020 09:39:58 +0000 (11:39 +0200)]
vfs_ceph_snapshots: pass struct smb_filename to ceph_snap_gmt_strip_snapshot()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_snapper: use struct smb_filename.twrp instead of @GMT string token
Ralph Boehme [Sat, 2 May 2020 09:45:11 +0000 (11:45 +0200)]
vfs_snapper: 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>
4 years agovfs_snapper: pass struct smb_filename to snapper_gmt_strip_snapshot()
Ralph Boehme [Sat, 2 May 2020 09:39:58 +0000 (11:39 +0200)]
vfs_snapper: pass struct smb_filename to snapper_gmt_strip_snapshot()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_shadow_copy2: use struct smb_filename.twrp instead of @GMT string token
Ralph Boehme [Sat, 2 May 2020 10:10:38 +0000 (12:10 +0200)]
vfs_shadow_copy2: use struct smb_filename.twrp instead of @GMT string token

Removes the asserts which were only needed to prove patchset correctness.

If smb_fname->twrp is zero, the path won't contain an @GMT token, so we can skip
the stripping logic and directly goto out.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_shadow_copy2: use smb_fname->twrp in shadow_copy2_strip_snapshot_internal()
Ralph Boehme [Fri, 1 May 2020 14:36:09 +0000 (16:36 +0200)]
vfs_shadow_copy2: use smb_fname->twrp in shadow_copy2_strip_snapshot_internal()

Use smb_fname->twrp instead if the @GMT token and assert both the twrp value and
the converted @GMT string token have the same value.

With this commit passing CI (which it did), we can somewhat safely assume that
anything that calls into the VFS stack is correctly passing struct
smb_filename.twrp from unix_convert() to the VFS without loosing the twrp value
in one of the myriad places where we copy the original struct smb_filename value
one way or another.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_shadow_copy2: pass orig_name as struct smb_filename to shadow_copy2_strip_snapshot()
Ralph Boehme [Thu, 30 Apr 2020 15:28:16 +0000 (17:28 +0200)]
vfs_shadow_copy2: pass orig_name as struct smb_filename to shadow_copy2_strip_snapshot()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: set twrp in target_fname in target_fname()
Ralph Boehme [Sat, 2 May 2020 08:30:24 +0000 (10:30 +0200)]
smbd: set twrp in target_fname in target_fname()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fruit: set twrp in smb_fname in fruit_fstat_meta_stream()
Ralph Boehme [Sat, 2 May 2020 08:28:44 +0000 (10:28 +0200)]
vfs_fruit: set twrp in smb_fname in fruit_fstat_meta_stream()

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