AC_CHECK_FUNCS(getpgrp tcgetpgrp)
--- old/flist.c
+++ new/flist.c
-@@ -48,6 +48,7 @@ extern int preserve_links;
+@@ -44,6 +44,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;
-@@ -312,6 +313,9 @@ static void send_file_entry(struct file_
+@@ -299,6 +300,9 @@ 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;
static uint32 rdev_major;
-@@ -344,6 +348,12 @@ static void send_file_entry(struct file_
+@@ -329,6 +333,12 @@ static void send_file_entry(struct file_
flags |= XMIT_SAME_MODE;
else
mode = file->mode;
if ((preserve_devices && IS_DEVICE(mode))
|| (preserve_specials && IS_SPECIAL(mode))) {
if (protocol_version < 28) {
-@@ -427,6 +437,10 @@ static void send_file_entry(struct file_
+@@ -412,6 +422,10 @@ 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);
-@@ -496,6 +510,9 @@ static struct file_struct *receive_file_
+@@ -479,6 +493,9 @@ static struct file_struct *receive_file_
{
static time_t modtime;
static mode_t mode;
static int64 dev;
static dev_t rdev;
static uint32 rdev_major;
-@@ -569,9 +586,12 @@ static struct file_struct *receive_file_
+@@ -552,9 +569,12 @@ static struct file_struct *receive_file_
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))
uid = (uid_t)read_int(f);
-@@ -622,6 +642,9 @@ static struct file_struct *receive_file_
+@@ -605,6 +625,9 @@ static struct file_struct *receive_file_
file->modtime = modtime;
file->length = file_length;
file->mode = mode;
file->uid = uid;
file->gid = gid;
-@@ -874,6 +897,9 @@ struct file_struct *make_file(char *fnam
+@@ -855,6 +878,9 @@ struct file_struct *make_file(char *fnam
file->modtime = st.st_mtime;
file->length = st.st_size;
file->mode = st.st_mode;
--- old/generator.c
+++ new/generator.c
-@@ -126,6 +126,9 @@ static int delete_item(char *fname, int
+@@ -124,6 +124,9 @@ static int delete_item(char *fname, int
if (!S_ISDIR(mode)) {
if (max_delete && ++deletion_count > max_delete)
return 0;
if (make_backups && (backup_dir || !is_backup_file(fname)))
ok = make_backup(fname);
else
-@@ -150,10 +153,17 @@ static int delete_item(char *fname, int
+@@ -148,10 +151,17 @@ static int delete_item(char *fname, int
ok = 0;
errno = ENOTEMPTY;
} else if (make_backups && !backup_dir && !is_backup_file(fname)
log_delete(fname, mode);
--- old/options.c
+++ new/options.c
-@@ -46,6 +46,7 @@ int copy_links = 0;
+@@ -48,6 +48,7 @@ int copy_links = 0;
int preserve_links = 0;
int preserve_hard_links = 0;
int preserve_perms = 0;
int preserve_executability = 0;
int preserve_devices = 0;
int preserve_specials = 0;
-@@ -196,6 +197,7 @@ static void print_rsync_version(enum log
+@@ -200,6 +201,7 @@ static void print_rsync_version(enum log
char const *hardlinks = "no ";
char const *links = "no ";
char const *ipv6 = "no ";
STRUCT_STAT *dumstat;
#ifdef HAVE_SOCKETPAIR
-@@ -218,6 +220,10 @@ static void print_rsync_version(enum log
+@@ -222,6 +224,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-2006 by Andrew Tridgell, Wayne Davison, and others.\n");
-@@ -230,9 +236,9 @@ static void print_rsync_version(enum log
+@@ -234,9 +240,9 @@ static void print_rsync_version(enum log
/* Note that this field may not have type ino_t. It depends
* on the complicated interaction between largefile feature
* macros. */
(int) (sizeof dumstat->st_ino * 8),
(int) (sizeof (int64) * 8));
#ifdef MAINTAINER_MODE
-@@ -294,6 +300,7 @@ void usage(enum logcode F)
+@@ -298,6 +304,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 change destination permissions\n");
rprintf(F," -o, --owner preserve owner (super-user only)\n");
-@@ -409,6 +416,8 @@ static struct poptOption long_options[]
+@@ -414,6 +421,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 },
{"times", 't', POPT_ARG_VAL, &preserve_times, 1, 0, 0 },
{"no-times", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
-@@ -1107,6 +1116,15 @@ int parse_arguments(int *argc, const cha
+@@ -1119,6 +1128,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");
-@@ -1562,6 +1580,9 @@ void server_options(char **args,int *arg
+@@ -1577,6 +1595,9 @@ void server_options(char **args,int *arg
if (xfer_dirs && !recurse && delete_mode && am_sender)
args[ac++] = "--no-r";
+++ new/rsync.c
@@ -34,6 +34,7 @@ extern int verbose;
extern int dry_run;
- extern int daemon_log_format_has_i;
+ extern int logfile_format_has_i;
extern int preserve_perms;
+extern int preserve_flags;
extern int preserve_executability;
+#endif
+
if (verbose > 1 && flags & ATTRS_REPORT) {
- enum logcode code = daemon_log_format_has_i || dry_run
+ enum logcode code = logfile_format_has_i || dry_run
? FCLIENT : FINFO;
@@ -252,6 +266,10 @@ void finish_transfer(char *fname, char *
{
/* These flags are used in the live flist data. */
-@@ -337,6 +338,10 @@ enum msgcode {
+@@ -338,6 +339,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. */
-@@ -519,6 +524,9 @@ struct file_struct {
+@@ -520,6 +525,9 @@ struct file_struct {
struct hlink *links;
} link_u;
time_t modtime;
-o, --owner preserve owner (super-user only)
-g, --group preserve group
--devices preserve device files (super-user only)
-@@ -498,7 +499,9 @@ specified, in which case bf(-r) is not i
+@@ -500,7 +501,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-":
-@@ -793,6 +796,13 @@ quote(itemize(
+@@ -795,6 +798,13 @@ quote(itemize(
If bf(--perms) is enabled, this option is ignored.
transfer. The resulting value is treated as though it was the permissions
--- old/syscall.c
+++ new/syscall.c
-@@ -155,6 +155,15 @@ int do_chmod(const char *path, mode_t mo
+@@ -152,6 +152,15 @@ int do_chmod(const char *path, mode_t mo
}
#endif
--- old/cleanup.c
+++ new/cleanup.c
-@@ -22,6 +22,9 @@
- #include "rsync.h"
-
+@@ -26,6 +26,9 @@
+ extern int am_server;
+ extern int am_daemon;
extern int io_error;
+#if HAVE_OPENSSL
+extern int use_ssl;
extern int keep_partial;
extern int log_got_error;
extern char *partial_dir;
-@@ -101,6 +104,11 @@ void _exit_cleanup(int code, const char
+@@ -106,6 +109,11 @@ void _exit_cleanup(int code, const char
SIGACTION(SIGUSR1, SIG_IGN);
SIGACTION(SIGUSR2, SIG_IGN);
code, file, line);
--- old/clientserver.c
+++ new/clientserver.c
-@@ -34,6 +34,9 @@ extern int am_sender;
+@@ -29,6 +29,9 @@ extern int am_sender;
extern int am_server;
extern int am_daemon;
extern int am_root;
extern int rsync_port;
extern int kluge_around_eof;
extern int daemon_over_rsh;
-@@ -109,8 +112,18 @@ int start_socket_client(char *host, char
+@@ -105,8 +108,18 @@ int start_socket_client(char *host, char
set_socket_options(fd, sockopts);
ret = start_inband_exchange(user, path, fd, fd, argc);
+ return client_run(fd, fd, -1, argc, argv);
}
- int start_inband_exchange(char *user, char *path, int f_in, int f_out,
-@@ -171,6 +184,33 @@ int start_inband_exchange(char *user, ch
+ int start_inband_exchange(char *user, char *path, int f_in, int f_out,
+@@ -167,6 +180,33 @@ int start_inband_exchange(char *user, ch
if (verbose > 1)
print_child_argv(sargs);
p = strchr(path,'/');
if (p) *p = 0;
io_printf(f_out, "%s\n", path);
-@@ -199,6 +239,10 @@ int start_inband_exchange(char *user, ch
+@@ -195,6 +235,10 @@ int start_inband_exchange(char *user, ch
* server to terminate the listing of modules.
* We don't want to go on and transfer
* anything; just exit. */
exit(0);
}
-@@ -206,6 +250,10 @@ int start_inband_exchange(char *user, ch
+@@ -202,6 +246,10 @@ int start_inband_exchange(char *user, ch
rprintf(FERROR, "%s\n", line);
/* This is always fatal; the server will now
* close the socket. */
return -1;
}
-@@ -722,6 +770,7 @@ static void send_listing(int fd)
+@@ -719,6 +767,7 @@ static void send_listing(int fd)
io_printf(fd,"@RSYNCD: EXIT\n");
}
/* this is called when a connection is established to a client
and we want to start talking. The setup of the system is done from
here */
-@@ -778,6 +827,9 @@ int start_daemon(int f_in, int f_out)
+@@ -777,6 +826,9 @@ int start_daemon(int f_in, int f_out)
if (protocol_version > remote_protocol)
protocol_version = remote_protocol;
line[0] = 0;
if (!read_line(f_in, line, sizeof line - 1))
return -1;
-@@ -789,6 +841,20 @@ int start_daemon(int f_in, int f_out)
+@@ -788,6 +840,20 @@ int start_daemon(int f_in, int f_out)
return -1;
}
*cygwin* ) AC_MSG_RESULT(yes)
--- old/options.c
+++ new/options.c
-@@ -167,6 +167,14 @@ int log_format_has_o_or_i = 0;
+@@ -172,6 +172,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;
-@@ -195,6 +203,7 @@ static void print_rsync_version(enum log
+@@ -200,6 +208,7 @@ static void print_rsync_version(enum log
char const *hardlinks = "no ";
char const *links = "no ";
char const *ipv6 = "no ";
STRUCT_STAT *dumstat;
#ifdef HAVE_SOCKETPAIR
-@@ -217,6 +226,10 @@ static void print_rsync_version(enum log
+@@ -222,6 +231,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-2006 by Andrew Tridgell, Wayne Davison, and others.\n");
-@@ -229,9 +242,9 @@ static void print_rsync_version(enum log
+@@ -234,9 +247,9 @@ static void print_rsync_version(enum log
/* Note that this field may not have type ino_t. It depends
* on the complicated interaction between largefile feature
* macros. */
(int) (sizeof dumstat->st_ino * 8),
(int) (sizeof (int64) * 8));
#ifdef MAINTAINER_MODE
-@@ -371,6 +384,13 @@ void usage(enum logcode F)
+@@ -378,6 +391,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");
-@@ -383,7 +403,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OP
+@@ -390,7 +410,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[] = {
-@@ -520,6 +540,13 @@ static struct poptOption long_options[]
+@@ -532,6 +552,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 },
-@@ -1062,6 +1089,12 @@ int parse_arguments(int *argc, const cha
+@@ -1080,6 +1107,12 @@ int parse_arguments(int *argc, const cha
usage(FINFO);
exit_cleanup(0);
default:
/* A large opt value means that set_refuse_options()
* turned this option off. */
-@@ -1340,6 +1373,17 @@ int parse_arguments(int *argc, const cha
+@@ -1361,6 +1394,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) {
-@@ -1750,11 +1794,28 @@ char *check_for_hostspec(char *s, char *
+@@ -1774,11 +1818,28 @@ char *check_for_hostspec(char *s, char *
{
char *p;
int not_host;
#define BACKUP_SUFFIX "~"
-@@ -410,6 +411,11 @@ enum msgcode {
+@@ -413,6 +414,11 @@ enum msgcode {
# define SIZEOF_INT64 SIZEOF_OFF_T
#endif
--- old/clientserver.c
+++ new/clientserver.c
-@@ -847,6 +847,13 @@ int daemon_main(void)
+@@ -846,6 +846,13 @@ int daemon_main(void)
* address too. In fact, why not just do inet_ntop on the
* local address??? */
int fd;
--- old/configure.in
+++ new/configure.in
-@@ -522,6 +522,29 @@ if test $rsync_cv_chown_follows_symlink
- AC_DEFINE(CHOWN_MODIFIES_SYMLINK, 1, [Define to 1 if chown modifies symlinks.])
+@@ -559,6 +559,29 @@ if test $rsync_cv_can_hardlink_special =
+ AC_DEFINE(CAN_HARDLINK_SPECIAL, 1, [Define to 1 if link() can hard-link special files.])
fi
+AC_ARG_ENABLE(slp, [ --disable-slp turn off SLP support, defaults to on])
FN_LOCAL_STRING(lp_auth_users, auth_users)
--- old/main.c
+++ new/main.c
-@@ -971,6 +971,18 @@ static int start_client(int argc, char *
+@@ -1022,6 +1022,18 @@ static int start_client(int argc, char *
if (!read_batch) { /* for read_batch, NO source is specified */
shell_path = check_for_hostspec(argv[0], &shell_machine, &rsync_port);
int dummy2;
--- old/options.c
+++ new/options.c
-@@ -196,6 +196,7 @@ static void print_rsync_version(enum log
+@@ -200,6 +200,7 @@ static void print_rsync_version(enum log
char const *hardlinks = "no ";
char const *links = "no ";
char const *ipv6 = "no ";
STRUCT_STAT *dumstat;
#ifdef HAVE_SOCKETPAIR
-@@ -218,6 +219,10 @@ static void print_rsync_version(enum log
+@@ -222,6 +223,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-2006 by Andrew Tridgell, Wayne Davison, and others.\n");
-@@ -230,9 +235,9 @@ static void print_rsync_version(enum log
+@@ -234,9 +239,9 @@ static void print_rsync_version(enum log
/* Note that this field may not have type ino_t. It depends
* on the complicated interaction between largefile feature
* macros. */
#ifdef MAINTAINER_MODE
--- old/rsync.h
+++ new/rsync.h
-@@ -154,6 +154,9 @@
+@@ -156,6 +156,9 @@
#define SIGNIFICANT_ITEM_FLAGS (~(\
ITEM_BASIS_TYPE_FOLLOWS | ITEM_XNAME_FOLLOWS | ITEM_LOCAL_CHANGE))
+/* definately don't set to less than about 30 seconds */
+#define SLP_MIN_TIMEOUT 120
- /* Log-message categories. Only FERROR and FINFO get sent over the socket.
- * FLOG and FCLIENT are only used on the daemon side for custom logging,
+ /* Log-message categories. Only FERROR and FINFO get sent over the socket,
+ * but FLOG and FSOCKERR can be sent over the receiver -> generator pipe.
--- old/rsync.yo
+++ new/rsync.yo
@@ -139,7 +139,12 @@ particular rsync daemon by leaving off t
path = /var/ftp/pub
--- old/socket.c
+++ new/socket.c
-@@ -447,6 +447,16 @@ void start_accept_loop(int port, int (*f
+@@ -465,6 +465,16 @@ void start_accept_loop(int port, int (*f
{
fd_set deffds;
int *sp, maxfd, i;
#ifdef HAVE_SIGACTION
sigact.sa_flags = SA_NOCLDSTOP;
-@@ -475,14 +485,25 @@ void start_accept_loop(int port, int (*f
+@@ -493,14 +503,25 @@ void start_accept_loop(int port, int (*f
maxfd = sp[i];
}
/* close log file before the potentially very long select so
* file can be trimmed by another process instead of growing
-@@ -494,8 +515,18 @@ void start_accept_loop(int port, int (*f
+@@ -512,8 +533,18 @@ void start_accept_loop(int port, int (*f
#else
fds = deffds;
#endif
CPPFLAGS=@CPPFLAGS@
--- old/cleanup.c
+++ new/cleanup.c
-@@ -28,10 +28,6 @@ extern int keep_partial;
- extern int log_got_error;
+@@ -31,10 +31,6 @@ extern int log_got_error;
extern char *partial_dir;
+ extern char *logfile_name;
-#ifdef HAVE_SIGACTION
-static struct sigaction sigact;
/**
* Close all open sockets and files, allowing a (somewhat) graceful
* shutdown() of socket connections. This eliminates the abortive
-@@ -100,9 +96,6 @@ void _exit_cleanup(int code, const char
+@@ -103,9 +99,6 @@ void _exit_cleanup(int code, const char
}
inside_cleanup++;
if (verbose > 3) {
rprintf(FINFO,"_exit_cleanup(code=%d, file=%s, line=%d): entered\n",
code, file, line);
-@@ -134,8 +127,6 @@ void _exit_cleanup(int code, const char
+@@ -137,8 +130,6 @@ void _exit_cleanup(int code, const char
io_flush(FULL_FLUSH);
if (cleanup_fname)
do_unlink(cleanup_fname);
continue;
}
-@@ -1184,7 +1188,7 @@ static void recv_generator(char *fname,
+@@ -1187,7 +1191,7 @@ static void recv_generator(char *fname,
return;
}
return;
if (fnamecmp_type <= FNAMECMP_BASIS_DIR_HIGH)
-@@ -1239,7 +1243,7 @@ static void recv_generator(char *fname,
+@@ -1242,7 +1246,7 @@ static void recv_generator(char *fname,
goto notify_others;
}
if (!(backupptr = get_backup_name(fname))) {
close(fd);
return;
-@@ -1330,9 +1334,12 @@ void generate_files(int f_out, struct fi
+@@ -1333,9 +1337,12 @@ void generate_files(int f_out, struct fi
int save_ignore_existing = ignore_existing;
int save_ignore_non_existing = ignore_non_existing;
int save_do_progress = do_progress;
if (protocol_version >= 29) {
itemizing = 1;
maybe_ATTRS_REPORT = log_format_has_i ? 0 : ATTRS_REPORT;
-@@ -1360,7 +1367,7 @@ void generate_files(int f_out, struct fi
+@@ -1363,7 +1370,7 @@ void generate_files(int f_out, struct fi
do_delete_pass(flist);
do_progress = 0;
whole_file = 0;
if (verbose >= 2) {
rprintf(FINFO, "delta-transmission %s\n",
-@@ -1369,12 +1376,6 @@ void generate_files(int f_out, struct fi
+@@ -1372,12 +1379,6 @@ void generate_files(int f_out, struct fi
: "enabled");
}
for (i = 0; i < flist->count; i++) {
struct file_struct *file = flist->files[i];
-@@ -1418,23 +1419,34 @@ void generate_files(int f_out, struct fi
+@@ -1421,23 +1422,34 @@ void generate_files(int f_out, struct fi
delete_in_dir(NULL, NULL, NULL, NULL);
phase++;
if (local_name)
strlcpy(fbuf, local_name, sizeof fbuf);
else
-@@ -1446,27 +1458,43 @@ void generate_files(int f_out, struct fi
+@@ -1449,27 +1461,43 @@ void generate_files(int f_out, struct fi
phase++;
ignore_non_existing = save_ignore_non_existing;
ignore_existing = save_ignore_existing;
extern int allow_8bit_chars;
extern int protocol_version;
extern int preserve_times;
-@@ -71,7 +70,6 @@ struct {
+@@ -72,7 +71,6 @@ struct {
{ RERR_IPC , "error in IPC code" },
{ RERR_CRASHED , "sibling process crashed" },
{ RERR_TERMINATED , "sibling process terminated abnormally" },
{ RERR_SIGNAL , "received SIGINT, SIGTERM, or SIGHUP" },
{ RERR_WAITCHILD , "waitpid() failed" },
{ RERR_MALLOC , "error allocating core memory buffers" },
-@@ -224,8 +222,8 @@ void rwrite(enum logcode code, char *buf
+@@ -227,8 +225,8 @@ void rwrite(enum logcode code, char *buf
if (quiet && code == FINFO)
return;
extern int am_daemon;
extern int blocking_io;
extern int remove_sent_files;
-@@ -91,9 +90,20 @@ struct pid_status {
+@@ -93,9 +92,20 @@ struct pid_status {
static time_t starttime, endtime;
static int64 total_read, total_written;
/* Works like waitpid(), but if we already harvested the child pid in our
* remember_children(), we succeed instead of returning an error. */
pid_t wait_process(pid_t pid, int *status_ptr, int flags)
-@@ -170,7 +180,7 @@ static void handle_stats(int f)
+@@ -172,7 +182,7 @@ static void handle_stats(int f)
show_flist_stats();
}
return;
if (am_daemon) {
-@@ -634,12 +644,30 @@ static void do_server_sender(int f_in, i
+@@ -647,12 +657,30 @@ static void do_server_sender(int f_in, i
exit_cleanup(0);
}
/* The receiving side mustn't obey this, or an existing symlink that
* points to an identical file won't be replaced by the referent. */
-@@ -648,70 +676,16 @@ static int do_recv(int f_in,int f_out,st
+@@ -661,70 +689,16 @@ static int do_recv(int f_in,int f_out,st
if (preserve_hard_links)
init_hard_links();
generate_files(f_out, flist, local_name);
handle_stats(-1);
-@@ -722,10 +696,13 @@ static int do_recv(int f_in,int f_out,st
+@@ -735,10 +709,13 @@ static int do_recv(int f_in,int f_out,st
}
io_flush(FULL_FLUSH);
}
-@@ -1103,22 +1080,6 @@ static int start_client(int argc, char *
+@@ -1140,22 +1117,6 @@ static int start_client(int argc, char *
return ret;
}
RETSIGTYPE remember_children(UNUSED(int val))
{
#ifdef WNOHANG
-@@ -1210,8 +1171,6 @@ int main(int argc,char *argv[])
+@@ -1247,8 +1208,6 @@ int main(int argc,char *argv[])
# endif
sigact.sa_flags = SA_NOCLDSTOP;
#endif
int keep_partial = 0;
int safe_symlinks = 0;
int copy_unsafe_links = 0;
-@@ -1294,6 +1294,7 @@ int parse_arguments(int *argc, const cha
+@@ -1301,6 +1301,7 @@ int parse_arguments(int *argc, const cha
if (do_progress && !verbose && !log_before_transfer && !am_server)
verbose = 1;
exit_cleanup(RERR_IPC);
--- old/receiver.c
+++ new/receiver.c
-@@ -26,7 +26,7 @@ extern int verbose;
+@@ -25,7 +25,7 @@
+ extern int verbose;
extern int do_xfers;
- extern int am_daemon;
extern int am_server;
-extern int do_progress;
+extern int recv_progress;
extern int log_before_transfer;
extern int log_format_has_i;
- extern int daemon_log_format_has_i;
-@@ -155,7 +155,7 @@ static int receive_data(int f_in, char *
+ extern int logfile_format_has_i;
+@@ -154,7 +154,7 @@ static int receive_data(int f_in, char *
if (sum.remainder)
sum.flength -= sum.blength - sum.remainder;
for (j = CHUNK_SIZE; j < sum.flength; j += CHUNK_SIZE) {
show_progress(offset, total_size);
sum_update(map_ptr(mapbuf, offset, CHUNK_SIZE),
CHUNK_SIZE);
-@@ -163,7 +163,7 @@ static int receive_data(int f_in, char *
+@@ -162,7 +162,7 @@ static int receive_data(int f_in, char *
}
if (offset < sum.flength) {
int32 len = sum.flength - offset;
show_progress(offset, total_size);
sum_update(map_ptr(mapbuf, offset, len), len);
offset = sum.flength;
-@@ -176,7 +176,7 @@ static int receive_data(int f_in, char *
+@@ -175,7 +175,7 @@ static int receive_data(int f_in, char *
}
while ((i = recv_token(f_in, &data)) != 0) {
show_progress(offset, total_size);
if (i > 0) {
-@@ -244,7 +244,7 @@ static int receive_data(int f_in, char *
+@@ -243,7 +243,7 @@ static int receive_data(int f_in, char *
ftruncate(fd, offset);
#endif
end_progress(total_size);
if (fd != -1 && offset > 0 && sparse_end(fd) != 0) {
-@@ -295,12 +295,12 @@ static void handle_delayed_updates(struc
+@@ -294,12 +294,12 @@ static void handle_delayed_updates(struc
"rename failed for %s (from %s)",
full_fname(fname), partialptr);
} else {
handle_partial_dir(partialptr, PDIR_DELETE);
}
}
-@@ -351,11 +351,6 @@ int recv_files(int f_in, struct file_lis
+@@ -349,11 +349,6 @@ int recv_files(int f_in, struct file_lis
if (verbose > 2)
rprintf(FINFO,"recv_files(%d) starting\n",flist->count);
if (delay_updates)
delayed_bits = bitbag_create(flist->count);
-@@ -376,7 +371,7 @@ int recv_files(int f_in, struct file_lis
+@@ -374,7 +369,7 @@ int recv_files(int f_in, struct file_lis
rprintf(FINFO, "recv_files phase=%d\n", phase);
if (phase == 2 && delay_updates)
handle_delayed_updates(flist, local_name);
if (keep_partial && !partial_dir)
make_backups = 0; /* prevents double backup */
if (append_mode) {
-@@ -598,7 +593,7 @@ int recv_files(int f_in, struct file_lis
+@@ -596,7 +591,7 @@ int recv_files(int f_in, struct file_lis
/* log the transfer */
if (log_before_transfer)
log_item(file, &initial_stats, iflags, NULL);
rprintf(FINFO, "%s\n", fname);
/* recv file data */
-@@ -641,11 +636,13 @@ int recv_files(int f_in, struct file_lis
+@@ -644,11 +639,13 @@ int recv_files(int f_in, struct file_lis
cleanup_disable();
if (recv_ok > 0) {
} else if (!recv_ok) {
int msgtype = phase || read_batch ? FERROR : FINFO;
if (msgtype == FERROR || verbose) {
-@@ -668,8 +665,8 @@ int recv_files(int f_in, struct file_lis
+@@ -671,8 +668,8 @@ int recv_files(int f_in, struct file_lis
errstr, fname, keptstr, redostr);
}
if (!phase) {
}
--- old/rsync.h
+++ new/rsync.h
-@@ -168,10 +168,8 @@ enum msgcode {
+@@ -169,10 +169,8 @@ enum msgcode {
MSG_DATA=0, /* raw data on the multiplexed stream */
MSG_ERROR=FERROR, MSG_INFO=FINFO, /* remote logging */
MSG_LOG=FLOG, MSG_SOCKERR=FSOCKERR, /* sibling logging */
};
#include "errcode.h"
-@@ -322,6 +320,7 @@ enum msgcode {
+@@ -323,6 +321,7 @@ enum msgcode {
#endif
#include <assert.h>
extern unsigned int file_struct_len;
/* === ACL structures === */
-@@ -749,6 +750,10 @@ void receive_acl(struct file_struct *fil
+@@ -743,6 +744,10 @@ void receive_acl(struct file_struct *fil
type = SMB_ACL_TYPE_ACCESS;
racl_list = &access_acl_list;
ndx_ptr = (char*)file + file_struct_len;
do {
char tag = read_byte(f);
int ndx;
-@@ -807,6 +812,10 @@ void cache_acl(struct file_struct *file,
+@@ -801,6 +806,10 @@ void cache_acl(struct file_struct *file,
racl = sxp->acc_acl;
racl_list = &access_acl_list;
ndx_ptr = (char*)file + file_struct_len;
do {
if (!racl)
ndx = -1;
-@@ -922,6 +931,10 @@ int set_acl(const char *fname, const str
+@@ -916,6 +925,10 @@ int set_acl(const char *fname, const str
type = SMB_ACL_TYPE_ACCESS;
ndx_ptr = (char*)file + file_struct_len;
extern int preserve_links;
extern int preserve_hard_links;
extern int preserve_devices;
-@@ -502,7 +503,7 @@ static struct file_struct *receive_file_
+@@ -494,7 +495,7 @@ static struct file_struct *receive_file_
char thisname[MAXPATHLEN];
unsigned int l1 = 0, l2 = 0;
int alloc_len, basename_len, dirname_len, linkname_len, sum_len;
int xtra_len;
#endif
OFF_T file_length;
-@@ -614,10 +615,16 @@ static struct file_struct *receive_file_
+@@ -606,10 +607,16 @@ static struct file_struct *receive_file_
xtra_len = (S_ISDIR(mode) ? 2 : 1) * 4;
else
xtra_len = 0;
+ xtra_len
#endif
+ linkname_len + sum_len;
-@@ -626,7 +633,7 @@ static struct file_struct *receive_file_
+@@ -618,7 +625,7 @@ static struct file_struct *receive_file_
file = (struct file_struct *)bp;
memset(bp, 0, file_struct_len);
bp += file_struct_len;
bp += xtra_len;
#endif
-@@ -727,6 +734,10 @@ static struct file_struct *receive_file_
+@@ -717,6 +724,10 @@ static struct file_struct *receive_file_
if (preserve_acls)
receive_acl(file, f);
#endif
return file;
}
-@@ -997,6 +1008,13 @@ static struct file_struct *send_file_nam
+@@ -987,6 +998,13 @@ static struct file_struct *send_file_nam
return NULL;
}
#endif
maybe_emit_filelist_progress(flist->count + flist_count_offset);
-@@ -1009,11 +1027,19 @@ static struct file_struct *send_file_nam
+@@ -999,11 +1017,19 @@ static struct file_struct *send_file_nam
if (preserve_acls)
send_acl(&sx, f);
#endif
int preserve_perms = 0;
int preserve_executability = 0;
int preserve_devices = 0;
-@@ -196,6 +197,7 @@ static void print_rsync_version(enum log
+@@ -200,6 +201,7 @@ static void print_rsync_version(enum log
char const *have_inplace = "no ";
char const *hardlinks = "no ";
char const *acls = "no ";
char const *links = "no ";
char const *ipv6 = "no ";
STRUCT_STAT *dumstat;
-@@ -215,7 +217,9 @@ static void print_rsync_version(enum log
+@@ -219,7 +221,9 @@ static void print_rsync_version(enum log
#ifdef SUPPORT_ACLS
acls = "";
#endif
#ifdef SUPPORT_LINKS
links = "";
#endif
-@@ -229,9 +233,9 @@ static void print_rsync_version(enum log
+@@ -233,9 +237,9 @@ static void print_rsync_version(enum log
rprintf(f, "Copyright (C) 1996-2006 by Andrew Tridgell, Wayne Davison, and others.\n");
rprintf(f, "<http://rsync.samba.org/>\n");
rprintf(f, "Capabilities: %d-bit files, %ssocketpairs, "
/* Note that this field may not have type ino_t. It depends
* on the complicated interaction between largefile feature
-@@ -304,6 +308,9 @@ void usage(enum logcode F)
+@@ -308,6 +312,9 @@ void usage(enum logcode F)
#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");
-@@ -422,6 +429,9 @@ static struct poptOption long_options[]
+@@ -427,6 +434,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 },
{"no-A", 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 },
-@@ -1099,6 +1109,17 @@ int parse_arguments(int *argc, const cha
+@@ -1109,6 +1119,17 @@ int parse_arguments(int *argc, const cha
return 0;
#endif
default:
/* A large opt value means that set_refuse_options()
-@@ -1538,6 +1559,10 @@ void server_options(char **args,int *arg
+@@ -1560,6 +1581,10 @@ void server_options(char **args,int *arg
if (preserve_acls)
argstr[x++] = 'A';
#endif
+++ new/rsync.c
@@ -34,6 +34,7 @@ extern int verbose;
extern int dry_run;
- extern int daemon_log_format_has_i;
+ extern int logfile_format_has_i;
extern int preserve_acls;
+extern int preserve_xattrs;
extern int preserve_perms;
if ((sxp->st.st_mode & CHMOD_BITS) != (file->mode & CHMOD_BITS)) {
--- old/rsync.h
+++ new/rsync.h
-@@ -494,6 +494,10 @@ struct idev {
+@@ -495,6 +495,10 @@ struct idev {
#define ACLS_NEED_MASK 1
#endif
#define GID_NONE ((gid_t)-1)
#define HL_CHECK_MASTER 0
-@@ -686,6 +690,9 @@ typedef struct {
+@@ -687,6 +691,9 @@ typedef struct {
struct rsync_acl *acc_acl; /* access ACL */
struct rsync_acl *def_acl; /* default ACL */
#endif
--chmod=CHMOD change destination permissions
-o, --owner preserve owner (super-user only)
-g, --group preserve group
-@@ -807,6 +808,11 @@ version makes it incompatible with sendi
+@@ -809,6 +810,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.