summaryrefslogtreecommitdiff
blob: 5fcac75fb3cdd156c690d091d7098a7354905f1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
fix from upstream for using --delete with acls/xattrs

http://www.mail-archive.com/rsync@lists.samba.org/msg17506.html
http://bugs.gentoo.org/158130

--- rsync/flist.c
+++ rsync/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
 	}