static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
-@@ -467,6 +468,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -477,6 +478,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
xflags |= XMIT_SAME_TIME;
else
modtime = file->modtime;
#ifdef SUPPORT_HARD_LINKS
if (tmp_dev != 0) {
-@@ -538,6 +546,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -548,6 +556,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
}
if (!(xflags & XMIT_SAME_MODE))
write_int(f, to_wire_mode(mode));
if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
if (protocol_version < 30)
write_int(f, uid);
-@@ -622,7 +632,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -632,7 +642,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
static struct file_struct *recv_file_entry(struct file_list *flist,
int xflags, int f)
{
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
-@@ -756,6 +766,16 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -765,6 +775,16 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
}
if (!(xflags & XMIT_SAME_MODE))
mode = from_wire_mode(read_int(f));
if (chmod_modes && !S_ISLNK(mode))
mode = tweak_mode(mode, chmod_modes);
-@@ -905,6 +925,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -915,6 +935,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
F_GROUP(file) = gid;
file->flags |= gid_flags;
}
if (unsort_ndx)
F_NDX(file) = flist->used + flist->ndx_start;
-@@ -1277,6 +1299,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1287,6 +1309,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
F_OWNER(file) = st.st_uid;
if (gid_ndx) /* Check gid_ndx instead of preserve_gid for del support */
F_GROUP(file) = st.st_gid;
f_name(f, NULL));
}
}
-@@ -2059,7 +2068,7 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
+@@ -2063,7 +2072,7 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
STRUCT_STAT st;
if (link_stat(fname, &st, 0) == 0
&& cmp_time(st.st_mtime, file->modtime) != 0)
--super receiver attempts super-user activities
--fake-super store/recover privileged attrs using xattrs
-S, --sparse handle sparse files efficiently
-@@ -1007,6 +1008,12 @@ it is preserving modification times (see bf(--times)). If NFS is sharing
+@@ -1011,6 +1012,12 @@ it is preserving modification times (see bf(--times)). If NFS is sharing
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
-@@ -1726,7 +1733,10 @@ quote(itemization(
+@@ -1742,7 +1749,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).
/* Call this with EITHER (1) "file, NULL, 0" to chdir() to the file's
* F_PATHNAME(), or (2) "NULL, dir, dirlen" to chdir() to the supplied dir,
* with dir == NULL taken to be the starting directory, and dirlen < 0
-@@ -1068,7 +1313,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1077,7 +1322,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
STRUCT_STAT *stp, int flags, int filter_level)
{
static char *lastdir;
struct file_struct *file;
char thisname[MAXPATHLEN];
char linkname[MAXPATHLEN];
-@@ -1207,9 +1452,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1216,9 +1461,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
memcpy(lastdir, thisname, len);
lastdir[len] = '\0';
lastdir_len = len;
basename_len = strlen(basename) + 1; /* count the '\0' */
#ifdef SUPPORT_LINKS
-@@ -1286,14 +1538,18 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1296,14 +1548,18 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
memcpy(bp + basename_len, linkname, linkname_len);
#endif
if (basename_len == 0+1) {
if (!pool)
unmake_file(file);
-@@ -2258,7 +2514,8 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2268,7 +2524,8 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
* file-list to check if this is a 1-file xfer. */
send_extra_file_list(f, 1);
}
return flist;
}
-@@ -2364,7 +2621,7 @@ struct file_list *recv_file_list(int f)
+@@ -2374,7 +2631,7 @@ struct file_list *recv_file_list(int f)
else if (f >= 0)
recv_id_list(f, flist);
if (protocol_version < 30) {
/* Recv the io_error flag */
-@@ -2584,7 +2841,7 @@ void flist_free(struct file_list *flist)
+@@ -2594,7 +2851,7 @@ void flist_free(struct file_list *flist)
/* This routine ensures we don't have any duplicate names in our file list.
* duplicate names can cause corruption because of the pipelining. */
{
char fbuf[MAXPATHLEN];
int i, prev_i;
-@@ -2635,7 +2892,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2645,7 +2902,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
/* If one is a dir and the other is not, we want to
* keep the dir because it might have contents in the
* list. Otherwise keep the first one. */
struct file_struct *fp = flist->sorted[j];
if (!S_ISDIR(fp->mode))
keep = i, drop = j;
-@@ -2651,8 +2908,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2661,8 +2918,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
} else
keep = j, drop = i;
rprintf(FINFO,
"removing duplicate name %s from file list (%d)\n",
f_name(file, fbuf), drop + flist->ndx_start);
-@@ -2674,7 +2931,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2684,7 +2941,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
}
flist->high = prev_i;
}
statret = link_stat(fname, &sx.st, keep_dirlinks && is_dir);
-@@ -1796,7 +1805,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1800,7 +1809,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
;
else if (fnamecmp_type == FNAMECMP_FUZZY)
;
}
/* Call this with EITHER (1) "file, NULL, 0" to chdir() to the file's
-@@ -1407,6 +1618,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1416,6 +1627,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
if (is_excluded(thisname, S_ISDIR(st.st_mode) != 0, filter_level)) {
if (ignore_perishable)
non_perishable_cnt++;
return NULL;
}
-@@ -1453,13 +1666,13 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1462,13 +1675,13 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
lastdir[len] = '\0';
lastdir_len = len;
if (checksum_files && am_sender && flist)
}
}
basename_len = strlen(basename) + 1; /* count the '\0' */
-@@ -1545,7 +1758,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1555,7 +1768,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
if (always_checksum && am_sender && S_ISREG(st.st_mode)) {
if (flist && checksum_files)
else
file_checksum(thisname, st.st_size, tmp_sum);
}
-@@ -1922,6 +2135,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
+@@ -1932,6 +2145,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
closedir(d);
if (f >= 0 && recurse && !divert_dirs) {
int i, end = flist->used - 1;
/* send_if_directory() bumps flist->used, so use "end". */
-@@ -2517,6 +2733,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2527,6 +2743,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
} else
flist_eof = 1;
goto cleanup;
}
-@@ -1811,6 +1814,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1815,6 +1818,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
handle_partial_dir(partialptr, PDIR_DELETE);
}
set_file_attrs(fname, file, &sx, NULL, maybe_ATTRS_REPORT);
if (itemizing)
itemize(fnamecmp, file, ndx, statret, &sx, 0, 0, NULL);
#ifdef SUPPORT_HARD_LINKS
-@@ -2251,6 +2256,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2255,6 +2260,7 @@ void generate_files(int f_out, const char *local_name)
} else
change_local_filter_dir(fbuf, strlen(fbuf), F_DEPTH(fp));
}
}
for (i = cur_flist->low; i <= cur_flist->high; i++) {
struct file_struct *file = cur_flist->sorted[i];
-@@ -2334,6 +2340,9 @@ void generate_files(int f_out, const char *local_name)
+@@ -2338,6 +2344,9 @@ void generate_files(int f_out, const char *local_name)
wait_for_receiver();
}
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -1286,7 +1286,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1296,7 +1296,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
memcpy(bp + basename_len, linkname, linkname_len);
#endif
extern int preserve_specials;
extern int preserve_hard_links;
extern int preserve_executability;
-@@ -1691,7 +1692,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1695,7 +1696,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
goto cleanup;
}
static mode_t mode;
#ifdef SUPPORT_FILEFLAGS
static uint32 fileflags;
-@@ -479,6 +480,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -489,6 +490,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
xflags |= XMIT_SAME_TIME;
else
modtime = file->modtime;
#ifdef SUPPORT_HARD_LINKS
if (tmp_dev != 0) {
-@@ -548,6 +556,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -558,6 +566,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
else
write_int(f, modtime);
}
if (!(xflags & XMIT_SAME_MODE))
write_int(f, to_wire_mode(mode));
#ifdef SUPPORT_FILEFLAGS
-@@ -638,7 +648,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -648,7 +658,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
static struct file_struct *recv_file_entry(struct file_list *flist,
int xflags, int f)
{
static mode_t mode;
#ifdef SUPPORT_FILEFLAGS
static uint32 fileflags;
-@@ -744,6 +754,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -754,6 +764,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
uid = F_OWNER(first);
if (preserve_gid)
gid = F_GROUP(first);
+ if (crtimes_ndx)
+ crtime = f_crtime(first);
- if ((preserve_devices && IS_DEVICE(mode))
- || (preserve_specials && IS_SPECIAL(mode))) {
+ if (preserve_devices && IS_DEVICE(mode)) {
uint32 *devp = F_RDEV_P(first);
-@@ -773,6 +785,19 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+ rdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
+@@ -782,6 +794,19 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
} else
modtime = read_int(f);
}
if (!(xflags & XMIT_SAME_MODE))
mode = from_wire_mode(read_int(f));
-@@ -932,6 +957,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -942,6 +967,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
F_GROUP(file) = gid;
file->flags |= gid_flags;
}
if (unsort_ndx)
F_NDX(file) = flist->used + flist->ndx_start;
-@@ -1308,6 +1335,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1318,6 +1345,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
F_OWNER(file) = st.st_uid;
if (gid_ndx) /* Check gid_ndx instead of preserve_gid for del support */
F_GROUP(file) = st.st_gid;
--super receiver attempts super-user activities
--fake-super store/recover privileged attrs using xattrs
-S, --sparse handle sparse files efficiently
-@@ -1035,6 +1036,9 @@ it is preserving modification times (see bf(--times)). If NFS is sharing
+@@ -1039,6 +1040,9 @@ it is preserving modification times (see bf(--times)). If NFS is sharing
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
-@@ -1699,7 +1703,7 @@ with older versions of rsync, but that also turns on the output of other
+@@ -1715,7 +1719,7 @@ with older versions of rsync, but that also turns on the output of other
verbose messages).
The "%i" escape has a cryptic output that is 11 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.
-@@ -1758,6 +1762,8 @@ quote(itemization(
+@@ -1774,6 +1778,8 @@ quote(itemization(
it() The bf(f) means that the fileflags information changed.
it() The bf(a) means that the ACL information changed.
it() The bf(x) means that the extended attribute information changed.
extern int eol_nulls;
extern int relative_paths;
extern int implied_dirs;
-@@ -1286,14 +1287,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1296,14 +1297,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
memcpy(bp + basename_len, linkname, linkname_len);
#endif
if (basename_len == 0+1) {
if (!pool)
unmake_file(file);
-@@ -1956,6 +1959,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -1966,6 +1969,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
| (eol_nulls || reading_remotely ? RL_EOL_NULLS : 0);
int implied_dot_dir = 0;
return memcmp(sum, F_SUM(file), checksum_len) == 0;
}
-@@ -2205,6 +2207,9 @@ void generate_files(int f_out, const char *local_name)
+@@ -2209,6 +2211,9 @@ void generate_files(int f_out, const char *local_name)
: "enabled");
}
diff = u_strcmp(fmid->basename, f->basename);
if (diff == 0) {
good_match = mid;
-@@ -1988,6 +1990,21 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1992,6 +1994,21 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
fnamecmp = partialptr;
fnamecmp_type = FNAMECMP_PARTIAL_DIR;
statret = 0;
--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
-@@ -1510,6 +1512,17 @@ the bf(--partial-dir) option, that directory will be used instead. These
+@@ -1526,6 +1528,17 @@ the bf(--partial-dir) option, that directory will be used instead. These
potential alternate-basis files will be removed as the transfer progresses.
This option conflicts with bf(--inplace) and bf(--append).
static void send_directory(int f, struct file_list *flist,
char *fbuf, int len, int flags);
-@@ -2366,6 +2408,25 @@ struct file_list *recv_file_list(int f)
+@@ -2376,6 +2418,25 @@ struct file_list *recv_file_list(int f)
flist_sort_and_clean(flist, relative_paths);
change_local_filter_dir(fname, strlen(fname), F_DEPTH(file));
}
goto cleanup;
-@@ -1785,8 +1937,14 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1789,8 +1941,14 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
goto cleanup;
}
#endif
rsyserr(FERROR_XFER, stat_errno, "recv_generator: failed to stat %s",
full_fname(fname));
goto cleanup;
-@@ -2186,6 +2344,12 @@ void generate_files(int f_out, const char *local_name)
+@@ -2190,6 +2348,12 @@ void generate_files(int f_out, const char *local_name)
if (verbose > 2)
rprintf(FINFO, "generator starting pid=%ld\n", (long)getpid());
if (delete_before && !solo_file && cur_flist->used > 0)
do_delete_pass();
if (delete_during == 2) {
-@@ -2196,7 +2360,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2200,7 +2364,7 @@ void generate_files(int f_out, const char *local_name)
}
do_progress = 0;
whole_file = 0;
if (verbose >= 2) {
rprintf(FINFO, "delta-transmission %s\n",
-@@ -2238,7 +2402,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2242,7 +2406,7 @@ void generate_files(int f_out, const char *local_name)
dirdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
} else
dirdev = MAKEDEV(0, 0);
} else
change_local_filter_dir(fbuf, strlen(fbuf), F_DEPTH(fp));
}
-@@ -2285,7 +2449,21 @@ void generate_files(int f_out, const char *local_name)
+@@ -2289,7 +2453,21 @@ void generate_files(int f_out, const char *local_name)
} while ((cur_flist = cur_flist->next) != NULL);
if (delete_during)
--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
-@@ -1494,6 +1495,21 @@ Note that the use of the bf(--delete) option might get rid of any potential
+@@ -1510,6 +1511,21 @@ Note that the use of the bf(--delete) option might get rid of any potential
fuzzy-match files, so either use bf(--delete-after) or specify some
filename exclusions if you need to prevent this.
extern int ignore_existing;
extern int ignore_non_existing;
extern int inplace;
-@@ -1726,6 +1727,13 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1730,6 +1731,13 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
goto cleanup;
}
fnamecmp = fname;
fnamecmp_type = FNAMECMP_FNAME;
-@@ -2097,6 +2105,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
+@@ -2101,6 +2109,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
ignore_existing = -ignore_existing;
ignore_non_existing = -ignore_non_existing;
update_only = -update_only;
always_checksum = -always_checksum;
size_only = -size_only;
append_mode = -append_mode;
-@@ -2122,6 +2131,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
+@@ -2126,6 +2135,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
ignore_existing = -ignore_existing;
ignore_non_existing = -ignore_non_existing;
update_only = -update_only;
--no-detach do not detach from the parent
--port=PORT listen on alternate port number
--log-file=FILE override the "log file" setting
-@@ -2153,6 +2154,14 @@ The default is /etc/rsyncd.conf unless the daemon is running over
+@@ -2174,6 +2175,14 @@ The default is /etc/rsyncd.conf unless the daemon is running over
a remote shell program and the remote user is not the super-user; in that case
the default is rsyncd.conf in the current directory (typically $HOME).
-n, --dry-run perform a trial run with no changes made
-W, --whole-file copy files whole (w/o delta-xfer algorithm)
-x, --one-file-system don't cross filesystem boundaries
-@@ -1056,6 +1057,10 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs"
+@@ -1060,6 +1061,10 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs"
filesystem. It doesn't seem to handle seeks over null regions
correctly and ends up corrupting the files.
+ }
+#endif
- if ((preserve_devices && IS_DEVICE(mode))
- || (preserve_specials && IS_SPECIAL(mode))) {
-@@ -538,6 +550,10 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+ if (preserve_devices && IS_DEVICE(mode)) {
+ if (protocol_version < 28) {
+@@ -548,6 +560,10 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
}
if (!(xflags & XMIT_SAME_MODE))
write_int(f, to_wire_mode(mode));
if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
if (protocol_version < 30)
write_int(f, uid);
-@@ -624,6 +640,9 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -634,6 +650,9 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
{
static int64 modtime;
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
#endif
-@@ -759,6 +778,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -768,6 +787,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
if (chmod_modes && !S_ISLNK(mode))
mode = tweak_mode(mode, chmod_modes);
if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
if (protocol_version < 30)
-@@ -899,6 +922,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -909,6 +932,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
}
#endif
file->mode = mode;
if (preserve_uid)
F_OWNER(file) = uid;
if (preserve_gid) {
-@@ -1273,6 +1300,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1283,6 +1310,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
}
#endif
file->mode = st.st_mode;
if (uid_ndx) /* Check uid_ndx instead of preserve_uid for del support */
F_OWNER(file) = st.st_uid;
if (gid_ndx) /* Check gid_ndx instead of preserve_gid for del support */
-@@ -1416,6 +1447,7 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
+@@ -1426,6 +1457,7 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
#endif
#ifdef SUPPORT_XATTRS
if (preserve_xattrs) {
#ifdef SUPPORT_HARD_LINKS
if (preserve_hard_links && F_HLINK_NOT_FIRST(file)
-@@ -2054,13 +2090,17 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
+@@ -2058,13 +2094,17 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
continue;
fname = f_name(file, NULL);
if (!(file->mode & S_IWUSR))
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-":
-@@ -805,7 +810,7 @@ they would be using bf(--copy-links).
+@@ -809,7 +814,7 @@ they would be using bf(--copy-links).
Without this option, if the sending side has replaced a directory with a
symlink to a directory, the receiving side will delete anything that is in
the way of the new symlink, including a directory hierarchy (as long as
See also bf(--keep-dirlinks) for an analogous option for the receiving
side.
-@@ -942,6 +947,29 @@ super-user copies all namespaces except system.*. A normal user only copies
+@@ -946,6 +951,29 @@ super-user copies all namespaces except system.*. A normal user only copies
the user.* namespace. To be able to backup and restore non-user namespaces as
a normal user, see the bf(--fake-super) option.
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
-@@ -1204,12 +1232,13 @@ See bf(--delete) (which is implied) for more details on file-deletion.
+@@ -1216,12 +1244,13 @@ See bf(--delete) (which is implied) for more details on file-deletion.
dit(bf(--ignore-errors)) Tells bf(--delete) to go ahead and delete files
even when there are I/O errors.
bf(--recursive) option was also enabled.
dit(bf(--max-delete=NUM)) This tells rsync not to delete more than NUM
-@@ -1670,7 +1699,7 @@ with older versions of rsync, but that also turns on the output of other
+@@ -1686,7 +1715,7 @@ with older versions of rsync, but that also turns on the output of other
verbose messages).
The "%i" escape has a cryptic output that is 11 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.
-@@ -1726,7 +1755,7 @@ quote(itemization(
+@@ -1742,7 +1771,7 @@ 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).
if (fst.st_mode != mode)
- do_chmod(fname, mode);
+ do_chmod(fname, mode, ST_FLAGS(fst));
- if (!IS_DEVICE(fst.st_mode) && !IS_SPECIAL(fst.st_mode))
+ if (!IS_DEVICE(fst.st_mode))
fst.st_rdev = 0; /* just in case */
extern int ignore_errors;
extern int numeric_ids;
extern int recurse;
-@@ -2825,6 +2826,7 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
+@@ -2835,6 +2836,7 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
{
int dif;
const uchar *c1, *c2;
enum fnc_state state1, state2;
enum fnc_type type1, type2;
enum fnc_type t_path = protocol_version >= 29 ? t_PATH : t_ITEM;
-@@ -2935,7 +2937,15 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
+@@ -2945,7 +2947,15 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
if (type1 != type2)
return type1 == t_PATH ? 1 : -1;
}
--address=ADDRESS bind address for outgoing socket to daemon
--port=PORT specify double-colon alternate port number
--sockopts=OPTIONS specify custom TCP options
-@@ -1452,6 +1453,10 @@ If you use this option with bf(--iconv), the args will also be translated
+@@ -1468,6 +1469,10 @@ If you use this option with bf(--iconv), the args will also be translated
from the local to the remote character-set. The translation happens before
wild-cards are expanded. See also the bf(--files-from) option.
extern char curr_dir[MAXPATHLEN];
-@@ -844,7 +845,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -854,7 +855,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
extra_len += EXTRA_LEN;
#endif
extern int unsort_ndx;
extern struct stats stats;
extern char *filesfrom_host;
-@@ -1223,6 +1224,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1232,6 +1233,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
extra_len += EXTRA_LEN;
#endif
#if EXTRA_ROUNDING > 0
if (extra_len & (EXTRA_ROUNDING * EXTRA_LEN))
extra_len = (extra_len | (EXTRA_ROUNDING * EXTRA_LEN)) + EXTRA_LEN;
-@@ -1286,9 +1293,6 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1296,9 +1303,6 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
memcpy(bp + basename_len, linkname, linkname_len);
#endif
if (am_sender)
F_PATHNAME(file) = pathname;
else if (!pool)
-@@ -1300,6 +1304,9 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1310,6 +1314,9 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
return NULL;
}
-k, --copy-dirlinks transform symlink to dir into referent dir
-K, --keep-dirlinks treat symlinked dir on receiver as dir
-H, --hard-links preserve hard links
-@@ -798,6 +799,25 @@ which point outside the copied tree. All absolute symlinks are
+@@ -802,6 +803,25 @@ which point outside the copied tree. All absolute symlinks are
also ignored. Using this option in conjunction with bf(--relative) may
give unexpected results.
--super receiver attempts super-user activities
--fake-super store/recover privileged attrs using xattrs
-S, --sparse handle sparse files efficiently
-@@ -1007,6 +1008,10 @@ it is preserving modification times (see bf(--times)). If NFS is sharing
+@@ -1011,6 +1012,10 @@ it is preserving modification times (see bf(--times)). If NFS is sharing
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).
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -1416,6 +1416,7 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
+@@ -1426,6 +1426,7 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
#endif
#ifdef SUPPORT_XATTRS
if (preserve_xattrs) {
-n, --dry-run perform a trial run with no changes made
-W, --whole-file copy files whole (w/o delta-xfer algorithm)
-x, --one-file-system don't cross filesystem boundaries
-@@ -1056,6 +1057,18 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs"
+@@ -1060,6 +1061,18 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs"
filesystem. It doesn't seem to handle seeks over null regions
correctly and ends up corrupting the files.
--out-format=FORMAT output updates using the specified FORMAT
--log-file=FILE log what we're doing to the specified FILE
--log-file-format=FMT log updates using the specified FMT
-@@ -1033,16 +1034,16 @@ This is a good way to backup data without using a super-user, and to store
+@@ -1037,16 +1038,16 @@ This is a good way to backup data without using a super-user, and to store
ACLs from incompatible systems.
The bf(--fake-super) option only affects the side where the option is used.
This option is overridden by both bf(--super) and bf(--no-super).
-@@ -1295,6 +1296,36 @@ machine for use with the bf(--relative) option. For instance:
+@@ -1311,6 +1312,36 @@ machine for use with the bf(--relative) option. For instance:
quote(tt( rsync -avR --rsync-path="cd /a/b && rsync" host:c/d /e/))
dit(bf(-C, --cvs-exclude)) This is a useful shorthand for excluding a
broad range of files that you often don't want to transfer between
systems. It uses a similar algorithm to CVS to determine if
-@@ -1771,7 +1802,7 @@ option if you wish to override this.
+@@ -1787,7 +1818,7 @@ option if you wish to override this.
Here's a example command that requests the remote side to log what is
happening:
extern struct stats stats;
extern char *filesfrom_host;
-@@ -1655,6 +1656,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
+@@ -1665,6 +1666,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
}
send_file_name(f, flist, fbuf, NULL, flags, filter_level);
--del an alias for --delete-during
--delete delete extraneous files from dest dirs
--delete-before receiver deletes before transfer (default)
-@@ -1118,6 +1119,14 @@ dit(bf(--remove-source-files)) This tells rsync to remove from the sending
+@@ -1130,6 +1131,14 @@ dit(bf(--remove-source-files)) This tells rsync to remove from the sending
side the files (meaning non-directories) that are a part of the transfer
and have been successfully duplicated on the receiving side.
--protocol=NUM force an older protocol version to be used
--iconv=CONVERT_SPEC request charset conversion of filenames
--checksum-seed=NUM set block/file checksum seed (advanced)
-@@ -2061,6 +2064,33 @@ file previously generated by bf(--write-batch).
+@@ -2082,6 +2085,33 @@ file previously generated by bf(--write-batch).
If em(FILE) is bf(-), the batch data will be read from standard input.
See the "BATCH MODE" section for details.
-n, --dry-run perform a trial run with no changes made
-W, --whole-file copy files whole (w/o delta-xfer algorithm)
-x, --one-file-system don't cross filesystem boundaries
-@@ -1056,6 +1057,15 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs"
+@@ -1060,6 +1061,15 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs"
filesystem. It doesn't seem to handle seeks over null regions
correctly and ends up corrupting the files.
--write-batch=FILE write a batched update to FILE
--only-write-batch=FILE like --write-batch but w/o updating dest
--read-batch=FILE read a batched update from FILE
-@@ -2035,6 +2037,19 @@ transfer was too fast, it will wait before sending the next data block. The
+@@ -2056,6 +2058,19 @@ transfer was too fast, it will wait before sending the next data block. The
result is an average transfer rate equaling the specified limit. A value
of zero specifies no limit.
#define PTR_SIZE (sizeof (struct file_struct *))
int io_error;
-@@ -619,6 +622,24 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -629,6 +632,24 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
stats.total_size += F_LENGTH(file);
}
static struct file_struct *recv_file_entry(struct file_list *flist,
int xflags, int f)
{
-@@ -687,6 +708,9 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -697,6 +718,9 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
}
#endif
--checksum-seed=NUM set block/file checksum seed (advanced)
-4, --ipv4 prefer IPv4
-6, --ipv6 prefer IPv6
-@@ -2099,6 +2100,22 @@ daemon uses the charset specified in its "charset" configuration parameter
+@@ -2120,6 +2121,22 @@ daemon uses the charset specified in its "charset" configuration parameter
regardless of the remote charset you actually pass. Thus, you may feel free to
specify just the local charset for a daemon transfer (e.g. bf(--iconv=utf8)).
extern char curr_dir[MAXPATHLEN];
-@@ -767,7 +768,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -776,7 +777,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
uid = (uid_t)read_varint(f);
if (xflags & XMIT_USER_NAME_FOLLOWS)
uid = recv_user_name(f, uid);
uid = match_uid(uid);
}
}
-@@ -779,7 +780,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -788,7 +789,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
gid_flags = 0;
if (xflags & XMIT_GROUP_NAME_FOLLOWS)
gid = recv_group_name(f, gid, &gid_flags);
gid = match_gid(gid, &gid_flags);
}
}
-@@ -2270,8 +2271,13 @@ struct file_list *recv_file_list(int f)
+@@ -2280,8 +2281,13 @@ struct file_list *recv_file_list(int f)
int64 start_read;
int save_verbose = verbose;
--timeout=SECONDS set I/O timeout in seconds
--contimeout=SECONDS set daemon connection timeout in seconds
-I, --ignore-times don't skip files that match size and time
-@@ -1627,6 +1630,57 @@ from the source system is used instead. See also the comments on the
+@@ -1643,6 +1646,57 @@ from the source system is used instead. See also the comments on the
the chroot setting affects rsync's ability to look up the names of the
users and groups and what you can do about it.