--- old/acls.c
+++ new/acls.c
-@@ -90,6 +90,18 @@ static const char *str_acl_type(SMB_ACL_
+@@ -89,6 +89,18 @@ static const char *str_acl_type(SMB_ACL_
: "unknown SMB_ACL_TYPE_T";
}
static int calc_sacl_entries(const rsync_acl *racl)
{
/* A System ACL always gets user/group/other permission entries. */
-@@ -545,6 +557,91 @@ int get_acl(const char *fname, statx *sx
+@@ -544,6 +556,91 @@ int get_acl(const char *fname, statx *sx
return 0;
}
/* === Send functions === */
/* The general strategy with the tag_type <-> character mapping is that
-@@ -631,6 +728,11 @@ static void send_rsync_acl(rsync_acl *ra
+@@ -630,6 +727,11 @@ static void send_rsync_acl(rsync_acl *ra
* This also frees the ACL data. */
void send_acl(statx *sxp, int f)
{
if (!sxp->acc_acl) {
sxp->acc_acl = create_racl();
rsync_acl_fake_perms(sxp->acc_acl, sxp->st.st_mode);
-@@ -648,6 +750,146 @@ void send_acl(statx *sxp, int f)
+@@ -647,6 +749,146 @@ void send_acl(statx *sxp, int f)
}
}
/* === Receive functions === */
static uchar recv_acl_access(uchar *name_follows_val, int f)
-@@ -767,6 +1009,11 @@ static int recv_rsync_acl(item_list *rac
+@@ -766,6 +1008,11 @@ static int recv_rsync_acl(item_list *rac
/* Receive the ACL info the sender has included for this file-list entry. */
void receive_acl(struct file_struct *file, int f)
{
if (S_ISDIR(file->mode))
--- old/compat.c
+++ new/compat.c
-@@ -111,13 +111,6 @@ void setup_protocol(int f_out,int f_in)
+@@ -115,13 +115,6 @@ void setup_protocol(int f_out,int f_in)
protocol_version);
exit_cleanup(RERR_PROTOCOL);
}
- protocol_version);
- exit_cleanup(RERR_PROTOCOL);
- }
- }
-
- if (delete_mode && !(delete_before+delete_during+delete_after)) {
+ if (preserve_xattrs) {
+ rprintf(FERROR,
+ "--xattrs requires protocol 30 or higher"
--- old/testsuite/acls.test
+++ new/testsuite/acls.test
@@ -9,10 +9,6 @@
$RSYNC --version | grep ", ACLs" >/dev/null || test_skipped "Rsync is configured without ACL support"
-case "$RSYNC" in
--*protocol=29*) test_skipped "ACLs require protocol 30" ;;
+-*protocol=29*) test_skipped "ACL support requires protocol 30" ;;
-esac
-
case "$setfacl_nodef" in
--- old/compat.c
+++ new/compat.c
-@@ -62,6 +62,8 @@ void setup_protocol(int f_out,int f_in)
+@@ -64,6 +64,8 @@ void setup_protocol(int f_out,int f_in)
preserve_uid = ++file_extra_cnt;
if (preserve_gid)
preserve_gid = ++file_extra_cnt;
+ preserve_atimes = ++file_extra_cnt;
if (preserve_acls && !am_sender)
preserve_acls = ++file_extra_cnt;
-
+ if (preserve_xattrs)
--- old/flist.c
+++ new/flist.c
-@@ -49,6 +49,7 @@ extern int preserve_devices;
+@@ -50,6 +50,7 @@ extern int preserve_devices;
extern int preserve_specials;
extern int preserve_uid;
extern int preserve_gid;
extern int relative_paths;
extern int implied_dirs;
extern int file_extra_cnt;
-@@ -144,6 +145,7 @@ void show_flist_stats(void)
+@@ -147,6 +148,7 @@ void show_flist_stats(void)
static void list_file_entry(struct file_struct *f)
{
char permbuf[PERMSTRING_SIZE];
double len;
if (!F_IS_ACTIVE(f)) {
-@@ -158,14 +160,16 @@ static void list_file_entry(struct file_
+@@ -161,14 +163,16 @@ static void list_file_entry(struct file_
#ifdef SUPPORT_LINKS
if (preserve_links && S_ISLNK(f->mode)) {
f_name(f, NULL));
}
}
-@@ -349,6 +353,7 @@ int push_flist_dir(const char *dir, int
+@@ -352,6 +356,7 @@ int push_flist_dir(const char *dir, int
static void send_file_entry(int f, struct file_struct *file, int ndx)
{
static time_t modtime;
static mode_t mode;
static int64 dev;
static dev_t rdev;
-@@ -416,6 +421,13 @@ static void send_file_entry(int f, struc
+@@ -419,6 +424,13 @@ static void send_file_entry(int f, struc
flags |= XMIT_SAME_TIME;
else
modtime = file->modtime;
#ifdef SUPPORT_HARD_LINKS
if (tmp_dev != 0) {
-@@ -483,6 +495,8 @@ static void send_file_entry(int f, struc
+@@ -486,6 +498,8 @@ static void send_file_entry(int f, struc
write_int(f, modtime);
if (!(flags & XMIT_SAME_MODE))
write_int(f, to_wire_mode(mode));
if (preserve_uid && !(flags & XMIT_SAME_UID)) {
if (protocol_version < 30)
write_int(f, uid);
-@@ -569,7 +583,7 @@ static void send_file_entry(int f, struc
+@@ -572,7 +586,7 @@ static void send_file_entry(int f, struc
static struct file_struct *recv_file_entry(struct file_list *flist,
int flags, int f)
{
static mode_t mode;
static int64 dev;
static dev_t rdev;
-@@ -667,6 +681,8 @@ static struct file_struct *recv_file_ent
+@@ -670,6 +684,8 @@ static struct file_struct *recv_file_ent
modtime = (time_t)read_int(f);
if (!(flags & XMIT_SAME_MODE))
mode = from_wire_mode(read_int(f));
if (chmod_modes && !S_ISLNK(mode))
mode = tweak_mode(mode, chmod_modes);
-@@ -791,6 +807,8 @@ static struct file_struct *recv_file_ent
+@@ -794,6 +810,8 @@ static struct file_struct *recv_file_ent
F_OWNER(file) = uid;
if (preserve_gid)
F_GROUP(file) = gid;
if (basename != thisname) {
file->dirname = lastdir;
-@@ -1096,6 +1114,8 @@ struct file_struct *make_file(const char
+@@ -1103,6 +1121,8 @@ struct file_struct *make_file(const char
F_OWNER(file) = st.st_uid;
if (preserve_gid)
F_GROUP(file) = st.st_gid;
file->dirname = lastdir;
--- old/generator.c
+++ new/generator.c
-@@ -44,6 +44,7 @@ extern int preserve_perms;
+@@ -45,6 +45,7 @@ extern int preserve_perms;
extern int preserve_uid;
extern int preserve_gid;
extern int preserve_times;
extern int omit_dir_times;
extern int delete_mode;
extern int delete_before;
-@@ -552,6 +553,9 @@ void itemize(const char *fname, struct f
+@@ -561,6 +562,9 @@ void itemize(const char *fnamecmp, struc
&& (!(iflags & ITEM_XNAME_FOLLOWS) || *xname))
|| (keep_time && cmp_time(file->modtime, sxp->st.st_mtime) != 0))
iflags |= ITEM_REPORT_TIME;
if (!BITS_EQUAL(sxp->st.st_mode, file->mode, CHMOD_BITS))
iflags |= ITEM_REPORT_PERMS;
if (preserve_uid && am_root && F_UID(file) != sxp->st.st_uid)
-@@ -852,6 +856,8 @@ static int try_dests_reg(struct file_str
+@@ -878,6 +882,8 @@ static int try_dests_reg(struct file_str
if (link_dest) {
if (!hard_link_one(file, fname, cmpbuf, 1))
goto try_a_copy;
if (preserve_hard_links && F_IS_HLINKED(file))
finish_hard_link(file, fname, &sxp->st, itemizing, code, j);
if (itemizing && (verbose > 1 || stdout_format_has_i > 1)) {
-@@ -1700,7 +1706,7 @@ static void touch_up_dirs(struct file_li
+@@ -1741,7 +1747,7 @@ static void touch_up_dirs(struct file_li
if (!(file->mode & S_IWUSR))
do_chmod(fname, file->mode);
if (need_retouch_dir_times)
c[11] = '\0';
--- old/options.c
+++ new/options.c
-@@ -55,6 +55,7 @@ int preserve_uid = 0;
+@@ -56,6 +56,7 @@ int preserve_uid = 0;
int preserve_gid = 0;
int preserve_times = 0;
int omit_dir_times = 0;
int update_only = 0;
int cvs_exclude = 0;
int dry_run = 0;
-@@ -315,8 +316,9 @@ void usage(enum logcode F)
+@@ -323,8 +324,9 @@ void usage(enum logcode F)
rprintf(F," --devices preserve device files (super-user only)\n");
rprintf(F," --specials preserve special files\n");
rprintf(F," -D same as --devices --specials\n");
rprintf(F," --super receiver attempts super-user activities\n");
rprintf(F," -S, --sparse handle sparse files efficiently\n");
rprintf(F," -n, --dry-run show what would have been transferred\n");
-@@ -436,6 +438,9 @@ static struct poptOption long_options[]
+@@ -451,6 +453,9 @@ static struct poptOption long_options[]
{"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 },
{"omit-dir-times", 'O', POPT_ARG_VAL, &omit_dir_times, 2, 0, 0 },
{"modify-window", 0, POPT_ARG_INT, &modify_window, OPT_MODIFY_WINDOW, 0, 0 },
{"super", 0, POPT_ARG_VAL, &am_root, 2, 0, 0 },
-@@ -1577,6 +1582,8 @@ void server_options(char **args,int *arg
+@@ -1603,6 +1608,8 @@ void server_options(char **args,int *arg
argstr[x++] = 'D';
if (preserve_times)
argstr[x++] = 't';
else if (preserve_executability && am_sender)
--- old/rsync.c
+++ new/rsync.c
-@@ -34,6 +34,7 @@ extern int dry_run;
- extern int preserve_acls;
+@@ -35,6 +35,7 @@ extern int preserve_acls;
+ extern int preserve_xattrs;
extern int preserve_perms;
extern int preserve_executability;
+extern int preserve_atimes;
extern int preserve_times;
extern int omit_dir_times;
extern int am_root;
-@@ -234,6 +235,7 @@ int set_file_attrs(char *fname, struct f
+@@ -228,6 +229,7 @@ int set_file_attrs(const char *fname, st
int updated = 0;
statx sx2;
int change_uid, change_gid;
mode_t new_mode = file->mode;
if (!sxp) {
-@@ -261,18 +263,36 @@ int set_file_attrs(char *fname, struct f
- get_acl(fname, sxp);
+@@ -263,18 +265,36 @@ int set_file_attrs(const char *fname, st
+ set_xattr(fname, file, fnamecmp, sxp);
#endif
+ /* This code must be the first update in the function due to
#define FULL_FLUSH 1
#define NORMAL_FLUSH 0
-@@ -571,6 +573,7 @@ extern int file_extra_cnt;
+@@ -568,6 +570,7 @@ struct file_struct {
+ extern int file_extra_cnt;
extern int preserve_uid;
extern int preserve_gid;
- extern int preserve_acls;
+extern int preserve_atimes;
+ extern int preserve_acls;
+ extern int preserve_xattrs;
- #define FILE_STRUCT_LEN (offsetof(struct file_struct, basename))
- #define EXTRA_LEN (sizeof (union file_extras))
-@@ -603,6 +606,7 @@ extern int preserve_acls;
+@@ -602,6 +605,7 @@ extern int preserve_xattrs;
/* When the associated option is on, all entries will have these present: */
#define F_OWNER(f) REQ_EXTRA(f, preserve_uid)->unum
#define F_GROUP(f) REQ_EXTRA(f, preserve_gid)->unum
+#define F_ATIME(f) REQ_EXTRA(f, preserve_atimes)->unum
- #define F_ACL(f) REQ_EXTRA(f, preserve_acls)->unum
+ #define F_ACL(f) REQ_EXTRA(f, preserve_acls)->num
+ #define F_XATTR(f) REQ_EXTRA(f, preserve_xattrs)->num
- /* These items are per-entry optional and mutally exclusive: */
--- old/rsync.yo
+++ new/rsync.yo
-@@ -329,8 +329,9 @@ to the detailed description below for a
+@@ -330,8 +330,9 @@ to the detailed description below for a
--devices preserve device files (super-user only)
--specials preserve special files
-D same as --devices --specials
--super receiver attempts super-user activities
-S, --sparse handle sparse files efficiently
-n, --dry-run show what would have been transferred
-@@ -896,6 +897,12 @@ it is preserving modification times (see
+@@ -902,6 +903,12 @@ it is preserving modification times (see
the directories on the receiving side, it is a good idea to use bf(-O).
This option is inferred if you use bf(--backup) without bf(--backup-dir).
dit(bf(--super)) This tells the receiving side to attempt super-user
activities even if the receiving rsync wasn't run by the super-user. These
activities include: preserving users via the bf(--owner) option, preserving
-@@ -1482,7 +1489,7 @@ quote(itemization(
+@@ -1488,7 +1495,7 @@ quote(itemization(
by the file transfer.
it() A bf(t) means the modification time is different and is being updated
to the sender's value (requires bf(--times)). An alternate value of bf(T)
anytime a symlink is transferred, or when a file or device is transferred
without bf(--times).
it() A bf(p) means the permissions are different and are being updated to
-@@ -1491,8 +1498,10 @@ quote(itemization(
+@@ -1497,8 +1504,10 @@ quote(itemization(
sender's value (requires bf(--owner) and super-user privileges).
it() A bf(g) means the group is different and is being updated to the
sender's value (requires bf(--group) and the authority to set the group).
(a feature that is not yet released).
--- old/sender.c
+++ new/sender.c
-@@ -41,6 +41,7 @@ extern int do_progress;
+@@ -43,6 +43,7 @@ extern int do_progress;
extern int inplace;
extern int batch_fd;
extern int write_batch;
--- old/compat.c
+++ new/compat.c
-@@ -63,6 +63,8 @@ void setup_protocol(int f_out,int f_in)
+@@ -64,6 +64,8 @@ void setup_protocol(int f_out,int f_in)
preserve_uid = ++file_extra_cnt;
if (preserve_gid)
preserve_gid = ++file_extra_cnt;
+ preserve_fileflags = ++file_extra_cnt;
if (preserve_acls && !am_sender)
preserve_acls = ++file_extra_cnt;
-
+ if (preserve_xattrs)
--- old/configure.in
+++ new/configure.in
@@ -559,7 +559,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strd
AC_CHECK_FUNCS(getpgrp tcgetpgrp)
--- old/flist.c
+++ new/flist.c
-@@ -47,6 +47,7 @@ extern int preserve_links;
+@@ -48,6 +48,7 @@ extern int preserve_links;
extern int preserve_hard_links;
extern int preserve_devices;
extern int preserve_specials;
extern int preserve_uid;
extern int preserve_gid;
extern int relative_paths;
-@@ -352,6 +353,9 @@ static void send_file_entry(int f, struc
+@@ -353,6 +354,9 @@ static void send_file_entry(int f, struc
{
static time_t modtime;
static mode_t mode;
static int64 dev;
static dev_t rdev;
static uint32 rdev_major;
-@@ -372,6 +376,12 @@ static void send_file_entry(int f, struc
+@@ -373,6 +377,12 @@ static void send_file_entry(int f, struc
flags |= XMIT_SAME_MODE;
else
mode = file->mode;
if ((preserve_devices && IS_DEVICE(mode))
|| (preserve_specials && IS_SPECIAL(mode))) {
if (protocol_version < 28) {
-@@ -485,6 +495,10 @@ static void send_file_entry(int f, struc
+@@ -486,6 +496,10 @@ static void send_file_entry(int f, struc
write_int(f, modtime);
if (!(flags & XMIT_SAME_MODE))
write_int(f, to_wire_mode(mode));
if (preserve_uid && !(flags & XMIT_SAME_UID)) {
if (protocol_version < 30)
write_int(f, uid);
-@@ -573,6 +587,9 @@ static struct file_struct *recv_file_ent
+@@ -574,6 +588,9 @@ static struct file_struct *recv_file_ent
{
static time_t modtime;
static mode_t mode;
static int64 dev;
static dev_t rdev;
static uint32 rdev_major;
-@@ -669,9 +686,12 @@ static struct file_struct *recv_file_ent
+@@ -670,9 +687,12 @@ static struct file_struct *recv_file_ent
modtime = (time_t)read_int(f);
if (!(flags & XMIT_SAME_MODE))
mode = from_wire_mode(read_int(f));
if (preserve_uid && !(flags & XMIT_SAME_UID)) {
if (protocol_version < 30)
-@@ -789,6 +809,10 @@ static struct file_struct *recv_file_ent
+@@ -790,6 +810,10 @@ static struct file_struct *recv_file_ent
OPT_EXTRA(file, 0)->unum = (uint32)(file_length >> 32);
}
file->mode = mode;
if (preserve_uid)
F_OWNER(file) = uid;
if (preserve_gid)
-@@ -1094,6 +1118,10 @@ struct file_struct *make_file(const char
+@@ -1099,6 +1123,10 @@ struct file_struct *make_file(const char
OPT_EXTRA(file, 0)->unum = (uint32)(st.st_size >> 32);
}
file->mode = st.st_mode;
if (preserve_gid)
--- old/generator.c
+++ new/generator.c
-@@ -111,6 +111,14 @@ static int dir_tweaking;
+@@ -112,6 +112,14 @@ static int dir_tweaking;
static int need_retouch_dir_times;
static const char *solo_file = NULL;
/* For calling delete_item() and delete_dir_contents(). */
#define DEL_RECURSE (1<<1) /* recurse */
#define DEL_DIR_IS_EMPTY (1<<2) /* internal delete_FUNCTIONS use only */
-@@ -126,7 +134,6 @@ enum delret {
+@@ -127,7 +135,6 @@ enum delret {
/* Forward declaration for delete_item(). */
static enum delret delete_dir_contents(char *fname, int flags);
static int is_backup_file(char *fn)
{
int k = strlen(fn) - backup_suffix_len;
-@@ -139,17 +146,20 @@ static int is_backup_file(char *fn)
+@@ -140,17 +147,20 @@ static int is_backup_file(char *fn)
* Note that fbuf must point to a MAXPATHLEN buffer if the mode indicates it's
* a directory! (The buffer is used for recursion, but returned unchanged.)
*/
if (S_ISDIR(mode) && !(flags & DEL_DIR_IS_EMPTY)) {
ignore_perishable = 1;
/* If DEL_RECURSE is not set, this just reports emptiness. */
-@@ -261,7 +271,7 @@ static enum delret delete_dir_contents(c
+@@ -262,7 +272,7 @@ static enum delret delete_dir_contents(c
if (S_ISDIR(fp->mode)
&& delete_dir_contents(fname, flags | DEL_RECURSE) != DR_SUCCESS)
ret = DR_NOT_EMPTY;
ret = DR_NOT_EMPTY;
}
-@@ -317,8 +327,9 @@ static int remember_delete(struct file_s
+@@ -318,8 +328,9 @@ static int remember_delete(struct file_s
while (1) {
len = snprintf(deldelay_buf + deldelay_cnt,
if ((deldelay_cnt += len) <= deldelay_size)
break;
if (deldelay_fd < 0 && !start_delete_delay_temp())
-@@ -331,7 +342,7 @@ static int remember_delete(struct file_s
+@@ -332,7 +343,7 @@ static int remember_delete(struct file_s
return 1;
}
{
static int read_pos = 0;
int j, len, mode;
-@@ -373,7 +384,7 @@ static int read_delay_line(char *buf)
+@@ -374,7 +385,7 @@ static int read_delay_line(char *buf)
bp = deldelay_buf + read_pos;
invalid_data:
rprintf(FERROR, "ERROR: invalid data in delete-delay file.\n");
return -1;
-@@ -396,15 +407,15 @@ static int read_delay_line(char *buf)
+@@ -397,15 +408,15 @@ static int read_delay_line(char *buf)
static void do_delayed_deletions(char *delbuf)
{
if (deldelay_fd >= 0)
close(deldelay_fd);
}
-@@ -472,7 +483,7 @@ static void delete_in_dir(struct file_li
+@@ -473,7 +484,7 @@ static void delete_in_dir(struct file_li
if (!remember_delete(fp, delbuf))
break;
} else
}
}
-@@ -1178,7 +1189,7 @@ static void recv_generator(char *fname,
+@@ -1211,7 +1222,7 @@ static void recv_generator(char *fname,
* we need to delete it. If it doesn't exist, then
* (perhaps recursively) create it. */
if (statret == 0 && !S_ISDIR(sx.st.st_mode)) {
return;
statret = -1;
}
-@@ -1291,7 +1302,7 @@ static void recv_generator(char *fname,
+@@ -1324,7 +1335,7 @@ static void recv_generator(char *fname,
}
/* Not the right symlink (or not a symlink), so
* delete it. */
goto cleanup;
} else if (basis_dir[0] != NULL) {
int j = try_dests_non(file, fname, ndx, fnamecmpbuf, &sx,
-@@ -1368,7 +1379,7 @@ static void recv_generator(char *fname,
+@@ -1401,7 +1412,7 @@ static void recv_generator(char *fname,
goto return_with_success;
goto cleanup;
}
goto cleanup;
} else if (basis_dir[0] != NULL) {
int j = try_dests_non(file, fname, ndx, fnamecmpbuf, &sx,
-@@ -1457,7 +1468,7 @@ static void recv_generator(char *fname,
+@@ -1490,7 +1501,7 @@ static void recv_generator(char *fname,
fnamecmp_type = FNAMECMP_FNAME;
if (statret == 0 && !S_ISREG(sx.st.st_mode)) {
stat_errno = ENOENT;
--- old/options.c
+++ new/options.c
-@@ -48,6 +48,7 @@ int preserve_links = 0;
- int preserve_hard_links = 0;
+@@ -49,6 +49,7 @@ int preserve_hard_links = 0;
int preserve_acls = 0;
+ int preserve_xattrs = 0;
int preserve_perms = 0;
+int preserve_fileflags = 0;
int preserve_executability = 0;
int preserve_devices = 0;
int preserve_specials = 0;
-@@ -203,6 +204,7 @@ static void print_rsync_version(enum log
- char const *acls = "no ";
+@@ -205,6 +206,7 @@ static void print_rsync_version(enum log
+ char const *xattrs = "no ";
char const *links = "no ";
char const *ipv6 = "no ";
+ char const *fileflags = "no ";
STRUCT_STAT *dumstat;
#ifdef HAVE_SOCKETPAIR
-@@ -229,6 +231,10 @@ static void print_rsync_version(enum log
+@@ -233,6 +235,10 @@ static void print_rsync_version(enum log
ipv6 = "";
#endif
rprintf(f, "%s version %s protocol version %d\n",
RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION);
rprintf(f, "Copyright (C) 1996-2007 by Andrew Tridgell, Wayne Davison, and others.\n");
-@@ -239,8 +245,8 @@ static void print_rsync_version(enum log
+@@ -243,8 +249,8 @@ static void print_rsync_version(enum log
(int)(sizeof (int64) * 8));
rprintf(f, " %ssocketpairs, %shardlinks, %ssymlinks, %sIPv6, batchfiles, %sinplace,\n",
got_socketpair, hardlinks, links, ipv6, have_inplace);
-- rprintf(f, " %sappend, %sACLs\n",
-- have_inplace, acls);
-+ rprintf(f, " %sappend, %sACLs, %sfile-flags\n",
-+ have_inplace, acls, fileflags);
+- rprintf(f, " %sappend, %sACLs, %sxattrs\n",
+- have_inplace, acls, xattrs);
++ rprintf(f, " %sappend, %sACLs, %sxattrs, %sfile-flags\n",
++ have_inplace, acls, xattrs, fileflags);
#ifdef MAINTAINER_MODE
rprintf(f, "Panic Action: \"%s\"\n", get_panic_action());
-@@ -306,6 +312,7 @@ void usage(enum logcode F)
+@@ -310,6 +316,7 @@ void usage(enum logcode F)
rprintf(F," -K, --keep-dirlinks treat symlinked dir on receiver as dir\n");
rprintf(F," -H, --hard-links preserve hard links\n");
rprintf(F," -p, --perms preserve permissions\n");
rprintf(F," -E, --executability preserve the file's executability\n");
rprintf(F," --chmod=CHMOD affect file and/or directory permissions\n");
#ifdef SUPPORT_ACLS
-@@ -434,6 +441,8 @@ static struct poptOption long_options[]
+@@ -441,6 +448,8 @@ static struct poptOption long_options[]
{"perms", 'p', POPT_ARG_VAL, &preserve_perms, 1, 0, 0 },
{"no-perms", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
{"no-p", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
{"executability", 'E', POPT_ARG_NONE, &preserve_executability, 0, 0, 0 },
{"acls", 'A', POPT_ARG_NONE, 0, 'A', 0, 0 },
{"no-acls", 0, POPT_ARG_VAL, &preserve_acls, 0, 0, 0 },
-@@ -1166,6 +1175,15 @@ int parse_arguments(int *argc, const cha
+@@ -1187,6 +1196,15 @@ int parse_arguments(int *argc, const cha
}
#endif
if (write_batch && read_batch) {
snprintf(err_buf, sizeof err_buf,
"--write-batch and --read-batch can not be used together\n");
-@@ -1629,6 +1647,9 @@ void server_options(char **args,int *arg
+@@ -1654,6 +1672,9 @@ void server_options(char **args,int *arg
if (xfer_dirs && !recurse && delete_mode && am_sender)
args[ac++] = "--no-r";
goto oom;
--- old/rsync.c
+++ new/rsync.c
-@@ -33,6 +33,7 @@ extern int verbose;
- extern int dry_run;
+@@ -34,6 +34,7 @@ extern int dry_run;
extern int preserve_acls;
+ extern int preserve_xattrs;
extern int preserve_perms;
+extern int preserve_fileflags;
extern int preserve_executability;
extern int preserve_times;
extern int omit_dir_times;
-@@ -53,6 +54,16 @@ extern int make_backups;
+@@ -54,6 +55,16 @@ extern int make_backups;
extern struct file_list *cur_flist, *first_flist, *dir_flist;
extern struct chmod_mode_struct *daemon_chmod_modes;
#if defined HAVE_ICONV_OPEN && defined HAVE_ICONV_H
iconv_t ic_chck = (iconv_t)-1;
-@@ -228,6 +239,41 @@ mode_t dest_mode(mode_t flist_mode, mode
+@@ -222,6 +233,41 @@ mode_t dest_mode(mode_t flist_mode, mode
return new_mode;
}
+}
+#endif
+
- int set_file_attrs(char *fname, struct file_struct *file, statx *sxp,
- int flags)
+ int set_file_attrs(const char *fname, struct file_struct *file, statx *sxp,
+ const char *fnamecmp, int flags)
{
-@@ -346,6 +392,15 @@ int set_file_attrs(char *fname, struct f
+@@ -348,6 +394,15 @@ int set_file_attrs(const char *fname, st
}
#endif
if (verbose > 1 && flags & ATTRS_REPORT) {
if (updated)
rprintf(FCLIENT, "%s\n", fname);
-@@ -398,6 +453,9 @@ void finish_transfer(char *fname, char *
- set_file_attrs(fnametmp, file, NULL,
+@@ -407,6 +462,9 @@ void finish_transfer(const char *fname,
+ set_file_attrs(fnametmp, file, NULL, fnamecmp,
ok_to_set_time ? 0 : ATTRS_SKIP_MTIME);
+#ifdef SUPPORT_FLAGS
/* move tmp file over real file */
if (verbose > 2)
rprintf(FINFO, "renaming %s to %s\n", fnametmp, fname);
-@@ -412,6 +470,9 @@ void finish_transfer(char *fname, char *
+@@ -421,6 +479,9 @@ void finish_transfer(const char *fname,
}
if (ret == 0) {
/* The file was moved into place (not copied), so it's done. */
extern int preserve_gid;
+extern int preserve_fileflags;
extern int preserve_acls;
+ extern int preserve_xattrs;
- #define FILE_STRUCT_LEN (offsetof(struct file_struct, basename))
-@@ -601,6 +607,7 @@ extern int preserve_acls;
+@@ -602,6 +608,7 @@ extern int preserve_xattrs;
/* When the associated option is on, all entries will have these present: */
#define F_OWNER(f) REQ_EXTRA(f, preserve_uid)->unum
#define F_GROUP(f) REQ_EXTRA(f, preserve_gid)->unum
+#define F_FFLAGS(f) REQ_EXTRA(f, preserve_fileflags)->unum
- #define F_ACL(f) REQ_EXTRA(f, preserve_acls)->unum
+ #define F_ACL(f) REQ_EXTRA(f, preserve_acls)->num
+ #define F_XATTR(f) REQ_EXTRA(f, preserve_xattrs)->num
- /* These items are per-entry optional and mutally exclusive: */
--- old/rsync.yo
+++ new/rsync.yo
@@ -321,6 +321,7 @@ to the detailed description below for a
-E, --executability preserve executability
--chmod=CHMOD affect file and/or directory permissions
-A, --acls preserve ACLs (implies -p)
-@@ -511,7 +512,9 @@ specified, in which case bf(-r) is not i
+@@ -512,7 +513,9 @@ specified, in which case bf(-r) is not i
Note that bf(-a) bf(does not preserve hardlinks), because
finding multiply-linked files is expensive. You must separately
dit(--no-OPTION) You may turn off one or more implied options by prefixing
the option name with "no-". Not all options may be prefixed with a "no-":
-@@ -831,6 +834,13 @@ dit(bf(-A, --acls)) This option causes r
- ACLs to be the same as the source ACLs. This nonstandard option only
- works if the remote rsync also supports it. bf(--acls) implies bf(--perms).
+@@ -837,6 +840,13 @@ extended attributes to be the same as th
+ only if the remote machine's rsync supports this option also. This is
+ a non-standard option.
+dit(bf(--flags)) This option causes rsync to update the change file flags
+to be the same as the source file, if your OS supports the bf(chflags)(2)
int preserve_links = 0;
int preserve_hard_links = 0;
int preserve_acls = 0;
-@@ -345,6 +346,7 @@ void usage(enum logcode F)
+@@ -352,6 +353,7 @@ void usage(enum logcode F)
rprintf(F," --partial-dir=DIR put a partially transferred file into DIR\n");
rprintf(F," --delay-updates put all updated files into place at transfer's end\n");
rprintf(F," -m, --prune-empty-dirs prune empty directory chains from the file-list\n");
rprintf(F," --numeric-ids don't map uid/gid values by user/group name\n");
rprintf(F," --timeout=TIME set I/O timeout in seconds\n");
rprintf(F," -I, --ignore-times don't skip files that match in size and mod-time\n");
-@@ -539,6 +541,7 @@ static struct poptOption long_options[]
+@@ -549,6 +551,7 @@ static struct poptOption long_options[]
{"only-write-batch", 0, POPT_ARG_STRING, &batch_name, OPT_ONLY_WRITE_BATCH, 0, 0 },
{"files-from", 0, POPT_ARG_STRING, &files_from, 0, 0, 0 },
{"from0", '0', POPT_ARG_NONE, &eol_nulls, 0, 0, 0},
{"numeric-ids", 0, POPT_ARG_NONE, &numeric_ids, 0, 0, 0 },
{"timeout", 0, POPT_ARG_INT, &io_timeout, 0, 0, 0 },
{"rsh", 'e', POPT_ARG_STRING, &shell_cmd, 0, 0, 0 },
-@@ -1777,6 +1780,9 @@ void server_options(char **args,int *arg
+@@ -1802,6 +1805,9 @@ void server_options(char **args,int *arg
args[ac++] = tmpdir;
}
* and it may be an older version that doesn't know this
--- old/receiver.c
+++ new/receiver.c
-@@ -37,6 +37,7 @@ extern int protocol_version;
- extern int relative_paths;
+@@ -39,6 +39,7 @@ extern int relative_paths;
extern int preserve_hard_links;
extern int preserve_perms;
+ extern int preserve_xattrs;
+extern int do_fsync;
extern int basis_dir_cnt;
extern int make_backups;
extern int cleanup_got_literal;
-@@ -257,6 +258,12 @@ static int receive_data(int f_in, char *
+@@ -259,6 +260,12 @@ static int receive_data(int f_in, char *
exit_cleanup(RERR_FILEIO);
}
@@ -35,7 +35,7 @@ OBJS1=flist.o rsync.o generator.o receiv
util.o main.o checksum.o match.o syscall.o log.o backup.o
OBJS2=options.o io.o compat.o hlink.o token.o uidlist.o socket.o \
- fileio.o batch.o clientname.o chmod.o acls.o
+ fileio.o batch.o clientname.o chmod.o acls.o xattrs.o
-OBJS3=progress.o pipe.o
+OBJS3=progress.o pipe.o hashlink.o
DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
popt/popthelp.o popt/poptparse.o
--- old/flist.c
+++ new/flist.c
-@@ -60,6 +60,7 @@ extern int copy_unsafe_links;
+@@ -61,6 +61,7 @@ extern int copy_unsafe_links;
extern int protocol_version;
extern int sanitize_paths;
extern struct stats stats;
extern char curr_dir[MAXPATHLEN];
-@@ -747,7 +748,7 @@ static struct file_struct *recv_file_ent
+@@ -748,7 +749,7 @@ static struct file_struct *recv_file_ent
extra_len += (S_ISDIR(mode) ? 2 : 1) * EXTRA_LEN;
#endif
+#endif
--- old/options.c
+++ new/options.c
-@@ -145,6 +145,7 @@ char *backup_suffix = NULL;
+@@ -146,6 +146,7 @@ char *backup_suffix = NULL;
char *tmpdir = NULL;
char *partial_dir = NULL;
char *basis_dir[MAX_BASIS_DIRS+1];
char *config_file = NULL;
char *shell_cmd = NULL;
char *logfile_name = NULL;
-@@ -355,6 +356,7 @@ void usage(enum logcode F)
+@@ -362,6 +363,7 @@ void usage(enum logcode F)
rprintf(F," --compare-dest=DIR also compare destination files relative to DIR\n");
rprintf(F," --copy-dest=DIR ... and include copies of unchanged files\n");
rprintf(F," --link-dest=DIR hardlink to files in DIR when unchanged\n");
rprintf(F," -z, --compress compress file data during the transfer\n");
rprintf(F," --compress-level=NUM explicitly set compression level\n");
rprintf(F," -C, --cvs-exclude auto-ignore files the same way CVS does\n");
-@@ -404,7 +406,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OP
+@@ -411,7 +413,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OP
OPT_FILTER, OPT_COMPARE_DEST, OPT_COPY_DEST, OPT_LINK_DEST, OPT_HELP,
OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW, OPT_MIN_SIZE, OPT_CHMOD,
OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_ONLY_WRITE_BATCH, OPT_MAX_SIZE,
OPT_SERVER, OPT_REFUSED_BASE = 9000};
static struct poptOption long_options[] = {
-@@ -513,6 +515,7 @@ static struct poptOption long_options[]
+@@ -523,6 +525,7 @@ static struct poptOption long_options[]
{"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 },
{"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 },
{"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 },
{"fuzzy", 'y', POPT_ARG_NONE, &fuzzy_basis, 0, 0, 0 },
{"compress", 'z', POPT_ARG_NONE, 0, 'z', 0, 0 },
{"compress-level", 0, POPT_ARG_INT, &def_compress_level, 'z', 0, 0 },
-@@ -1127,6 +1130,21 @@ int parse_arguments(int *argc, const cha
+@@ -1148,6 +1151,21 @@ int parse_arguments(int *argc, const cha
+ return 0;
#endif
-
+ case OPT_LINK_BY_HASH:
+#ifdef HAVE_LINK
+ arg = poptGetOptArg(pc);
default:
/* A large opt value means that set_refuse_options()
* turned this option off. */
-@@ -1789,6 +1807,11 @@ void server_options(char **args,int *arg
+@@ -1814,6 +1832,11 @@ void server_options(char **args,int *arg
}
}
args[ac++] = "--files-from";
--- old/receiver.c
+++ new/receiver.c
-@@ -123,12 +123,14 @@ int get_tmpname(char *fnametmp, char *fn
+@@ -125,12 +125,14 @@ int get_tmpname(char *fnametmp, char *fn
static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
int32 len, sum_len;
OFF_T offset = 0;
OFF_T offset2;
-@@ -148,6 +150,9 @@ static int receive_data(int f_in, char *
+@@ -150,6 +152,9 @@ static int receive_data(int f_in, char *
} else
mapbuf = NULL;
sum_init(checksum_seed);
if (append_mode > 0) {
-@@ -190,6 +195,8 @@ static int receive_data(int f_in, char *
+@@ -192,6 +197,8 @@ static int receive_data(int f_in, char *
cleanup_got_literal = 1;
sum_update(data, i);
if (fd != -1 && write_file(fd,data,i) != i)
goto report_write_error;
-@@ -216,6 +223,8 @@ static int receive_data(int f_in, char *
+@@ -218,6 +225,8 @@ static int receive_data(int f_in, char *
see_token(map, len);
sum_update(map, len);
}
if (updating_basis) {
-@@ -258,6 +267,8 @@ static int receive_data(int f_in, char *
+@@ -260,6 +269,8 @@ static int receive_data(int f_in, char *
}
sum_len = sum_end(file_sum1);
if (mapbuf)
unmap_file(mapbuf);
-@@ -273,7 +284,7 @@ static int receive_data(int f_in, char *
+@@ -275,7 +286,7 @@ static int receive_data(int f_in, char *
static void discard_receive_data(int f_in, OFF_T length)
{
}
static void handle_delayed_updates(char *local_name)
-@@ -635,7 +646,7 @@ int recv_files(int f_in, char *local_nam
+@@ -646,7 +657,7 @@ int recv_files(int f_in, char *local_nam
/* recv file data */
recv_ok = receive_data(f_in, fnamecmp, fd1, st.st_size,
--- old/rsync.c
+++ new/rsync.c
-@@ -50,6 +50,7 @@ extern int inplace;
+@@ -51,6 +51,7 @@ extern int inplace;
extern int flist_eof;
extern int keep_dirlinks;
extern int make_backups;
extern struct file_list *cur_flist, *first_flist, *dir_flist;
extern struct chmod_mode_struct *daemon_chmod_modes;
-@@ -401,8 +402,15 @@ void finish_transfer(char *fname, char *
+@@ -410,8 +411,15 @@ void finish_transfer(const char *fname,
/* move tmp file over real file */
if (verbose > 2)
rprintf(FINFO, "renaming %s to %s\n", fnametmp, fname);
ret == -2 ? "copy" : "rename",
--- old/rsync.h
+++ new/rsync.h
-@@ -756,6 +756,14 @@ struct stats {
+@@ -758,6 +758,14 @@ struct stats {
int current_file_index;
};
#define EMPTY_ITEM_LIST {NULL, 0, 0}
--- old/rsync.yo
+++ new/rsync.yo
-@@ -368,6 +368,7 @@ to the detailed description below for a
+@@ -369,6 +369,7 @@ to the detailed description below for a
--compare-dest=DIR also compare received files relative to DIR
--copy-dest=DIR ... and include copies of unchanged files
--link-dest=DIR hardlink to files in DIR when unchanged
*cygwin* ) AC_MSG_RESULT(yes)
--- old/options.c
+++ new/options.c
-@@ -172,6 +172,14 @@ int logfile_format_has_o_or_i = 0;
+@@ -174,6 +174,14 @@ int logfile_format_has_o_or_i = 0;
int always_checksum = 0;
int list_only = 0;
#define MAX_BATCH_NAME_LEN 256 /* Must be less than MAXPATHLEN-13 */
char *batch_name = NULL;
-@@ -202,6 +210,7 @@ static void print_rsync_version(enum log
- char const *acls = "no ";
+@@ -205,6 +213,7 @@ static void print_rsync_version(enum log
+ char const *xattrs = "no ";
char const *links = "no ";
char const *ipv6 = "no ";
+ char const *ssl = "no ";
STRUCT_STAT *dumstat;
#ifdef HAVE_SOCKETPAIR
-@@ -228,6 +237,10 @@ static void print_rsync_version(enum log
+@@ -233,6 +242,10 @@ static void print_rsync_version(enum log
ipv6 = "";
#endif
rprintf(f, "%s version %s protocol version %d\n",
RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION);
rprintf(f, "Copyright (C) 1996-2007 by Andrew Tridgell, Wayne Davison, and others.\n");
-@@ -238,8 +251,8 @@ static void print_rsync_version(enum log
+@@ -243,8 +256,8 @@ static void print_rsync_version(enum log
(int)(sizeof (int64) * 8));
rprintf(f, " %ssocketpairs, %shardlinks, %ssymlinks, %sIPv6, batchfiles, %sinplace,\n",
got_socketpair, hardlinks, links, ipv6, have_inplace);
-- rprintf(f, " %sappend, %sACLs\n",
-- have_inplace, acls);
-+ rprintf(f, " %sappend, %sACLs, %sSSL\n",
-+ have_inplace, acls, ssl);
+- rprintf(f, " %sappend, %sACLs, %sxattrs\n",
+- have_inplace, acls, xattrs);
++ rprintf(f, " %sappend, %sACLs, %sxattrs, %sSSL\n",
++ have_inplace, acls, xattrs, ssl);
#ifdef MAINTAINER_MODE
rprintf(f, "Panic Action: \"%s\"\n", get_panic_action());
-@@ -390,6 +403,13 @@ void usage(enum logcode F)
+@@ -398,6 +411,13 @@ void usage(enum logcode F)
rprintf(F," -4, --ipv4 prefer IPv4\n");
rprintf(F," -6, --ipv6 prefer IPv6\n");
#endif
rprintf(F," --version print version number\n");
rprintf(F,"(-h) --help show this help (-h works with no other options)\n");
-@@ -403,7 +423,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OP
+@@ -411,7 +431,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OP
OPT_FILTER, OPT_COMPARE_DEST, OPT_COPY_DEST, OPT_LINK_DEST, OPT_HELP,
OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW, OPT_MIN_SIZE, OPT_CHMOD,
OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_ONLY_WRITE_BATCH, OPT_MAX_SIZE,
OPT_SERVER, OPT_REFUSED_BASE = 9000};
static struct poptOption long_options[] = {
-@@ -554,6 +574,13 @@ static struct poptOption long_options[]
+@@ -569,6 +589,13 @@ static struct poptOption long_options[]
{"checksum-seed", 0, POPT_ARG_INT, &checksum_seed, 0, 0, 0 },
{"server", 0, POPT_ARG_NONE, 0, OPT_SERVER, 0, 0 },
{"sender", 0, POPT_ARG_NONE, 0, OPT_SENDER, 0, 0 },
/* All the following options switch us into daemon-mode option-parsing. */
{"config", 0, POPT_ARG_STRING, 0, OPT_DAEMON, 0, 0 },
{"daemon", 0, POPT_ARG_NONE, 0, OPT_DAEMON, 0, 0 },
-@@ -581,6 +608,13 @@ static void daemon_usage(enum logcode F)
+@@ -596,6 +623,13 @@ static void daemon_usage(enum logcode F)
rprintf(F," -4, --ipv4 prefer IPv4\n");
rprintf(F," -6, --ipv6 prefer IPv6\n");
#endif
rprintf(F," --help show this help screen\n");
rprintf(F,"\n");
-@@ -607,6 +641,13 @@ static struct poptOption long_daemon_opt
+@@ -622,6 +656,13 @@ static struct poptOption long_daemon_opt
{"protocol", 0, POPT_ARG_INT, &protocol_version, 0, 0, 0 },
{"server", 0, POPT_ARG_NONE, &am_server, 0, 0, 0 },
{"temp-dir", 'T', POPT_ARG_STRING, &tmpdir, 0, 0, 0 },
{"verbose", 'v', POPT_ARG_NONE, 0, 'v', 0, 0 },
{"no-verbose", 0, POPT_ARG_VAL, &verbose, 0, 0, 0 },
{"no-v", 0, POPT_ARG_VAL, &verbose, 0, 0, 0 },
-@@ -866,6 +907,12 @@ int parse_arguments(int *argc, const cha
+@@ -881,6 +922,12 @@ int parse_arguments(int *argc, const cha
verbose++;
break;
default:
rprintf(FERROR,
"rsync: %s: %s (in daemon mode)\n",
-@@ -889,6 +936,17 @@ int parse_arguments(int *argc, const cha
+@@ -904,6 +951,17 @@ int parse_arguments(int *argc, const cha
exit_cleanup(RERR_SYNTAX);
}
*argv = poptGetArgs(pc);
*argc = count_args(*argv);
am_starting_up = 0;
-@@ -1122,6 +1180,12 @@ int parse_arguments(int *argc, const cha
+@@ -1148,6 +1206,12 @@ int parse_arguments(int *argc, const cha
+ return 0;
#endif
-
+#ifdef HAVE_OPENSSL
+ case OPT_USE_SSL:
+ use_ssl = 1;
default:
/* A large opt value means that set_refuse_options()
* turned this option off. */
-@@ -1400,6 +1464,17 @@ int parse_arguments(int *argc, const cha
+@@ -1426,6 +1490,17 @@ int parse_arguments(int *argc, const cha
if (delay_updates && !partial_dir)
partial_dir = tmp_partialdir;
if (inplace) {
#ifdef HAVE_FTRUNCATE
if (partial_dir) {
-@@ -1827,10 +1902,27 @@ char *check_for_hostspec(char *s, char *
+@@ -1857,10 +1932,27 @@ char *check_for_hostspec(char *s, char *
char *p;
int not_host;
int hostlen;
if test $ac_cv_func_getpgrp = yes; then
--- old/options.c
+++ new/options.c
-@@ -69,6 +69,7 @@ int remove_source_files = 0;
+@@ -70,6 +70,7 @@ int remove_source_files = 0;
int one_file_system = 0;
int protocol_version = PROTOCOL_VERSION;
int sparse_files = 0;
int do_compression = 0;
int def_compress_level = Z_DEFAULT_COMPRESSION;
int am_root = 0;
-@@ -202,6 +203,7 @@ static void print_rsync_version(enum log
- char const *acls = "no ";
+@@ -205,6 +206,7 @@ static void print_rsync_version(enum log
+ char const *xattrs = "no ";
char const *links = "no ";
char const *ipv6 = "no ";
+ char const *preallocation = "no ";
STRUCT_STAT *dumstat;
#ifdef HAVE_SOCKETPAIR
-@@ -228,6 +230,10 @@ static void print_rsync_version(enum log
+@@ -233,6 +235,10 @@ static void print_rsync_version(enum log
ipv6 = "";
#endif
rprintf(f, "%s version %s protocol version %d\n",
RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION);
rprintf(f, "Copyright (C) 1996-2007 by Andrew Tridgell, Wayne Davison, and others.\n");
-@@ -238,8 +244,8 @@ static void print_rsync_version(enum log
+@@ -243,8 +249,8 @@ static void print_rsync_version(enum log
(int)(sizeof (int64) * 8));
rprintf(f, " %ssocketpairs, %shardlinks, %ssymlinks, %sIPv6, batchfiles, %sinplace,\n",
got_socketpair, hardlinks, links, ipv6, have_inplace);
-- rprintf(f, " %sappend, %sACLs\n",
-- have_inplace, acls);
-+ rprintf(f, " %sappend, %sACLs, %spreallocation\n",
-+ have_inplace, acls, preallocation);
+- rprintf(f, " %sappend, %sACLs, %sxattrs\n",
+- have_inplace, acls, xattrs);
++ rprintf(f, " %sappend, %sACLs, %sxattrs, %spreallocation\n",
++ have_inplace, acls, xattrs, preallocation);
#ifdef MAINTAINER_MODE
rprintf(f, "Panic Action: \"%s\"\n", get_panic_action());
-@@ -319,6 +325,9 @@ void usage(enum logcode F)
+@@ -327,6 +333,9 @@ void usage(enum logcode F)
rprintf(F," -O, --omit-dir-times omit directories when preserving times\n");
rprintf(F," --super receiver attempts super-user activities\n");
rprintf(F," -S, --sparse handle sparse files efficiently\n");
rprintf(F," -n, --dry-run show what would have been transferred\n");
rprintf(F," -W, --whole-file copy files whole (without rsync algorithm)\n");
rprintf(F," -x, --one-file-system don't cross filesystem boundaries\n");
-@@ -479,6 +488,7 @@ static struct poptOption long_options[]
+@@ -494,6 +503,7 @@ static struct poptOption long_options[]
{"max-size", 0, POPT_ARG_STRING, &max_size_arg, OPT_MAX_SIZE, 0, 0 },
{"min-size", 0, POPT_ARG_STRING, &min_size_arg, OPT_MIN_SIZE, 0, 0 },
{"sparse", 'S', POPT_ARG_NONE, &sparse_files, 0, 0, 0 },
{"inplace", 0, POPT_ARG_NONE, &inplace, 0, 0, 0 },
{"append", 0, POPT_ARG_VAL, &append_mode, 1, 0, 0 },
{"del", 0, POPT_ARG_NONE, &delete_during, 0, 0, 0 },
-@@ -1161,6 +1171,15 @@ int parse_arguments(int *argc, const cha
+@@ -1187,6 +1197,15 @@ int parse_arguments(int *argc, const cha
}
#endif
if (write_batch && read_batch) {
snprintf(err_buf, sizeof err_buf,
"--write-batch and --read-batch can not be used together\n");
-@@ -1808,6 +1827,9 @@ void server_options(char **args,int *arg
+@@ -1838,6 +1857,9 @@ void server_options(char **args,int *arg
else if (remove_source_files)
args[ac++] = "--remove-sent-files";
--- old/receiver.c
+++ new/receiver.c
-@@ -43,6 +43,7 @@ extern int cleanup_got_literal;
+@@ -45,6 +45,7 @@ extern int cleanup_got_literal;
extern int remove_source_files;
extern int append_mode;
extern int sparse_files;
extern int keep_partial;
extern int checksum_seed;
extern int inplace;
-@@ -136,6 +137,19 @@ static int receive_data(int f_in, char *
+@@ -138,6 +139,19 @@ static int receive_data(int f_in, char *
int32 i;
char *map = NULL;
read_sum_head(f_in, &sum);
if (fd_r >= 0 && size_r > 0) {
-@@ -243,8 +257,18 @@ static int receive_data(int f_in, char *
+@@ -245,8 +259,18 @@ static int receive_data(int f_in, char *
goto report_write_error;
#ifdef HAVE_FTRUNCATE
if (do_progress)
--- old/rsync.h
+++ new/rsync.h
-@@ -551,6 +551,10 @@ struct idev_node {
+@@ -549,6 +549,10 @@ struct idev_node {
#define ACLS_NEED_MASK 1
#endif
union file_extras {
--- old/rsync.yo
+++ new/rsync.yo
-@@ -333,6 +333,7 @@ to the detailed description below for a
+@@ -334,6 +334,7 @@ to the detailed description below for a
-O, --omit-dir-times omit directories when preserving times
--super receiver attempts super-user activities
-S, --sparse handle sparse files efficiently
-n, --dry-run show what would have been transferred
-W, --whole-file copy files whole (without rsync algorithm)
-x, --one-file-system don't cross filesystem boundaries
-@@ -914,6 +915,19 @@ NOTE: Don't use this option when the des
+@@ -920,6 +921,19 @@ NOTE: Don't use this option when the des
filesystem. It doesn't seem to handle seeks over null regions
correctly and ends up corrupting the files.
INSTALLMAN=@INSTALL@
@@ -36,7 +38,7 @@ OBJS1=flist.o rsync.o generator.o receiv
OBJS2=options.o io.o compat.o hlink.o token.o uidlist.o socket.o \
- fileio.o batch.o clientname.o chmod.o acls.o
+ fileio.o batch.o clientname.o chmod.o acls.o xattrs.o
OBJS3=progress.o pipe.o
-DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
+DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o $(SLPOBJ)
int dummy2;
--- old/options.c
+++ new/options.c
-@@ -202,6 +202,7 @@ static void print_rsync_version(enum log
- char const *acls = "no ";
+@@ -205,6 +205,7 @@ static void print_rsync_version(enum log
+ char const *xattrs = "no ";
char const *links = "no ";
char const *ipv6 = "no ";
+ char const *slp = "no ";
STRUCT_STAT *dumstat;
#ifdef HAVE_SOCKETPAIR
-@@ -228,6 +229,10 @@ static void print_rsync_version(enum log
+@@ -233,6 +234,10 @@ static void print_rsync_version(enum log
ipv6 = "";
#endif
rprintf(f, "%s version %s protocol version %d\n",
RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION);
rprintf(f, "Copyright (C) 1996-2007 by Andrew Tridgell, Wayne Davison, and others.\n");
-@@ -238,8 +243,8 @@ static void print_rsync_version(enum log
+@@ -243,8 +248,8 @@ static void print_rsync_version(enum log
(int)(sizeof (int64) * 8));
rprintf(f, " %ssocketpairs, %shardlinks, %ssymlinks, %sIPv6, batchfiles, %sinplace,\n",
got_socketpair, hardlinks, links, ipv6, have_inplace);
-- rprintf(f, " %sappend, %sACLs\n",
-- have_inplace, acls);
-+ rprintf(f, " %sappend, %sACLs, %sSLP\n",
-+ have_inplace, acls, slp);
+- rprintf(f, " %sappend, %sACLs, %sxattrs\n",
+- have_inplace, acls, xattrs);
++ rprintf(f, " %sappend, %sACLs, %sxattrs, %sSLP\n",
++ have_inplace, acls, xattrs, slp);
#ifdef MAINTAINER_MODE
rprintf(f, "Panic Action: \"%s\"\n", get_panic_action());