From 1dcb4ccc658bffb3dfa7a31506b92f338b4c945b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 16 Dec 2010 04:26:02 -0700 Subject: [PATCH] s3: Fix shadow-copy module for drag&drop from a snapshot 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c index 6199620512..96f0e7b821 100644 --- a/source3/modules/vfs_shadow_copy2.c +++ b/source3/modules/vfs_shadow_copy2.c @@ -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)); } -- 2.34.1