Fixed compilation problems that crept into the code.
[rsync/rsync-patches.git] / xattrs.diff
index 835bc41..16361d2 100644 (file)
@@ -175,7 +175,7 @@ TODO:
  extern int preserve_links;
  extern int preserve_hard_links;
  extern int preserve_devices;
-@@ -494,7 +495,7 @@ static struct file_struct *receive_file_
+@@ -498,7 +499,7 @@ static struct file_struct *receive_file_
        char thisname[MAXPATHLEN];
        unsigned int l1 = 0, l2 = 0;
        int alloc_len, basename_len, dirname_len, linkname_len, sum_len;
@@ -184,7 +184,7 @@ TODO:
        int xtra_len;
  #endif
        OFF_T file_length;
-@@ -606,10 +607,16 @@ static struct file_struct *receive_file_
+@@ -610,10 +611,16 @@ static struct file_struct *receive_file_
                xtra_len = (S_ISDIR(mode) ? 2 : 1) * 4;
        else
                xtra_len = 0;
@@ -202,7 +202,7 @@ TODO:
                  + xtra_len
  #endif
                  + linkname_len + sum_len;
-@@ -618,7 +625,7 @@ static struct file_struct *receive_file_
+@@ -622,7 +629,7 @@ static struct file_struct *receive_file_
        file = (struct file_struct *)bp;
        memset(bp, 0, file_struct_len);
        bp += file_struct_len;
@@ -211,7 +211,7 @@ TODO:
        bp += xtra_len;
  #endif
  
-@@ -719,6 +726,10 @@ static struct file_struct *receive_file_
+@@ -723,6 +730,10 @@ static struct file_struct *receive_file_
        if (preserve_acls)
                receive_acl(file, f);
  #endif
@@ -222,7 +222,7 @@ TODO:
  
        return file;
  }
-@@ -989,6 +1000,13 @@ static struct file_struct *send_file_nam
+@@ -994,6 +1005,13 @@ static struct file_struct *send_file_nam
                        return NULL;
        }
  #endif
@@ -236,7 +236,7 @@ TODO:
  
        maybe_emit_filelist_progress(flist->count + flist_count_offset);
  
-@@ -1001,11 +1019,19 @@ static struct file_struct *send_file_nam
+@@ -1006,11 +1024,19 @@ static struct file_struct *send_file_nam
                if (preserve_acls)
                        send_acl(&sx, f);
  #endif
@@ -389,7 +389,7 @@ TODO:
    {"times",           't', POPT_ARG_VAL,    &preserve_times, 1, 0, 0 },
    {"no-times",         0,  POPT_ARG_VAL,    &preserve_times, 0, 0, 0 },
    {"no-t",             0,  POPT_ARG_VAL,    &preserve_times, 0, 0, 0 },
-@@ -1113,6 +1123,17 @@ int parse_arguments(int *argc, const cha
+@@ -1114,6 +1124,17 @@ int parse_arguments(int *argc, const cha
                        return 0;
  #endif
  
@@ -407,7 +407,7 @@ TODO:
  
                default:
                        /* A large opt value means that set_refuse_options()
-@@ -1563,6 +1584,10 @@ void server_options(char **args,int *arg
+@@ -1560,6 +1581,10 @@ void server_options(char **args,int *arg
        if (preserve_acls)
                argstr[x++] = 'A';
  #endif
@@ -452,7 +452,7 @@ TODO:
  #define GID_NONE ((gid_t)-1)
  
  #define HL_CHECK_MASTER       0
-@@ -693,6 +697,9 @@ typedef struct {
+@@ -695,6 +699,9 @@ typedef struct {
      struct rsync_acl *acc_acl; /* access ACL */
      struct rsync_acl *def_acl; /* default ACL */
  #endif
@@ -481,7 +481,7 @@ TODO:
   -o, --owner                 preserve owner (super-user only)
   -g, --group                 preserve group
       --devices               preserve device files (super-user only)
-@@ -812,6 +813,11 @@ version makes it incompatible with sendi
+@@ -810,6 +811,11 @@ version makes it incompatible with sendi
  rsync unless you double the bf(--acls) option (e.g. bf(-AA)).  This
  doubling is not needed when pulling files from an older rsync.
  
@@ -495,7 +495,7 @@ TODO:
  transfer.  The resulting value is treated as though it was the permissions
 --- old/xattr.c
 +++ new/xattr.c
-@@ -0,0 +1,358 @@
+@@ -0,0 +1,360 @@
 +/*
 + * Extended Attribute support for rsync.
 + * Written by Jay Fenlason, vaguely based on the ACLs patch.
@@ -724,7 +724,9 @@ TODO:
 +static void rsync_xal_store(item_list *xalp)
 +{
 +      item_list *new_lst = EXPAND_ITEM_LIST(&rsync_xal_l, item_list, RSYNC_XAL_LIST_INITIAL);
-+      EXPAND_ITEM_LIST(new_lst, item_list, xalp->count);
++      /* Since the following call starts a new list, we know it will hold the
++       * entire initial-count, not just enough space for one new item. */
++      (void)EXPAND_ITEM_LIST(new_lst, item_list, xalp->count);
 +      memcpy(new_lst->items, xalp->items, xalp->count * sizeof (item_list));
 +      new_lst->count = xalp->count;
 +      xalp->count = 0;