diff options
author | Jeremy Allison <jra@samba.org> | 2020-04-13 14:05:03 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2020-05-07 19:27:35 +0000 |
commit | b8ab671a7ed7d1ef07e57e9fa0b508311209b7c4 (patch) | |
tree | d8460e523a095af8f91f4faa6f9f034338e82cd7 /source3 | |
parent | 0d013ed04b7de8b7e4983f6238431b49d1dcc02a (diff) | |
download | samba-b8ab671a7ed7d1ef07e57e9fa0b508311209b7c4.tar.gz |
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>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/modules/vfs_shadow_copy2.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c index 5a9074e802b..18eb0704d67 100644 --- a/source3/modules/vfs_shadow_copy2.c +++ b/source3/modules/vfs_shadow_copy2.c @@ -2138,6 +2138,60 @@ static NTSTATUS shadow_copy2_get_nt_acl(vfs_handle_struct *handle, return status; } +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, + ×tamp, + &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, @@ -3160,6 +3214,7 @@ static struct vfs_fn_pointers vfs_shadow_copy2_fns = { .mknodat_fn = shadow_copy2_mknodat, .realpath_fn = shadow_copy2_realpath, .get_nt_acl_fn = shadow_copy2_get_nt_acl, + .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, |