@@ -32,7 +32,7 @@ LIBOBJ=lib/wildmatch.o lib/compat.o lib/
ZLIBOBJ=zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o \
zlib/trees.o zlib/zutil.o zlib/adler32.o zlib/compress.o zlib/crc32.o
- OBJS1=rsync.o generator.o receiver.o cleanup.o sender.o exclude.o util.o \
-- main.o checksum.o match.o syscall.o log.o backup.o
-+ main.o checksum.o match.o syscall.o log.o backup.o @EXTRA_OBJECT@
- OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o \
+ OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \
+- util.o main.o checksum.o match.o syscall.o log.o backup.o
++ util.o main.o checksum.o match.o syscall.o log.o backup.o @EXTRA_OBJECT@
+ OBJS2=options.o io.o compat.o hlink.o token.o uidlist.o socket.o \
fileio.o batch.o clientname.o chmod.o
OBJS3=progress.o pipe.o
--- old/cleanup.c
#include "case_N.h"
--- old/clientserver.c
+++ new/clientserver.c
-@@ -394,6 +394,9 @@ static int rsync_module(int f_in, int f_
+@@ -396,6 +396,9 @@ static int rsync_module(int f_in, int f_
XFLG_ABS_IF_SLASH | XFLG_OLD_PREFIXES);
log_init(1);
#ifdef HAVE_PUTENV
if (*lp_prexfer_exec(i) || *lp_postxfer_exec(i)) {
-@@ -633,6 +636,9 @@ static int rsync_module(int f_in, int f_
+@@ -635,6 +638,9 @@ static int rsync_module(int f_in, int f_
rprintf(FLOG, "rsync %s %s from %s@%s (%s)\n",
am_sender ? "on" : "to",
request, auth_user, host, addr);
} else {
if (remove_source_files
|| (preserve_hard_links && F_IS_HLINKED(file)))
-@@ -419,6 +441,9 @@ int recv_files(int f_in, struct file_lis
+@@ -414,6 +436,9 @@ int recv_files(int f_in, struct file_lis
if (server_filter_list.head
&& check_filter(&server_filter_list, fname, 0) < 0) {
rprintf(FERROR, "attempt to hack rsync failed.\n");
exit_cleanup(RERR_PROTOCOL);
}
-@@ -475,6 +500,11 @@ int recv_files(int f_in, struct file_lis
+@@ -470,6 +495,11 @@ int recv_files(int f_in, struct file_lis
rprintf(FERROR,
"invalid basis_dir index: %d.\n",
fnamecmp_type);
exit_cleanup(RERR_PROTOCOL);
}
pathjoin(fnamecmpbuf, sizeof fnamecmpbuf,
-@@ -523,6 +553,9 @@ int recv_files(int f_in, struct file_lis
+@@ -518,6 +548,9 @@ int recv_files(int f_in, struct file_lis
} else if (do_fstat(fd1,&st) != 0) {
rsyserr(FERROR, errno, "fstat %s failed",
full_fname(fnamecmp));
discard_receive_data(f_in, F_LENGTH(file));
close(fd1);
continue;
-@@ -536,6 +569,9 @@ int recv_files(int f_in, struct file_lis
+@@ -531,6 +564,9 @@ int recv_files(int f_in, struct file_lis
*/
rprintf(FERROR,"recv_files: %s is a directory\n",
full_fname(fnamecmp));
discard_receive_data(f_in, F_LENGTH(file));
close(fd1);
continue;
-@@ -559,6 +595,9 @@ int recv_files(int f_in, struct file_lis
+@@ -554,6 +590,9 @@ int recv_files(int f_in, struct file_lis
if (fd2 == -1) {
rsyserr(FERROR, errno, "open %s failed",
full_fname(fname));
discard_receive_data(f_in, F_LENGTH(file));
if (fd1 != -1)
close(fd1);
-@@ -592,6 +631,10 @@ int recv_files(int f_in, struct file_lis
+@@ -587,6 +626,10 @@ int recv_files(int f_in, struct file_lis
if (fd2 == -1) {
rsyserr(FERROR, errno, "mkstemp %s failed",
full_fname(fnametmp));
discard_receive_data(f_in, F_LENGTH(file));
if (fd1 != -1)
close(fd1);
-@@ -612,12 +655,19 @@ int recv_files(int f_in, struct file_lis
+@@ -607,12 +650,19 @@ int recv_files(int f_in, struct file_lis
fname, fd2, F_LENGTH(file));
log_item(log_code, file, &initial_stats, iflags, NULL);
exit_cleanup(RERR_FILEIO);
}
-@@ -674,6 +724,12 @@ int recv_files(int f_in, struct file_lis
+@@ -669,6 +719,12 @@ int recv_files(int f_in, struct file_lis
rprintf(msgtype,
"%s: %s failed verification -- update %s%s.\n",
errstr, fname, keptstr, redostr);
+#endif
}
if (!phase)
- send_msg_int(MSG_REDO, i);
+ send_msg_int(MSG_REDO, ndx);
--- old/sender.c
+++ new/sender.c
@@ -305,6 +305,9 @@ void send_files(struct file_list *flist,
+ lib/permstring.o lib/pool_alloc.o lib/sysacls.o @LIBOBJS@
ZLIBOBJ=zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o \
zlib/trees.o zlib/zutil.o zlib/adler32.o zlib/compress.o zlib/crc32.o
- OBJS1=rsync.o generator.o receiver.o cleanup.o sender.o exclude.o util.o \
- main.o checksum.o match.o syscall.o log.o backup.o
- OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o \
+ OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \
+ 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
+ fileio.o batch.o clientname.o chmod.o acls.o
OBJS3=progress.o pipe.o
--- old/flist.c
+++ new/flist.c
-@@ -40,6 +40,7 @@ extern int filesfrom_fd;
+@@ -41,6 +41,7 @@ extern int filesfrom_fd;
extern int one_file_system;
extern int copy_dirlinks;
extern int keep_dirlinks;
extern int preserve_links;
extern int preserve_hard_links;
extern int preserve_devices;
-@@ -147,6 +148,8 @@ static void list_file_entry(struct file_
+@@ -148,6 +149,8 @@ static void list_file_entry(struct file_
permstring(permbuf, f->mode);
len = F_LENGTH(f);
#ifdef SUPPORT_LINKS
if (preserve_links && S_ISLNK(f->mode)) {
rprintf(FINFO, "%s %11.0f %s %s -> %s\n",
-@@ -662,6 +665,12 @@ static struct file_struct *recv_file_ent
+@@ -663,6 +666,12 @@ static struct file_struct *recv_file_ent
}
#endif
if (always_checksum && S_ISREG(mode))
extra_len += SUM_EXTRA_CNT * EXTRA_LEN;
-@@ -787,6 +796,11 @@ static struct file_struct *recv_file_ent
+@@ -793,6 +802,11 @@ static struct file_struct *recv_file_ent
read_buf(f, bp, checksum_len);
}
return file;
}
-@@ -1047,6 +1061,9 @@ static struct file_struct *send_file_nam
+@@ -1062,6 +1076,9 @@ static struct file_struct *send_file_nam
unsigned short flags)
{
struct file_struct *file;
file = make_file(fname, flist, stp, flags,
f == -2 ? SERVER_FILTERS : ALL_FILTERS);
-@@ -1056,12 +1073,26 @@ static struct file_struct *send_file_nam
+@@ -1071,12 +1088,26 @@ static struct file_struct *send_file_nam
if (chmod_modes && !S_ISLNK(file->mode))
file->mode = tweak_mode(file->mode, chmod_modes);
+
#define GID_NONE ((gid_t)-1)
- struct file_struct {
-@@ -558,11 +566,13 @@ extern int preserve_gid;
+ union file_extras {
+@@ -559,11 +567,13 @@ extern int preserve_gid;
/* When the associated option is on, all entries will have these present: */
#define F_UID(f) REQ_EXTRA(f, preserve_uid)->uid
#define F_GID(f) REQ_EXTRA(f, preserve_gid)->gid
/* This optional item might follow an F_HL_*() item.
* (Note: a device doesn't need to check LEN64_BUMP(f).) */
-@@ -698,6 +708,17 @@ struct stats {
+@@ -699,6 +709,17 @@ struct stats {
struct chmod_mode_struct;
#include "byteorder.h"
#include "lib/mdfour.h"
#include "lib/wildmatch.h"
-@@ -716,6 +737,16 @@ struct chmod_mode_struct;
+@@ -717,6 +738,16 @@ struct chmod_mode_struct;
#define NORETURN __attribute__((__noreturn__))
#endif
+works if the remote rsync also supports it. bf(--acls) implies bf(--perms).
+
+The ACL-sending protocol used by this version was first introduced in
-+the patch that was shipped with 2.6.8. Sending files to an older version
++the patch that was shipped with 2.6.8. Sending ACLs to an older version
+of the ACL patch is not supported.
+
dit(bf(--chmod)) This option tells rsync to apply one or more
--- old/flist.c
+++ new/flist.c
-@@ -46,6 +46,7 @@ extern int preserve_devices;
+@@ -47,6 +47,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 flist_extra_cnt;
-@@ -137,6 +138,7 @@ void show_flist_stats(void)
+@@ -138,6 +139,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)) {
-@@ -149,14 +151,16 @@ static void list_file_entry(struct file_
+@@ -150,14 +152,16 @@ static void list_file_entry(struct file_
#ifdef SUPPORT_LINKS
if (preserve_links && S_ISLNK(f->mode)) {
f_name(f, NULL));
}
}
-@@ -314,6 +318,7 @@ static void send_file_entry(struct file_
+@@ -315,6 +319,7 @@ static void send_file_entry(struct file_
{
unsigned short flags;
static time_t modtime;
static mode_t mode;
static int64 dev;
static dev_t rdev;
-@@ -367,6 +372,13 @@ static void send_file_entry(struct file_
+@@ -368,6 +373,13 @@ static void send_file_entry(struct file_
flags |= XMIT_SAME_TIME;
else
modtime = file->modtime;
#ifdef SUPPORT_HARD_LINKS
if (tmp_idev.dev != 0) {
-@@ -434,6 +446,8 @@ static void send_file_entry(struct file_
+@@ -435,6 +447,8 @@ static void send_file_entry(struct file_
write_int(f, modtime);
if (!(flags & XMIT_SAME_MODE))
write_int(f, to_wire_mode(mode));
if (preserve_uid && !(flags & XMIT_SAME_UID)) {
if (!numeric_ids)
add_uid(uid);
-@@ -501,7 +515,7 @@ static void send_file_entry(struct file_
+@@ -502,7 +516,7 @@ static void send_file_entry(struct file_
static struct file_struct *recv_file_entry(struct file_list *flist,
unsigned short flags, int f)
{
static mode_t mode;
static int64 dev;
static dev_t rdev;
-@@ -522,7 +536,7 @@ static struct file_struct *recv_file_ent
+@@ -523,7 +537,7 @@ static struct file_struct *recv_file_ent
struct file_struct *file;
if (!flist) {
dev = 0, rdev = MAKEDEV(0, 0);
rdev_major = 0;
uid = 0, gid = 0;
-@@ -610,6 +624,8 @@ static struct file_struct *recv_file_ent
+@@ -611,6 +625,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);
-@@ -695,6 +711,8 @@ static struct file_struct *recv_file_ent
+@@ -701,6 +717,8 @@ static struct file_struct *recv_file_ent
F_UID(file) = uid;
if (preserve_gid)
F_GID(file) = gid;
if (dirname_len) {
file->dirname = lastdir = bp;
-@@ -985,6 +1003,8 @@ struct file_struct *make_file(const char
+@@ -996,6 +1014,8 @@ struct file_struct *make_file(const char
F_UID(file) = st.st_uid;
if (preserve_gid)
F_GID(file) = st.st_gid;
#define FULL_FLUSH 1
#define NORMAL_FLUSH 0
-@@ -514,6 +516,7 @@ struct file_struct {
- union flist_extras {
- uid_t uid; /* The user ID number */
- uid_t gid; /* The group ID number or GID_NONE */
-+ time_t utime; /* A unix-time value */
- struct idev *idev; /* The hard-link info during matching */
- int32 num; /* A signed number */
- uint32 unum; /* An unsigned number */
+@@ -513,6 +515,7 @@ struct idev_node {
+ union file_extras {
+ uid_t uid; /* The user ID number */
+ uid_t gid; /* The group ID number or GID_NONE */
++ time_t utime; /* A unix-time value */
+ struct idev *idev; /* The hard-link info during matching */
+ int32 num; /* A signed number */
+ uint32 unum; /* An unsigned number */
@@ -559,6 +562,7 @@ extern int preserve_gid;
/* When the associated option is on, all entries will have these present: */
#define F_UID(f) REQ_EXTRA(f, preserve_uid)->uid
+ lib/permstring.o lib/pool_alloc.o lib/sysacls.o lib/sysxattr.o @LIBOBJS@
ZLIBOBJ=zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o \
zlib/trees.o zlib/zutil.o zlib/adler32.o zlib/compress.o zlib/crc32.o
- OBJS1=rsync.o generator.o receiver.o cleanup.o sender.o exclude.o util.o \
- main.o checksum.o match.o syscall.o log.o backup.o
- OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o \
+ OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \
+ 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 xattr.o
OBJS3=progress.o pipe.o
--- old/flist.c
+++ new/flist.c
-@@ -41,6 +41,7 @@ extern int one_file_system;
+@@ -42,6 +42,7 @@ extern int one_file_system;
extern int copy_dirlinks;
extern int keep_dirlinks;
extern int preserve_acls;
extern int preserve_links;
extern int preserve_hard_links;
extern int preserve_devices;
-@@ -800,6 +801,10 @@ static struct file_struct *recv_file_ent
+@@ -806,6 +807,10 @@ static struct file_struct *recv_file_ent
if (preserve_acls)
receive_acl(file, f);
#endif
return file;
}
-@@ -1061,7 +1066,7 @@ static struct file_struct *send_file_nam
+@@ -1076,7 +1081,7 @@ static struct file_struct *send_file_nam
unsigned short flags)
{
struct file_struct *file;
statx sx;
#endif
-@@ -1081,6 +1086,13 @@ static struct file_struct *send_file_nam
+@@ -1096,6 +1101,13 @@ static struct file_struct *send_file_nam
return NULL;
}
#endif
maybe_emit_filelist_progress(flist->count + flist_count_offset);
-@@ -1092,6 +1104,10 @@ static struct file_struct *send_file_nam
+@@ -1107,6 +1119,10 @@ static struct file_struct *send_file_nam
if (preserve_acls)
send_acl(&sx, f);
#endif
+
#define GID_NONE ((gid_t)-1)
- struct file_struct {
+ union file_extras {
@@ -568,6 +572,7 @@ extern int preserve_gid;
#define F_UID(f) REQ_EXTRA(f, preserve_uid)->uid
#define F_GID(f) REQ_EXTRA(f, preserve_gid)->gid
-o, --owner preserve owner (super-user only)
-g, --group preserve group
--devices preserve device files (super-user only)
-@@ -819,6 +820,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.
+@@ -818,6 +819,11 @@ The ACL-sending protocol used by this ve
+ the patch that was shipped with 2.6.8. Sending ACLs to an older version
+ of the ACL patch is not supported.
+dit(bf(-X, --xattrs)) This option causes rsync to update the remote
+extended attributes to be the same as the local ones. This will work