s3: VFS: Change SMB_VFS_LISTXATTR to use const struct smb_filename * instead of const...
[samba.git] / source3 / modules / vfs_shadow_copy2.c
index 6777d7a82085ffcc82fde6bdbca594f1f545b111..74176793a14c1234b1e57bfd4c1234d8cd3d66e3 100644 (file)
@@ -2367,7 +2367,7 @@ static ssize_t shadow_copy2_getxattr(vfs_handle_struct *handle,
 }
 
 static ssize_t shadow_copy2_listxattr(struct vfs_handle_struct *handle,
-                                     const char *fname,
+                                     const struct smb_filename *smb_fname,
                                      char *list, size_t size)
 {
        time_t timestamp = 0;
@@ -2375,23 +2375,37 @@ static ssize_t shadow_copy2_listxattr(struct vfs_handle_struct *handle,
        ssize_t ret;
        int saved_errno = 0;
        char *conv;
+       struct smb_filename *conv_smb_fname = NULL;
 
-       if (!shadow_copy2_strip_snapshot(talloc_tos(), handle, fname,
-                                        &timestamp, &stripped)) {
+       if (!shadow_copy2_strip_snapshot(talloc_tos(),
+                               handle,
+                               smb_fname->base_name,
+                               &timestamp,
+                               &stripped)) {
                return -1;
        }
        if (timestamp == 0) {
-               return SMB_VFS_NEXT_LISTXATTR(handle, fname, list, size);
+               return SMB_VFS_NEXT_LISTXATTR(handle, smb_fname, list, size);
        }
        conv = shadow_copy2_convert(talloc_tos(), handle, stripped, timestamp);
        TALLOC_FREE(stripped);
        if (conv == NULL) {
                return -1;
        }
-       ret = SMB_VFS_NEXT_LISTXATTR(handle, conv, list, size);
+       conv_smb_fname = synthetic_smb_fname(talloc_tos(),
+                                       conv,
+                                       NULL,
+                                       NULL,
+                                       smb_fname->flags);
+       if (conv_smb_fname == NULL) {
+               TALLOC_FREE(conv);
+               return -1;
+       }
+       ret = SMB_VFS_NEXT_LISTXATTR(handle, conv_smb_fname, list, size);
        if (ret == -1) {
                saved_errno = errno;
        }
+       TALLOC_FREE(conv_smb_fname);
        TALLOC_FREE(conv);
        if (saved_errno != 0) {
                errno = saved_errno;