]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: shadow_copy2: Remove shadow_copy2_get_nt_acl_at().
authorJeremy Allison <jra@samba.org>
Tue, 8 Jun 2021 19:38:43 +0000 (12:38 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 9 Jun 2021 13:14:31 +0000 (13:14 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_shadow_copy2.c
source3/modules/vfs_unityed_media.c

index 9f004aff6b613605e4c967cfa87e12ea2c64e1d9..d45b76950d10bd00c7dff0936f94554f22bd9115 100644 (file)
@@ -2131,60 +2131,6 @@ done:
        return ret;
 }
 
-static NTSTATUS shadow_copy2_get_nt_acl_at(vfs_handle_struct *handle,
-                                       struct files_struct *dirfsp,
-                                       const struct smb_filename *smb_fname,
-                                       uint32_t security_info,
-                                       TALLOC_CTX *mem_ctx,
-                                       struct security_descriptor **ppdesc)
-{
-       time_t timestamp = 0;
-       char *stripped = NULL;
-       NTSTATUS status;
-       char *conv;
-       struct smb_filename *conv_smb_fname = NULL;
-
-       if (!shadow_copy2_strip_snapshot(talloc_tos(),
-                                       handle,
-                                       smb_fname,
-                                       &timestamp,
-                                       &stripped)) {
-               return map_nt_error_from_unix(errno);
-       }
-       if (timestamp == 0) {
-               return SMB_VFS_NEXT_GET_NT_ACL_AT(handle,
-                                       dirfsp,
-                                       smb_fname,
-                                       security_info,
-                                       mem_ctx,
-                                       ppdesc);
-       }
-       conv = shadow_copy2_convert(talloc_tos(), handle, stripped, timestamp);
-       TALLOC_FREE(stripped);
-       if (conv == NULL) {
-               return map_nt_error_from_unix(errno);
-       }
-       conv_smb_fname = synthetic_smb_fname(talloc_tos(),
-                                       conv,
-                                       NULL,
-                                       NULL,
-                                       0,
-                                       smb_fname->flags);
-       if (conv_smb_fname == NULL) {
-               TALLOC_FREE(conv);
-               return NT_STATUS_NO_MEMORY;
-       }
-       status = SMB_VFS_NEXT_GET_NT_ACL_AT(handle,
-                                       dirfsp,
-                                       conv_smb_fname,
-                                       security_info,
-                                       mem_ctx,
-                                       ppdesc);
-       TALLOC_FREE(conv);
-       TALLOC_FREE(conv_smb_fname);
-       return status;
-}
-
 static int shadow_copy2_mkdirat(vfs_handle_struct *handle,
                                struct files_struct *dirfsp,
                                const struct smb_filename *smb_fname,
@@ -3252,7 +3198,6 @@ static struct vfs_fn_pointers vfs_shadow_copy2_fns = {
        .readlinkat_fn = shadow_copy2_readlinkat,
        .mknodat_fn = shadow_copy2_mknodat,
        .realpath_fn = shadow_copy2_realpath,
-       .get_nt_acl_at_fn = shadow_copy2_get_nt_acl_at,
        .get_shadow_copy_data_fn = shadow_copy2_get_shadow_copy_data,
        .mkdirat_fn = shadow_copy2_mkdirat,
        .getxattr_fn = shadow_copy2_getxattr,
index c49280492d4285e4dcd9f1205d0b88970443d6dd..aa264e042405fa690c7d8a36c48dd9bb846d8345 100644 (file)
@@ -1469,68 +1469,6 @@ err:
        return status;
 }
 
-/*
- * Ignoring get_real_filename function because the default doesn't do
- * anything.
- */
-
-static NTSTATUS um_get_nt_acl_at(vfs_handle_struct *handle,
-                       struct files_struct *dirfsp,
-                       const struct smb_filename *smb_fname,
-                       uint32_t security_info,
-                       TALLOC_CTX *mem_ctx,
-                       struct security_descriptor **ppdesc)
-{
-       NTSTATUS status;
-       char *client_path = NULL;
-       struct smb_filename *client_smb_fname = NULL;
-       bool ok;
-       int ret;
-
-       DBG_DEBUG("Entering um_get_nt_acl_at\n");
-
-       ok = is_in_media_files(smb_fname->base_name);
-       if (!ok) {
-               return SMB_VFS_NEXT_GET_NT_ACL_AT(handle,
-                               dirfsp,
-                               smb_fname,
-                               security_info,
-                               mem_ctx,
-                               ppdesc);
-       }
-
-       ret = alloc_get_client_path(handle,
-                               talloc_tos(),
-                               smb_fname->base_name,
-                               &client_path);
-       if (ret != 0) {
-               status = map_nt_error_from_unix(errno);
-               goto err;
-       }
-
-       client_smb_fname = synthetic_smb_fname(talloc_tos(),
-                                       client_path,
-                                       NULL,
-                                       NULL,
-                                       smb_fname->twrp,
-                                       smb_fname->flags);
-       if (client_smb_fname == NULL) {
-               TALLOC_FREE(client_path);
-               return NT_STATUS_NO_MEMORY;
-       }
-
-       status = SMB_VFS_NEXT_GET_NT_ACL_AT(handle,
-                               dirfsp,
-                               client_smb_fname,
-                               security_info,
-                               mem_ctx,
-                               ppdesc);
-err:
-       TALLOC_FREE(client_smb_fname);
-       TALLOC_FREE(client_path);
-       return status;
-}
-
 static SMB_ACL_T um_sys_acl_get_file(vfs_handle_struct *handle,
                                const struct smb_filename *smb_fname,
                                SMB_ACL_TYPE_T type,
@@ -1675,10 +1613,6 @@ static struct vfs_fn_pointers vfs_um_fns = {
        .realpath_fn = um_realpath,
        .chflags_fn = um_chflags,
 
-       /* NT ACL operations. */
-
-       .get_nt_acl_at_fn = um_get_nt_acl_at,
-
        /* POSIX ACL operations. */
 
        .sys_acl_get_file_fn = um_sys_acl_get_file,