Revert "VFS: shadow_copy2: Fixup shadow_copy2_symlinkat() to correctly use the dirfsp...
authorJeremy Allison <jra@samba.org>
Wed, 3 Feb 2021 21:52:33 +0000 (13:52 -0800)
committerJeremy Allison <jra@samba.org>
Tue, 9 Feb 2021 00:10:29 +0000 (00:10 +0000)
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 <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
source3/modules/vfs_shadow_copy2.c

index ae8afec11b1143113afe228ca9049c64fb85982e..174f246bdad11c50c88b91291241be6319c9e368 100644 (file)
@@ -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,
                                &timestamp_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;