+ char *cmpbuf, statx *sxp, int itemizing,
int maybe_ATTRS_REPORT, enum logcode code)
{
- int save_ignore_times = ignore_times;
-@@ -618,7 +629,7 @@ static int try_dests_reg(struct file_str
+ int best_match = -1;
+@@ -613,7 +624,7 @@ static int try_dests_reg(struct file_str
do {
pathjoin(cmpbuf, MAXPATHLEN, basis_dir[j], fname);
continue;
switch (match_level) {
case 0:
-@@ -626,16 +637,20 @@ static int try_dests_reg(struct file_str
+@@ -621,16 +632,20 @@ static int try_dests_reg(struct file_str
match_level = 1;
/* FALL THROUGH */
case 1:
continue;
best_match = j;
match_level = 3;
-@@ -652,14 +667,14 @@ static int try_dests_reg(struct file_str
+@@ -645,14 +660,14 @@ static int try_dests_reg(struct file_str
if (j != best_match) {
j = best_match;
pathjoin(cmpbuf, MAXPATHLEN, basis_dir[j], fname);
cmpbuf, 1,
itemizing && verbose > 1,
code) < 0)
-@@ -668,8 +683,13 @@ static int try_dests_reg(struct file_str
+@@ -661,8 +676,13 @@ static int try_dests_reg(struct file_str
hard_link_cluster(file, ndx, itemizing, code);
} else
#endif
if (verbose > 1 && maybe_ATTRS_REPORT) {
rprintf(FCLIENT, "%s is uptodate\n", fname);
}
-@@ -685,8 +705,13 @@ static int try_dests_reg(struct file_str
+@@ -678,8 +698,13 @@ static int try_dests_reg(struct file_str
}
return -1;
}
set_file_attrs(fname, file, NULL, 0);
if (maybe_ATTRS_REPORT
&& ((!itemizing && verbose && match_level == 2)
-@@ -710,13 +735,18 @@ static int try_dests_non(struct file_str
+@@ -703,13 +728,18 @@ static int try_dests_non(struct file_str
enum logcode code)
{
char fnamebuf[MAXPATHLEN];
continue;
if (S_ISLNK(file->mode)) {
#ifdef SUPPORT_LINKS
-@@ -729,10 +759,10 @@ static int try_dests_non(struct file_str
+@@ -722,10 +752,10 @@ static int try_dests_non(struct file_str
#endif
continue;
} else if (IS_SPECIAL(file->mode)) {
continue;
} else {
rprintf(FERROR,
-@@ -763,7 +793,15 @@ static int try_dests_non(struct file_str
+@@ -756,7 +786,15 @@ static int try_dests_non(struct file_str
int changes = compare_dest ? 0 : ITEM_LOCAL_CHANGE
+ (link_dest ? ITEM_XNAME_FOLLOWS : 0);
char *lp = link_dest ? "" : NULL;
}
if (verbose > 1 && maybe_ATTRS_REPORT) {
rprintf(FCLIENT, "%s is uptodate\n", fname);
-@@ -775,6 +813,7 @@ static int try_dests_non(struct file_str
+@@ -768,6 +806,7 @@ static int try_dests_non(struct file_str
}
static int phase = 0;
/* Acts on the_file_list->file's ndx'th item, whose name is fname. If a dir,
* make sure it exists, and has the right permissions/timestamp info. For
-@@ -796,7 +835,8 @@ static void recv_generator(char *fname,
+@@ -789,7 +828,8 @@ static void recv_generator(char *fname,
static int need_fuzzy_dirlist = 0;
struct file_struct *fuzzy_file = NULL;
int fd = -1, f_copy = -1;
struct file_struct *back_file = NULL;
int statret, real_ret, stat_errno;
char *fnamecmp, *partialptr, *backupptr = NULL;
-@@ -852,6 +892,9 @@ static void recv_generator(char *fname,
+@@ -845,6 +885,9 @@ static void recv_generator(char *fname,
} else if (!dry_run)
return;
}
if (dry_run > 1) {
statret = -1;
stat_errno = ENOENT;
-@@ -859,7 +902,7 @@ static void recv_generator(char *fname,
+@@ -852,7 +895,7 @@ static void recv_generator(char *fname,
char *dn = file->dirname ? file->dirname : ".";
if (parent_dirname != dn && strcmp(parent_dirname, dn) != 0) {
if (relative_paths && !implied_dirs
&& create_directory_path(fname) < 0) {
rsyserr(FERROR, errno,
"recv_generator: mkdir %s failed",
-@@ -871,6 +914,10 @@ static void recv_generator(char *fname,
+@@ -864,6 +907,10 @@ static void recv_generator(char *fname,
}
if (fuzzy_basis)
need_fuzzy_dirlist = 1;
}
parent_dirname = dn;
-@@ -879,7 +926,7 @@ static void recv_generator(char *fname,
+@@ -872,7 +919,7 @@ static void recv_generator(char *fname,
need_fuzzy_dirlist = 0;
}
keep_dirlinks && S_ISDIR(file->mode));
stat_errno = errno;
}
-@@ -897,8 +944,9 @@ static void recv_generator(char *fname,
+@@ -890,8 +937,9 @@ static void recv_generator(char *fname,
* mode based on the local permissions and some heuristics. */
if (!preserve_perms) {
int exists = statret == 0
}
if (S_ISDIR(file->mode)) {
-@@ -907,8 +955,8 @@ static void recv_generator(char *fname,
+@@ -900,8 +948,8 @@ static void recv_generator(char *fname,
* file of that name and it is *not* a directory, then
* we need to delete it. If it doesn't exist, then
* (perhaps recursively) create it. */
return;
statret = -1;
}
-@@ -917,7 +965,11 @@ static void recv_generator(char *fname,
+@@ -910,7 +958,11 @@ static void recv_generator(char *fname,
dry_run++;
}
if (itemizing && f_out != -1) {
statret ? ITEM_LOCAL_CHANGE : 0, 0, NULL);
}
if (statret != 0 && do_mkdir(fname,file->mode) < 0 && errno != EEXIST) {
-@@ -937,19 +989,19 @@ static void recv_generator(char *fname,
+@@ -930,19 +982,19 @@ static void recv_generator(char *fname,
return;
}
}
if (preserve_links && S_ISLNK(file->mode)) {
#ifdef SUPPORT_LINKS
-@@ -967,7 +1019,7 @@ static void recv_generator(char *fname,
+@@ -960,7 +1012,7 @@ static void recv_generator(char *fname,
char lnk[MAXPATHLEN];
int len;
&& (len = readlink(fname, lnk, MAXPATHLEN-1)) > 0) {
lnk[len] = 0;
/* A link already pointing to the
-@@ -975,10 +1027,10 @@ static void recv_generator(char *fname,
+@@ -968,10 +1020,10 @@ static void recv_generator(char *fname,
* required. */
if (strcmp(lnk, file->u.link) == 0) {
if (itemizing) {
maybe_ATTRS_REPORT);
if (preserve_hard_links
&& file->link_u.links) {
-@@ -993,9 +1045,9 @@ static void recv_generator(char *fname,
+@@ -986,9 +1038,9 @@ static void recv_generator(char *fname,
}
/* Not the right symlink (or not a symlink), so
* delete it. */
statret = -1;
} else if (basis_dir[0] != NULL) {
if (try_dests_non(file, fname, ndx, itemizing,
-@@ -1011,7 +1063,7 @@ static void recv_generator(char *fname,
+@@ -1004,7 +1056,7 @@ static void recv_generator(char *fname,
}
}
if (preserve_hard_links && file->link_u.links
itemizing, code, HL_SKIP))
return;
if (do_symlink(file->u.link,fname) != 0) {
-@@ -1020,7 +1072,7 @@ static void recv_generator(char *fname,
+@@ -1013,7 +1065,7 @@ static void recv_generator(char *fname,
} else {
set_file_attrs(fname, file, NULL, 0);
if (itemizing) {
ITEM_LOCAL_CHANGE, 0, NULL);
}
if (code && verbose) {
-@@ -1051,18 +1103,22 @@ static void recv_generator(char *fname,
+@@ -1044,18 +1096,22 @@ static void recv_generator(char *fname,
itemizing = code = 0;
}
}
statret = -1;
if (verbose > 2) {
rprintf(FINFO,"mknod(%s,0%o,0x%x)\n",
-@@ -1075,7 +1131,7 @@ static void recv_generator(char *fname,
+@@ -1068,7 +1124,7 @@ static void recv_generator(char *fname,
} else {
set_file_attrs(fname, file, NULL, 0);
if (itemizing) {
ITEM_LOCAL_CHANGE, 0, NULL);
}
if (code && verbose)
-@@ -1089,14 +1145,14 @@ static void recv_generator(char *fname,
+@@ -1082,14 +1138,14 @@ static void recv_generator(char *fname,
}
} else {
if (itemizing)
}
if (!S_ISREG(file->mode)) {
-@@ -1130,7 +1186,7 @@ static void recv_generator(char *fname,
+@@ -1123,7 +1179,7 @@ static void recv_generator(char *fname,
}
if (update_only && statret == 0
if (verbose > 1)
rprintf(FINFO, "%s is newer\n", fname);
return;
-@@ -1139,20 +1195,20 @@ static void recv_generator(char *fname,
+@@ -1132,20 +1188,20 @@ static void recv_generator(char *fname,
fnamecmp = fname;
fnamecmp_type = FNAMECMP_FNAME;
- return;
+ goto cleanup;
}
- if (j != -1) {
+ if (j >= 0) {
fnamecmp = fnamecmpbuf;
-@@ -1162,7 +1218,7 @@ static void recv_generator(char *fname,
+@@ -1155,7 +1211,7 @@ static void recv_generator(char *fname,
}
real_ret = statret;
if (partial_dir && (partialptr = partial_dir_fname(fname)) != NULL
&& link_stat(partialptr, &partial_st, 0) == 0
-@@ -1181,7 +1237,7 @@ static void recv_generator(char *fname,
+@@ -1174,7 +1230,7 @@ static void recv_generator(char *fname,
rprintf(FINFO, "fuzzy basis selected for %s: %s\n",
fname, fnamecmpbuf);
}
statret = 0;
fnamecmp = fnamecmpbuf;
fnamecmp_type = FNAMECMP_FUZZY;
-@@ -1190,7 +1246,7 @@ static void recv_generator(char *fname,
+@@ -1183,7 +1239,7 @@ static void recv_generator(char *fname,
if (statret != 0) {
if (preserve_hard_links && file->link_u.links
itemizing, code, HL_SKIP))
return;
if (stat_errno == ENOENT)
-@@ -1200,39 +1256,52 @@ static void recv_generator(char *fname,
+@@ -1193,39 +1249,52 @@ static void recv_generator(char *fname,
return;
}
fnamecmp = partialptr;
fnamecmp_type = FNAMECMP_PARTIAL_DIR;
statret = 0;
-@@ -1256,17 +1325,21 @@ static void recv_generator(char *fname,
+@@ -1249,17 +1318,21 @@ static void recv_generator(char *fname,
pretend_missing:
/* pretend the file didn't exist */
if (preserve_hard_links && file->link_u.links
}
if (!(back_file = make_file(fname, NULL, NULL, 0, NO_FILTERS))) {
close(fd);
-@@ -1277,7 +1350,7 @@ static void recv_generator(char *fname,
+@@ -1270,7 +1343,7 @@ static void recv_generator(char *fname,
full_fname(backupptr));
free(back_file);
close(fd);
}
if ((f_copy = do_open(backupptr,
O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0600)) < 0) {
-@@ -1285,14 +1358,14 @@ static void recv_generator(char *fname,
+@@ -1278,14 +1351,14 @@ static void recv_generator(char *fname,
full_fname(backupptr));
free(back_file);
close(fd);
}
if (verbose > 2)
-@@ -1310,24 +1383,32 @@ static void recv_generator(char *fname,
+@@ -1303,24 +1376,32 @@ static void recv_generator(char *fname,
iflags |= ITEM_BASIS_TYPE_FOLLOWS;
if (fnamecmp_type == FNAMECMP_FUZZY)
iflags |= ITEM_XNAME_FOLLOWS;
if (f_copy >= 0) {
close(f_copy);
-@@ -1340,6 +1421,13 @@ static void recv_generator(char *fname,
+@@ -1333,6 +1414,13 @@ static void recv_generator(char *fname,
}
close(fd);
}
void generate_files(int f_out, struct file_list *flist, char *local_name)
-@@ -1399,6 +1487,8 @@ void generate_files(int f_out, struct fi
+@@ -1392,6 +1480,8 @@ void generate_files(int f_out, struct fi
* notice that and let us know via the redo pipe (or its closing). */
ignore_timeout = 1;
rprintf(F," --no-OPTION turn off an implied OPTION (e.g. --no-D)\n");
rprintf(F," -r, --recursive recurse into directories\n");
rprintf(F," -R, --relative use relative path names\n");
-@@ -303,6 +309,9 @@ void usage(enum logcode F)
- rprintf(F," -H, --hard-links preserve hard links\n");
+@@ -304,6 +310,9 @@ void usage(enum logcode F)
rprintf(F," -p, --perms preserve permissions\n");
rprintf(F," -E, --executability preserve the file's executability\n");
+ rprintf(F," --chmod=CHMOD change the permissions of transferred files\n");
+#ifdef SUPPORT_ACLS
+ rprintf(F," -A, --acls preserve ACLs (implies --perms)\n");
+#endif
- rprintf(F," --chmod=CHMOD change destination permissions\n");
rprintf(F," -o, --owner preserve owner (super-user only)\n");
rprintf(F," -g, --group preserve group\n");
+ rprintf(F," --devices preserve device files (super-user only)\n");
@@ -421,6 +430,9 @@ static struct poptOption long_options[]
{"no-perms", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
{"no-p", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
{
int new_mode;
/* If the file already exists, we'll return the local permissions,
-@@ -117,57 +119,66 @@ mode_t dest_mode(mode_t flist_mode, mode
+@@ -117,56 +119,65 @@ mode_t dest_mode(mode_t flist_mode, mode
new_mode |= (new_mode & 0444) >> 2;
}
} else {
+ * off special permissions. */
+ new_mode = flist_mode & (~CHMOD_BITS | dflt_perms);
}
- if (daemon_chmod_modes && !S_ISLNK(flist_mode))
- new_mode = tweak_mode(new_mode, daemon_chmod_modes);
return new_mode;
}
- STRUCT_STAT st2;
+ statx sx2;
int change_uid, change_gid;
+ mode_t new_mode = file->mode;
- if (!st) {
+ if (!sxp) {
+#ifdef SUPPORT_ACLS
+ sx2.acc_acl = sx2.def_acl = NULL;
+#endif
- if (!preserve_perms && S_ISDIR(file->mode)
+ if (!preserve_perms && S_ISDIR(new_mode)
- && st->st_mode & S_ISGID) {
+ && sx2.st.st_mode & S_ISGID) {
/* We just created this directory and its setgid
* bit is on, so make sure it stays on. */
- file->mode |= S_ISGID;
+ new_mode |= S_ISGID;
}
+ sxp = &sx2;
}
;
else
#endif
-@@ -177,43 +188,55 @@ int set_file_attrs(char *fname, struct f
+@@ -176,45 +187,57 @@ int set_file_attrs(char *fname, struct f
rprintf(FINFO,
"set uid of %s from %ld to %ld\n",
fname,
updated = 1;
}
+ if (daemon_chmod_modes && !S_ISLNK(new_mode))
+ new_mode = tweak_mode(new_mode, daemon_chmod_modes);
++
+#ifdef SUPPORT_ACLS
+ /* It's OK to call set_acl() now, even for a dir, as the generator
+ * will enable owner-writability using chmod, if necessary.
+#endif
+
#ifdef HAVE_CHMOD
-- if ((st->st_mode & CHMOD_BITS) != (file->mode & CHMOD_BITS)) {
-- int ret = do_chmod(fname, file->mode);
-+ if ((sxp->st.st_mode & CHMOD_BITS) != (file->mode & CHMOD_BITS)) {
-+ mode_t mode = file->mode;
-+ int ret = do_chmod(fname, mode);
+- if ((st->st_mode & CHMOD_BITS) != (new_mode & CHMOD_BITS)) {
++ if ((sxp->st.st_mode & CHMOD_BITS) != (new_mode & CHMOD_BITS)) {
+ int ret = do_chmod(fname, new_mode);
if (ret < 0) {
rsyserr(FERROR, errno,
"failed to set permissions on %s",
}
if (ret == 0) /* ret == 1 if symlink could not be set */
updated = 1;
-@@ -226,6 +249,11 @@ int set_file_attrs(char *fname, struct f
+@@ -227,6 +250,11 @@ int set_file_attrs(char *fname, struct f
else
rprintf(FCLIENT, "%s is uptodate\n", fname);
}
--no-OPTION turn off an implied OPTION (e.g. --no-D)
-r, --recursive recurse into directories
-R, --relative use relative path names
-@@ -321,6 +321,7 @@ to the detailed description below for a
- -H, --hard-links preserve hard links
+@@ -322,6 +322,7 @@ to the detailed description below for a
-p, --perms preserve permissions
-E, --executability preserve executability
+ --chmod=CHMOD change the permissions of transferred files
+ -A, --acls preserve ACLs (implies -p) [non-standard]
- --chmod=CHMOD change destination permissions
-o, --owner preserve owner (super-user only)
-g, --group preserve group
-@@ -746,7 +747,9 @@ quote(itemize(
+ --devices preserve device files (super-user only)
+@@ -747,7 +748,9 @@ quote(itemize(
permissions, though the bf(--executability) option might change just
the execute permission for the file.
it() New files get their "normal" permission bits set to the source
their special permission bits disabled except in the case where a new
directory inherits a setgid bit from its parent directory.
))
-@@ -777,9 +780,11 @@ The preservation of the destination's se
+@@ -778,9 +781,11 @@ The preservation of the destination's se
directories when bf(--perms) is off was added in rsync 2.6.7. Older rsync
versions erroneously preserved the three special permission bits for
newly-created files when bf(--perms) was off, while overriding the
dit(bf(-E, --executability)) This option causes rsync to preserve the
executability (or non-executability) of regular files when bf(--perms) is
-@@ -797,6 +802,15 @@ quote(itemize(
+@@ -798,6 +803,15 @@ quote(itemize(
If bf(--perms) is enabled, this option is ignored.
dit(bf(--chmod)) This option tells rsync to apply one or more
comma-separated "chmod" strings to the permission of the files in the
transfer. The resulting value is treated as though it was the permissions
-@@ -1377,8 +1391,8 @@ if the receiving rsync is at least versi
+@@ -1383,8 +1397,8 @@ if the receiving rsync is at least versi
with older versions of rsync, but that also turns on the output of other
verbose messages).
type of update being done, bf(X) is replaced by the file-type, and the
other letters represent attributes that may be output if they are being
modified.
-@@ -1427,7 +1441,11 @@ quote(itemize(
+@@ -1433,7 +1447,11 @@ quote(itemize(
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).
for (i = 0; i < flist->count; i++)
--- old/util.c
+++ new/util.c
-@@ -1549,3 +1549,31 @@ int bitbag_next_bit(struct bitbag *bb, i
+@@ -1550,3 +1550,31 @@ int bitbag_next_bit(struct bitbag *bb, i
return -1;
}
void *save_filters;
unsigned int len = strlen(fbuf);
if (len > 1 && fbuf[len-1] == '/')
-@@ -1583,8 +1608,9 @@ static void clean_flist(struct file_list
+@@ -1585,8 +1610,9 @@ static void clean_flist(struct file_list
}
/* Make sure we don't lose track of a user-specified
* top directory. */
clear_file(flist->files[drop], flist);
-@@ -1708,7 +1734,7 @@ static void output_flist(struct file_lis
+@@ -1710,7 +1736,7 @@ static void output_flist(struct file_lis
file->dirname ? file->dirname : "",
file->dirname ? "/" : "", NS(file->basename),
S_ISDIR(file->mode) ? "/" : "", (int)file->mode,
continue;
name = fp->basename;
-@@ -664,6 +669,8 @@ static int try_dests_reg(struct file_str
+@@ -657,6 +662,8 @@ static int try_dests_reg(struct file_str
itemizing && verbose > 1,
code) < 0)
goto try_a_copy;
if (preserve_hard_links && file->link_u.links)
hard_link_cluster(file, ndx, itemizing, code);
} else
-@@ -941,7 +948,7 @@ static void recv_generator(char *fname,
+@@ -934,7 +941,7 @@ static void recv_generator(char *fname,
&& verbose && code && f_out != -1)
rprintf(code, "%s/\n", fname);
if (delete_during && f_out != -1 && !phase && dry_run < 2
delete_in_dir(the_file_list, fname, file, &st);
return;
}
-@@ -1244,7 +1251,7 @@ static void recv_generator(char *fname,
+@@ -1237,7 +1244,7 @@ static void recv_generator(char *fname,
if (fuzzy_dirlist) {
int j = flist_find(fuzzy_dirlist, file);
if (j >= 0) /* don't use changing file as future fuzzy basis */
extern int preserve_times;
extern int omit_dir_times;
extern int am_root;
-@@ -127,6 +128,7 @@ int set_file_attrs(char *fname, struct f
+@@ -129,6 +130,7 @@ int set_file_attrs(char *fname, struct f
int updated = 0;
STRUCT_STAT st2;
int change_uid, change_gid;
+ time_t atime, mtime;
+ mode_t new_mode = file->mode;
if (!st) {
- if (dry_run)
-@@ -145,18 +147,33 @@ int set_file_attrs(char *fname, struct f
+@@ -148,18 +150,33 @@ int set_file_attrs(char *fname, struct f
}
}
--super receiver attempts super-user activities
-S, --sparse handle sparse files efficiently
-n, --dry-run show what would have been transferred
-@@ -862,6 +863,12 @@ it is preserving modification times (see
+@@ -863,6 +864,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
-@@ -1378,7 +1385,7 @@ with older versions of rsync, but that a
+@@ -1384,7 +1391,7 @@ with older versions of rsync, but that a
verbose messages).
The "%i" escape has a cryptic output that is 9 letters long. The general
type of update being done, bf(X) is replaced by the file-type, and the
other letters represent attributes that may be output if they are being
modified.
-@@ -1418,7 +1425,7 @@ quote(itemize(
+@@ -1424,7 +1431,7 @@ quote(itemize(
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
-@@ -1427,7 +1434,10 @@ quote(itemize(
+@@ -1433,7 +1440,10 @@ quote(itemize(
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).
extern struct stats stats;
extern struct file_list *the_file_list;
extern char *stdout_format;
-@@ -368,7 +369,7 @@ void send_files(struct file_list *flist,
+@@ -373,7 +374,7 @@ void send_files(struct file_list *flist,
rprintf(FINFO, "sender finished %s\n", fname);
/* Flag that we actually sent this entry. */
--- old/configure.in
+++ new/configure.in
-@@ -494,7 +494,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strd
+@@ -527,7 +527,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strd
memmove lchown vsnprintf snprintf vasprintf asprintf setsid glob strpbrk \
strlcat strlcpy strtol mallinfo getgroups setgroups geteuid getegid \
setlocale setmode open64 lseek64 mkstemp64 mtrace va_copy __va_copy \
file->uid = uid;
file->gid = gid;
-@@ -855,6 +878,9 @@ struct file_struct *make_file(char *fnam
+@@ -857,6 +880,9 @@ struct file_struct *make_file(char *fnam
file->modtime = st.st_mtime;
file->length = st.st_size;
file->mode = st.st_mode;
rprintf(F," -p, --perms preserve permissions\n");
+ rprintf(F," --flags preserve file flags\n");
rprintf(F," -E, --executability preserve the file's executability\n");
- rprintf(F," --chmod=CHMOD change destination permissions\n");
+ rprintf(F," --chmod=CHMOD change the permissions of transferred files\n");
rprintf(F," -o, --owner preserve owner (super-user only)\n");
@@ -420,6 +427,8 @@ static struct poptOption long_options[]
{"perms", 'p', POPT_ARG_VAL, &preserve_perms, 1, 0, 0 },
{"executability", 'E', POPT_ARG_NONE, &preserve_executability, 0, 0, 0 },
{"times", 't', POPT_ARG_VAL, &preserve_times, 1, 0, 0 },
{"no-times", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
-@@ -1122,6 +1131,15 @@ int parse_arguments(int *argc, const cha
+@@ -1123,6 +1132,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");
-@@ -1579,6 +1597,9 @@ void server_options(char **args,int *arg
+@@ -1580,6 +1598,9 @@ void server_options(char **args,int *arg
if (xfer_dirs && !recurse && delete_mode && am_sender)
args[ac++] = "--no-r";
extern int preserve_executability;
extern int preserve_times;
extern int omit_dir_times;
-@@ -216,6 +217,19 @@ int set_file_attrs(char *fname, struct f
+@@ -221,6 +222,19 @@ int set_file_attrs(char *fname, struct f
}
#endif
if (verbose > 1 && flags & ATTRS_REPORT) {
if (updated)
rprintf(FCLIENT, "%s\n", fname);
-@@ -249,6 +263,10 @@ void finish_transfer(char *fname, char *
+@@ -254,6 +268,10 @@ void finish_transfer(char *fname, char *
{
int ret;
if (inplace) {
if (verbose > 2)
rprintf(FINFO, "finishing %s\n", fname);
-@@ -302,3 +320,21 @@ const char *who_am_i(void)
+@@ -307,3 +325,21 @@ const char *who_am_i(void)
return am_server ? "server" : "client";
return am_sender ? "sender" : am_generator ? "generator" : "receiver";
}
/* These flags are used in the live flist data. */
-@@ -338,6 +339,10 @@ enum msgcode {
+@@ -344,6 +345,10 @@ enum msgcode {
#define schar char
#endif
/* Find a variable that is either exactly 32-bits or longer.
* If some code depends on 32-bit truncation, it will need to
* take special action in a "#if SIZEOF_INT32 > 4" section. */
-@@ -520,6 +525,9 @@ struct file_struct {
+@@ -526,6 +531,9 @@ struct file_struct {
struct hlink *links;
} link_u;
time_t modtime;
mode_t mode;
--- old/rsync.yo
+++ new/rsync.yo
-@@ -322,6 +322,7 @@ to the detailed description below for a
+@@ -320,6 +320,7 @@ to the detailed description below for a
+ -K, --keep-dirlinks treat symlinked dir on receiver as dir
+ -H, --hard-links preserve hard links
-p, --perms preserve permissions
- -E, --executability preserve executability
- --chmod=CHMOD change destination permissions
+ --flags preserve file flags
+ -E, --executability preserve executability
+ --chmod=CHMOD change the permissions of transferred files
-o, --owner preserve owner (super-user only)
- -g, --group preserve group
- --devices preserve device files (super-user only)
-@@ -502,7 +503,9 @@ specified, in which case bf(-r) is not i
+@@ -503,7 +504,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-":
-@@ -797,6 +800,13 @@ quote(itemize(
+@@ -798,6 +801,13 @@ quote(itemize(
If bf(--perms) is enabled, this option is ignored.
--- old/Makefile.in
+++ new/Makefile.in
-@@ -27,13 +27,13 @@ VERSION=@VERSION@
+@@ -28,13 +28,13 @@ VERSION=@VERSION@
HEADERS=byteorder.h config.h errcode.h proto.h rsync.h smb_acls.h lib/pool_alloc.h
LIBOBJ=lib/wildmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o \
if ((am_root && preserve_devices && IS_DEVICE(file->mode))
--- old/configure.in
+++ new/configure.in
-@@ -823,6 +823,30 @@ samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_
+@@ -856,6 +856,30 @@ samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_
AC_MSG_RESULT(no)
)
bp += xtra_len;
#endif
-@@ -717,6 +724,10 @@ static struct file_struct *receive_file_
+@@ -719,6 +726,10 @@ static struct file_struct *receive_file_
if (preserve_acls)
receive_acl(file, f);
#endif
return file;
}
-@@ -987,6 +998,13 @@ static struct file_struct *send_file_nam
+@@ -989,6 +1000,13 @@ static struct file_struct *send_file_nam
return NULL;
}
#endif
maybe_emit_filelist_progress(flist->count + flist_count_offset);
-@@ -999,11 +1017,19 @@ static struct file_struct *send_file_nam
+@@ -1001,11 +1019,19 @@ static struct file_struct *send_file_nam
if (preserve_acls)
send_acl(&sx, f);
#endif
rprintf(F," --no-OPTION turn off an implied OPTION (e.g. --no-D)\n");
rprintf(F," -r, --recursive recurse into directories\n");
rprintf(F," -R, --relative use relative path names\n");
-@@ -312,6 +316,9 @@ void usage(enum logcode F)
+@@ -313,6 +317,9 @@ void usage(enum logcode F)
#ifdef SUPPORT_ACLS
rprintf(F," -A, --acls preserve ACLs (implies --perms)\n");
#endif
+#ifdef SUPPORT_XATTRS
+ rprintf(F," -X, --xattrs preserve extended attributes (implies --perms)\n");
+#endif
- rprintf(F," --chmod=CHMOD change destination permissions\n");
rprintf(F," -o, --owner preserve owner (super-user only)\n");
rprintf(F," -g, --group preserve group\n");
+ rprintf(F," --devices preserve device files (super-user only)\n");
@@ -433,6 +440,9 @@ static struct poptOption long_options[]
{"acls", 'A', POPT_ARG_NONE, 0, 'A', 0, 0 },
{"no-acls", 0, POPT_ARG_VAL, &preserve_acls, 0, 0, 0 },
{"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 },
-@@ -1112,6 +1122,17 @@ int parse_arguments(int *argc, const cha
+@@ -1113,6 +1123,17 @@ int parse_arguments(int *argc, const cha
return 0;
#endif
default:
/* A large opt value means that set_refuse_options()
-@@ -1562,6 +1583,10 @@ void server_options(char **args,int *arg
+@@ -1563,6 +1584,10 @@ void server_options(char **args,int *arg
if (preserve_acls)
argstr[x++] = 'A';
#endif
extern int preserve_perms;
extern int preserve_executability;
extern int preserve_times;
-@@ -222,6 +223,10 @@ int set_file_attrs(char *fname, struct f
+@@ -229,6 +230,10 @@ int set_file_attrs(char *fname, struct f
if (preserve_acls && set_acl(fname, file, sxp) == 0)
updated = 1;
#endif
+#endif
#ifdef HAVE_CHMOD
- if ((sxp->st.st_mode & CHMOD_BITS) != (file->mode & CHMOD_BITS)) {
+ if ((sxp->st.st_mode & CHMOD_BITS) != (new_mode & CHMOD_BITS)) {
--- old/rsync.h
+++ new/rsync.h
-@@ -495,6 +495,10 @@ struct idev {
+@@ -501,6 +501,10 @@ struct idev {
#define ACLS_NEED_MASK 1
#endif
#define GID_NONE ((gid_t)-1)
#define HL_CHECK_MASTER 0
-@@ -687,6 +691,9 @@ typedef struct {
+@@ -693,6 +697,9 @@ typedef struct {
struct rsync_acl *acc_acl; /* access ACL */
struct rsync_acl *def_acl; /* default ACL */
#endif
--no-OPTION turn off an implied OPTION (e.g. --no-D)
-r, --recursive recurse into directories
-R, --relative use relative path names
-@@ -322,6 +322,7 @@ to the detailed description below for a
- -p, --perms preserve permissions
+@@ -323,6 +323,7 @@ to the detailed description below for a
-E, --executability preserve executability
+ --chmod=CHMOD change the permissions of transferred files
-A, --acls preserve ACLs (implies -p) [non-standard]
+ -X, --xattrs preserve extended attrs (implies -p) [n.s.]
- --chmod=CHMOD change destination permissions
-o, --owner preserve owner (super-user only)
-g, --group preserve group
-@@ -811,6 +812,11 @@ version makes it incompatible with sendi
+ --devices preserve device files (super-user only)
+@@ -812,6 +813,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.