summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2020-01-28 12:12:09 -0800
committerRalph Boehme <slow@samba.org>2020-02-18 21:08:33 +0000
commit9e92d46b757d6a4cdd0f956c24b30df89adf2798 (patch)
treeac2a9fcdc96180c3ef02ee624cf2cc89c59ac242
parent018af49b93f8e9a2cbc0d40cc68b8202e5c95c9a (diff)
downloadsamba-9e92d46b757d6a4cdd0f956c24b30df89adf2798.tar.gz
s3: VFS: shadow_copy2: Add shadow_copy2_read_dfs_pathat().
Not yet used. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
-rw-r--r--source3/modules/vfs_shadow_copy2.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index 143f92959ff..c9b8d80e7f4 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -2467,6 +2467,60 @@ static NTSTATUS shadow_copy2_create_dfs_pathat(struct vfs_handle_struct *handle,
referral_count);
}
+static NTSTATUS shadow_copy2_read_dfs_pathat(struct vfs_handle_struct *handle,
+ TALLOC_CTX *mem_ctx,
+ struct files_struct *dirfsp,
+ const struct smb_filename *smb_fname,
+ struct referral **ppreflist,
+ size_t *preferral_count)
+{
+ time_t timestamp = 0;
+ char *stripped = NULL;
+ struct smb_filename *conv = NULL;
+ NTSTATUS status;
+
+ if (!shadow_copy2_strip_snapshot(mem_ctx,
+ handle,
+ smb_fname->base_name,
+ &timestamp,
+ &stripped)) {
+ return NT_STATUS_NO_MEMORY;
+ }
+ if (timestamp == 0) {
+ return SMB_VFS_NEXT_READ_DFS_PATHAT(handle,
+ mem_ctx,
+ dirfsp,
+ smb_fname,
+ ppreflist,
+ preferral_count);
+ }
+
+ conv = cp_smb_filename(mem_ctx, smb_fname);
+ if (conv == NULL) {
+ TALLOC_FREE(stripped);
+ return NT_STATUS_NO_MEMORY;
+ }
+ conv->base_name = shadow_copy2_convert(conv,
+ handle,
+ stripped,
+ timestamp);
+ TALLOC_FREE(stripped);
+ if (conv->base_name == NULL) {
+ TALLOC_FREE(conv);
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ status = SMB_VFS_NEXT_READ_DFS_PATHAT(handle,
+ mem_ctx,
+ dirfsp,
+ conv,
+ ppreflist,
+ preferral_count);
+
+ TALLOC_FREE(conv);
+ return status;
+}
+
static int shadow_copy2_get_real_filename(struct vfs_handle_struct *handle,
const char *path,
const char *name,
@@ -3149,6 +3203,7 @@ static struct vfs_fn_pointers vfs_shadow_copy2_fns = {
.disk_free_fn = shadow_copy2_disk_free,
.get_quota_fn = shadow_copy2_get_quota,
.create_dfs_pathat_fn = shadow_copy2_create_dfs_pathat,
+ .read_dfs_pathat_fn = shadow_copy2_read_dfs_pathat,
.renameat_fn = shadow_copy2_renameat,
.linkat_fn = shadow_copy2_linkat,
.symlinkat_fn = shadow_copy2_symlinkat,