s3: Fix shadow-copy module for drag&drop from a snapshot
authorVolker Lendecke <vl@samba.org>
Thu, 16 Dec 2010 11:26:02 +0000 (04:26 -0700)
committerVolker Lendecke <vl@samba.org>
Thu, 16 Dec 2010 11:30:06 +0000 (12:30 +0100)
We have to return NT_STATUS_NOT_SAME_DEVICE to trigger the Windows client to
start a copy itself. Unbeknownst to us via the ACLs snapshots are read-only, so
a rename would trigger a EACCES. Unfortunately the MacOS/X finder does not do
the smart NOT_SAME_DEVICE fallback that Windows does.

source3/modules/vfs_shadow_copy2.c

index 6199620512fd0745ef9dd7458653c9e976660150..96f0e7b821c367d542ec237cd536395105a4544a 100644 (file)
@@ -406,6 +406,10 @@ static void convert_sbuf(vfs_handle_struct *handle, const char *fname, SMB_STRUC
 static int shadow_copy2_rename(vfs_handle_struct *handle,
                        const char *oldname, const char *newname)
 {
+       if (shadow_copy2_match_name(oldname, NULL)) {
+               errno = EXDEV;
+               return -1;
+       }
        SHADOW2_NEXT2(RENAME, (handle, oldname, newname));
 }