components/samba/samba/patches/vfs_shadow_copy2.c.patch
author Jiri Sasek <Jiri.Sasek@Sun.COM>
Fri, 16 Dec 2011 08:40:13 -0800
changeset 628 c3c0c8f3f696
parent 264 84a67a54e8fd
permissions -rw-r--r--
7119845 Samba 3.5.10 can not use the system kerberos keytab. 7121739 Reorganize Samba source patches to change-set manner.

7011579 Request to add shadow_copy2 in the next Samba patch or Solaris Samba package
s3: Replace shadow_copy2 with a new implementation

X-Git-Url: http://gitweb.samba.org/?p=samba.git;a=blobdiff_plain;f=source3%2Fmodules%2Fvfs_shadow_copy2.c;h=2777907a57da081118e8d11f846f6a33f9095a1d;hp=0393f309692b139f74c2460d2bdc27f8352bf50a;hb=HEAD;hpb=cf74a4857c051b43b1f6a06b714a93a65e8a1f90

diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index 0393f30..2777907 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -250,8 +250,8 @@ static const char *shadow_copy2_normalise_path(TALLOC_CTX *mem_ctx, const char *
 } while (0)
 
 #define _SHADOW2_NEXT_SMB_FNAME(op, args, rtype, eret, extra) do { \
-		const char *gmt_start; \
-		if (shadow_copy2_match_name(smb_fname->base_name, &gmt_start)) {	\
+	const char *gmt_start; \
+	if (shadow_copy2_match_name(smb_fname->base_name, &gmt_start)) { \
 		char *name2; \
 		char *smb_base_name_tmp = NULL; \
 		rtype ret; \
@@ -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));
 }