Internal error: wrong write used in receiver.

Wayne Davison wayned at samba.org
Fri Nov 10 20:49:48 GMT 2006


On Fri, Nov 10, 2006 at 07:16:43AM -0800, Wayne Davison wrote:
> Looks like the ACLs patch didn't get tested with --delete + --acls.

The xattrs patch has the same problem.  If someone is using xattrs.diff
(which requires acls.diff too), the attached patch fixes both the ACL
code and the xattrs code.

..wayne..
-------------- next part --------------
--- old/flist.c
+++ new/flist.c
@@ -998,7 +998,7 @@
 		file->mode = tweak_mode(file->mode, chmod_modes);
 
 #ifdef SUPPORT_ACLS
-	if (preserve_acls) {
+	if (preserve_acls && f >= 0) {
 		sx.st.st_mode = file->mode;
 		sx.acc_acl = sx.def_acl = NULL;
 		if (get_acl(fname, &sx) < 0)
@@ -1006,7 +1006,7 @@
 	}
 #endif
 #ifdef SUPPORT_XATTRS
-	if (preserve_xattrs) {
+	if (preserve_xattrs && f >= 0) {
 		sx.xattr = NULL;
 		if (get_xattr(fname, &sx) < 0)
 			return NULL;
@@ -1021,20 +1021,20 @@
 		flist->files[flist->count++] = file;
 		send_file_entry(file, f);
 #ifdef SUPPORT_ACLS
-		if (preserve_acls)
+		if (preserve_acls && f >= 0)
 			send_acl(&sx, f);
 #endif
 #ifdef SUPPORT_XATTRS
-		if (preserve_xattrs)
+		if (preserve_xattrs && f >= 0)
 			send_xattr(&sx, f);
 #endif
 	} else {
 #ifdef SUPPORT_ACLS
-		if (preserve_acls)
+		if (preserve_acls && f >= 0)
 			free_acl(&sx);
 #endif
 #ifdef SUPPORT_XATTRS
-		if (preserve_xattrs)
+		if (preserve_xattrs && f >= 0)
 			free_xattr(&sx);
 #endif
 	}


More information about the rsync mailing list