shadow_copy2: Use dirfsp for connectpath
authorVolker Lendecke <vl@samba.org>
Thu, 15 Sep 2022 03:41:55 +0000 (03:41 +0000)
committerJeremy Allison <jra@samba.org>
Sat, 17 Sep 2022 04:15:35 +0000 (04:15 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_shadow_copy2.c

index b4ee00b71a0e7a722fb1f18a87d64ab9e0d2c590..a2e27f3a9383bbaabb6f8b69c6094241d5f299ed 100644 (file)
@@ -2634,6 +2634,7 @@ static const char *shadow_copy2_connectpath(
        char *stripped = NULL;
        char *tmp = NULL;
        const char *fname = smb_fname_in->base_name;
+       struct smb_filename *full = NULL;
        struct smb_filename smb_fname = {0};
        struct smb_filename *result_fname = NULL;
        char *result = NULL;
@@ -2653,7 +2654,13 @@ static const char *shadow_copy2_connectpath(
                return priv->shadow_connectpath;
        }
 
-       if (!shadow_copy2_strip_snapshot(talloc_tos(), handle, smb_fname_in,
+       full = full_path_from_dirfsp_atname(
+               talloc_tos(), dirfsp, smb_fname_in);
+       if (full == NULL) {
+               return NULL;
+       }
+
+       if (!shadow_copy2_strip_snapshot(talloc_tos(), handle, full,
                                         &timestamp, &stripped)) {
                goto done;
        }