Fixed the combining of --delete with --xattrs.
authorWayne Davison <wayned@samba.org>
Fri, 10 Nov 2006 20:34:48 +0000 (20:34 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 10 Nov 2006 20:34:48 +0000 (20:34 +0000)
xattrs.diff

index ceaacc5..eba634b 100644 (file)
@@ -257,7 +257,7 @@ TODO:
        }
  #endif
 +#ifdef SUPPORT_XATTRS
-+      if (preserve_xattrs) {
++      if (preserve_xattrs && f >= 0) {
 +              sx.xattr = NULL;
 +              if (get_xattr(fname, &sx) < 0)
 +                      return NULL;
@@ -267,20 +267,20 @@ TODO:
        maybe_emit_filelist_progress(flist->count + flist_count_offset);
  
 @@ -1006,11 +1024,19 @@ static struct file_struct *send_file_nam
-               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
        }
@@ -574,7 +574,7 @@ TODO:
         * will enable owner-writability using chmod, if necessary.
 --- old/rsync.h
 +++ new/rsync.h
-@@ -500,6 +500,10 @@ struct idev {
+@@ -501,6 +501,10 @@ struct idev {
  #define ACLS_NEED_MASK 1
  #endif
  
@@ -585,7 +585,7 @@ TODO:
  #define GID_NONE ((gid_t)-1)
  
  #define HL_CHECK_MASTER       0
-@@ -694,6 +698,9 @@ typedef struct {
+@@ -692,6 +696,9 @@ typedef struct {
      struct rsync_acl *acc_acl; /* access ACL */
      struct rsync_acl *def_acl; /* default ACL */
  #endif