diff options
author | Ralph Boehme <slow@samba.org> | 2018-11-22 11:02:24 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2018-12-13 13:48:26 +0100 |
commit | 5a0d7463c601f14fd0efd2e793192fd520cc48bf (patch) | |
tree | ae0e1a326446948020b87086257d266edeccd0c7 /source3 | |
parent | de114204480a59b06ac6d8e63647cb6ec9e06b7e (diff) | |
download | samba-5a0d7463c601f14fd0efd2e793192fd520cc48bf.tar.gz |
vfs_shadow_copy2: add _already_converted arg to shadow_copy2_strip_snapshot_internal()
Not used for now, all existing callers pass NULL.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13688
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 87bf06ed790dad8a4f650c0cd1b6781864666cbf)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/modules/vfs_shadow_copy2.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c index b6745cf169b..604423d6d80 100644 --- a/source3/modules/vfs_shadow_copy2.c +++ b/source3/modules/vfs_shadow_copy2.c @@ -587,7 +587,8 @@ static bool shadow_copy2_strip_snapshot_internal(TALLOC_CTX *mem_ctx, const char *orig_name, time_t *ptimestamp, char **pstripped, - char **psnappath) + char **psnappath, + bool *_already_converted) { struct tm tm; time_t timestamp = 0; @@ -608,6 +609,10 @@ static bool shadow_copy2_strip_snapshot_internal(TALLOC_CTX *mem_ctx, DEBUG(10, (__location__ ": enter path '%s'\n", name)); + if (_already_converted != NULL) { + *_already_converted = false; + } + abs_path = make_path_absolute(mem_ctx, priv, name); if (abs_path == NULL) { ret = false; @@ -630,6 +635,9 @@ static bool shadow_copy2_strip_snapshot_internal(TALLOC_CTX *mem_ctx, } if (already_converted) { + if (_already_converted != NULL) { + *_already_converted = true; + } goto out; } @@ -759,6 +767,7 @@ static bool shadow_copy2_strip_snapshot(TALLOC_CTX *mem_ctx, orig_name, ptimestamp, pstripped, + NULL, NULL); } @@ -1119,12 +1128,14 @@ static int shadow_copy2_rename(vfs_handle_struct *handle, if (!shadow_copy2_strip_snapshot_internal(talloc_tos(), handle, smb_fname_src->base_name, - ×tamp_src, NULL, &snappath_src)) { + ×tamp_src, NULL, &snappath_src, + NULL)) { return -1; } if (!shadow_copy2_strip_snapshot_internal(talloc_tos(), handle, smb_fname_dst->base_name, - ×tamp_dst, NULL, &snappath_dst)) { + ×tamp_dst, NULL, &snappath_dst, + NULL)) { return -1; } if (timestamp_src != 0) { @@ -1163,7 +1174,8 @@ static int shadow_copy2_symlink(vfs_handle_struct *handle, link_contents, ×tamp_old, NULL, - &snappath_old)) { + &snappath_old, + NULL)) { return -1; } if (!shadow_copy2_strip_snapshot_internal(talloc_tos(), @@ -1171,7 +1183,8 @@ static int shadow_copy2_symlink(vfs_handle_struct *handle, new_smb_fname->base_name, ×tamp_new, NULL, - &snappath_new)) { + &snappath_new, + NULL)) { return -1; } if ((timestamp_old != 0) || (timestamp_new != 0)) { @@ -1202,7 +1215,8 @@ static int shadow_copy2_link(vfs_handle_struct *handle, old_smb_fname->base_name, ×tamp_old, NULL, - &snappath_old)) { + &snappath_old, + NULL)) { return -1; } if (!shadow_copy2_strip_snapshot_internal(talloc_tos(), @@ -1210,7 +1224,8 @@ static int shadow_copy2_link(vfs_handle_struct *handle, new_smb_fname->base_name, ×tamp_new, NULL, - &snappath_new)) { + &snappath_new, + NULL)) { return -1; } if ((timestamp_old != 0) || (timestamp_new != 0)) { @@ -1566,7 +1581,8 @@ static int shadow_copy2_chdir(vfs_handle_struct *handle, smb_fname->base_name, ×tamp, &stripped, - &snappath)) { + &snappath, + NULL)) { return -1; } if (stripped != NULL) { |