summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-12-16 04:26:02 -0700
committerMichael Adam <obnox@samba.org>2011-01-21 10:10:03 +0100
commit1c1a8420712a767df80a15e4b6fc9caa6027f145 (patch)
tree93d111769d403ee7234566bea527af3b3bdf0be3 /source3
parentd49d2032794c15c797d719eee102e3ba583013e3 (diff)
downloadsamba-1c1a8420712a767df80a15e4b6fc9caa6027f145.tar.gz
samba-1c1a8420712a767df80a15e4b6fc9caa6027f145.tar.bz2
samba-1c1a8420712a767df80a15e4b6fc9caa6027f145.zip
s3:vfs:shadow_copy2: 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.
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/vfs_shadow_copy2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index 0393f30969..0f66f6a453 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -535,6 +535,10 @@ static int shadow_copy2_rename(vfs_handle_struct *handle,
const struct smb_filename *smb_fname_src,
const struct smb_filename *smb_fname_dst)
{
+ if (shadow_copy2_match_name(smb_fname_src->base_name, NULL)) {
+ errno = EXDEV;
+ return -1;
+ }
SHADOW2_NEXT2_SMB_FNAME(RENAME,
(handle, smb_fname_src, smb_fname_dst));
}