From: Jeremy Allison Date: Wed, 3 Feb 2021 21:52:33 +0000 (-0800) Subject: Revert "VFS: shadow_copy2: Fixup shadow_copy2_symlinkat() to correctly use the dirfsp... X-Git-Tag: tevent-0.11.0~1798 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=557b968b5a35e91262d65c40db79c81ce79f0d25;p=thirdparty%2Fsamba.git Revert "VFS: shadow_copy2: Fixup shadow_copy2_symlinkat() to correctly use the dirfsp path." This isn't needed as the existing code will refuse a new name with a non-zero twp in the target name. This reverts commit ec27c4c44d1e9035639e033689fa739518f17132. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Böhme --- diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c index ae8afec11b1..174f246bdad 100644 --- a/source3/modules/vfs_shadow_copy2.c +++ b/source3/modules/vfs_shadow_copy2.c @@ -1076,7 +1076,6 @@ static int shadow_copy2_symlinkat(vfs_handle_struct *handle, struct files_struct *dirfsp, const struct smb_filename *new_smb_fname) { - struct smb_filename *full_fname = NULL; time_t timestamp_old = 0; time_t timestamp_new = 0; char *snappath_old = NULL; @@ -1091,25 +1090,15 @@ static int shadow_copy2_symlinkat(vfs_handle_struct *handle, NULL)) { return -1; } - - full_fname = full_path_from_dirfsp_atname(talloc_tos(), - dirfsp, - new_smb_fname); - if (full_fname == NULL) { - return -1; - } - if (!shadow_copy2_strip_snapshot_internal(talloc_tos(), handle, - full_fname, + new_smb_fname, ×tamp_new, NULL, &snappath_new, NULL)) { - TALLOC_FREE(full_fname); return -1; } - TALLOC_FREE(full_fname); if ((timestamp_old != 0) || (timestamp_new != 0)) { errno = EROFS; return -1;