]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
VFS: shadow_copy2: Fixup shadow_copy2_mknodat() to correctly use the dirfsp path.
authorJeremy Allison <jra@samba.org>
Wed, 20 Jan 2021 19:59:16 +0000 (11:59 -0800)
committerJeremy Allison <jra@samba.org>
Thu, 21 Jan 2021 21:48:30 +0000 (21:48 +0000)
Missed in my original fixes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
source3/modules/vfs_shadow_copy2.c

index 227ac148260c701b4757a8e096b8e27bdabae604..174f246bdad11c50c88b91291241be6319c9e368 100644 (file)
@@ -1625,13 +1625,23 @@ static int shadow_copy2_mknodat(vfs_handle_struct *handle,
                        mode_t mode,
                        SMB_DEV_T dev)
 {
+       struct smb_filename *full_fname = NULL;
        time_t timestamp = 0;
 
+       full_fname = full_path_from_dirfsp_atname(talloc_tos(),
+                                               dirfsp,
+                                               smb_fname);
+       if (full_fname == NULL) {
+               return -1;
+       }
+
        if (!shadow_copy2_strip_snapshot(talloc_tos(), handle,
-                                        smb_fname,
+                                        full_fname,
                                         &timestamp, NULL)) {
+               TALLOC_FREE(full_fname);
                return -1;
        }
+       TALLOC_FREE(full_fname);
        if (timestamp != 0) {
                errno = EROFS;
                return -1;