extern int preserve_links;
extern int preserve_devices;
extern int write_devices;
-@@ -1798,6 +1799,14 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1795,6 +1796,14 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
fname, fnamecmpbuf);
}
sx.st.st_size = F_LENGTH(fuzzy_file);
statret = 0;
fnamecmp = fnamecmpbuf;
}
-@@ -1965,6 +1974,18 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1962,6 +1971,18 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
if (read_batch)
goto cleanup;
u_int32_t offset = len;
size_t data_retrieved = len;
while (data_retrieved < size) {
-- len = getxattr(path, name, value + offset, size - data_retrieved, offset, XATTR_NOFOLLOW);
-+ len = getxattr(path, name, value + offset, size - data_retrieved, offset, xattr_options);
+- len = getxattr(path, name, (char*)value + offset, size - data_retrieved, offset, XATTR_NOFOLLOW);
++ len = getxattr(path, name, (char*)value + offset, size - data_retrieved, offset, xattr_options);
if (len <= 0)
break;
data_retrieved += len;
/* The receiving side operates in one of two modes:
*
* 1. it receives any number of files into a destination directory,
-@@ -748,6 +791,9 @@ static char *get_local_name(struct file_list *flist, char *dest_path)
+@@ -751,6 +794,9 @@ static char *get_local_name(struct file_list *flist, char *dest_path)
exit_cleanup(RERR_FILESELECT);
}
filesystem_dev = st.st_dev; /* ensures --force works right w/-x */
return NULL;
}
if (file_total > 1) {
-@@ -805,7 +851,9 @@ static char *get_local_name(struct file_list *flist, char *dest_path)
+@@ -808,7 +854,9 @@ static char *get_local_name(struct file_list *flist, char *dest_path)
full_fname(dest_path));
exit_cleanup(RERR_FILESELECT);
}
return NULL;
}
-@@ -825,6 +873,9 @@ static char *get_local_name(struct file_list *flist, char *dest_path)
+@@ -828,6 +876,9 @@ static char *get_local_name(struct file_list *flist, char *dest_path)
full_fname(dest_path));
exit_cleanup(RERR_FILESELECT);
}
if (write_batch && read_batch) {
snprintf(err_buf, sizeof err_buf,
"--write-batch and --read-batch can not be used together\n");
-@@ -2667,6 +2685,11 @@ void server_options(char **args, int *argc_p)
+@@ -2628,6 +2646,11 @@ void server_options(char **args, int *argc_p)
if (preserve_fileflags)
args[ac++] = "--fileflags";
--owner, -o preserve owner (super-user only)
--group, -g preserve group
--devices preserve device files (super-user only)
-@@ -1291,6 +1293,47 @@ your home directory (remove the '=' for that).
+@@ -1296,6 +1298,47 @@ your home directory (remove the '=' for that).
receiving side. It does not try to affect user flags. This option
overrides `--force-change` and `--force-uchange`.
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -572,6 +572,17 @@ typedef unsigned int size_t;
+@@ -585,6 +585,17 @@ typedef unsigned int size_t;
#endif
#endif
}
int set_xattr_acl(const char *fname, int is_access_acl, const char *buf, size_t buf_len)
-@@ -1238,11 +1308,33 @@ int set_stat_xattr(const char *fname, struct file_struct *file, mode_t new_mode)
+@@ -1239,11 +1309,33 @@ int set_stat_xattr(const char *fname, struct file_struct *file, mode_t new_mode)
return 0;
}
return ret;
}
-@@ -1251,6 +1343,9 @@ int x_lstat(const char *fname, STRUCT_STAT *fst, STRUCT_STAT *xst)
+@@ -1252,6 +1344,9 @@ int x_lstat(const char *fname, STRUCT_STAT *fst, STRUCT_STAT *xst)
int ret = do_lstat(fname, fst);
if ((ret < 0 || get_stat_xattr(fname, -1, fst, xst) < 0) && xst)
xst->st_mode = 0;
return ret;
}
-@@ -1259,6 +1354,9 @@ int x_fstat(int fd, STRUCT_STAT *fst, STRUCT_STAT *xst)
+@@ -1260,6 +1355,9 @@ int x_fstat(int fd, STRUCT_STAT *fst, STRUCT_STAT *xst)
int ret = do_fstat(fd, fst);
if ((ret < 0 || get_stat_xattr(NULL, fd, fst, xst) < 0) && xst)
xst->st_mode = 0;