Fixed the value of CENT_POS for non-Linux systems.
authorWayne Davison <wayned@samba.org>
Sat, 4 Nov 2006 07:36:03 +0000 (07:36 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 4 Nov 2006 07:36:03 +0000 (07:36 +0000)
fake-super.diff

index 0766699..cebe34a 100644 (file)
@@ -434,7 +434,7 @@ above:
  int preserve_perms = 0;
 --- old/xattr.c
 +++ new/xattr.c
-@@ -39,13 +39,23 @@ extern unsigned int file_struct_len;
+@@ -39,13 +39,24 @@ extern unsigned int file_struct_len;
  #define SYSTEM_PREFIX "system."
  #define SPRE_LEN ((int)sizeof SYSTEM_PREFIX - 1)
  
@@ -446,20 +446,21 @@ above:
 +#define FAKE_PREFIX USER_PREFIX RSYNC_PREFIX
 +#define FPRE_LEN ((int)sizeof FAKE_PREFIX - 1)
 +#define XSTAT_ATTR USER_PREFIX RSYNC_PREFIX XSTAT_SUFFIX
++#define CENT_POS (UPRE_LEN + (int)sizeof RSYNC_PREFIX - 1)
  #else
 -#define RSYNC_PREFIX "rsync."
  #define RPRE_LEN ((int)sizeof RSYNC_PREFIX - 1)
 +#define FPRE_LEN 0
 +#define XSTAT_ATTR RSYNC_PREFIX XSTAT_SUFFIX
++#define CENT_POS RPRE_LEN
  #endif
  
 +#define XSTAT_LEN ((int)sizeof XSTAT_ATTR - 1)
-+#define CENT_POS (UPRE_LEN + (int)sizeof RSYNC_PREFIX - 1)
 +
  typedef struct {
        char *datum, *name;
        size_t datum_len, name_len;
-@@ -143,6 +153,10 @@ static int rsync_xal_get(const char *fna
+@@ -143,6 +154,10 @@ static int rsync_xal_get(const char *fna
                        continue;
  #endif
  
@@ -470,7 +471,7 @@ above:
                datum_len = sys_lgetxattr(fname, name, NULL, 0);
                if (datum_len < 0) {
                        if (errno == ENOTSUP)
-@@ -173,6 +187,13 @@ static int rsync_xal_get(const char *fna
+@@ -173,6 +188,13 @@ static int rsync_xal_get(const char *fna
                                return -1;
                        }
                }
@@ -483,8 +484,8 @@ above:
 +#endif
                rxas = EXPAND_ITEM_LIST(xalp, rsync_xa, RSYNC_XAL_INITIAL);
                rxas->name = ptr + datum_len;
-               memcpy(rxas->name, name, name_len);
-@@ -293,20 +314,23 @@ void receive_xattr(struct file_struct *f
+               rxas->datum = ptr;
+@@ -293,20 +315,23 @@ void receive_xattr(struct file_struct *f
                        rsync_xa *rxa;
                        size_t name_len = read_int(f);
                        size_t datum_len = read_int(f);
@@ -513,7 +514,7 @@ above:
                        if (!am_root && strncmp(name, USER_PREFIX, UPRE_LEN) != 0) {
                                free(ptr);
                                continue;
-@@ -323,6 +347,11 @@ void receive_xattr(struct file_struct *f
+@@ -324,6 +349,11 @@ void receive_xattr(struct file_struct *f
                                memcpy(name, RSYNC_PREFIX, RPRE_LEN);
                        }
  #endif
@@ -524,8 +525,8 @@ above:
 +                      }
                        rxa = EXPAND_ITEM_LIST(&temp_xattr, rsync_xa, count);
                        rxa->name = name;
-                       rxa->name_len = name_len;
-@@ -403,4 +432,146 @@ int set_xattr(const char *fname, const s
+                       rxa->datum = ptr;
+@@ -403,4 +433,146 @@ int set_xattr(const char *fname, const s
        return rsync_xal_set(fname, lst + ndx); /* TODO:  This needs to return 1 if no xattrs changed! */
  }