./configure
make
-based-on: 11f4f34ed96eafd0ff9e1d5813e5476790a4b6e9
+based-on: 40afd365cc8ca968fd16e161d24df5b8a8a520cc
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
extern int keep_partial;
extern int got_xfer_error;
extern char *partial_dir;
-@@ -128,6 +131,14 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
+@@ -129,6 +132,14 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
who_am_i(), code, file, line);
}
+
/* FALLTHROUGH */
#include "case_N.h"
-
+ switch_step++;
diff --git a/clientserver.c b/clientserver.c
--- a/clientserver.c
+++ b/clientserver.c
}
static int exchange_protocols(int f_in, int f_out, char *buf, size_t bufsiz, int am_client)
-@@ -270,6 +283,32 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
+@@ -273,6 +286,32 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
if (verbose > 1)
print_child_argv("sending daemon args:", sargs);
io_printf(f_out, "%.*s\n", modlen, modname);
/* Old servers may just drop the connection here,
-@@ -295,6 +334,10 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
+@@ -298,6 +337,10 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
* server to terminate the listing of modules.
* We don't want to go on and transfer
* anything; just exit. */
exit(0);
}
-@@ -302,6 +345,10 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
+@@ -305,6 +348,10 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
rprintf(FERROR, "%s\n", line);
/* This is always fatal; the server will now
* close the socket. */
return -1;
}
-@@ -590,10 +637,17 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
+@@ -598,10 +645,17 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
return -1;
}
if (pid) {
if (asprintf(&p, "RSYNC_RAW_STATUS=%d", status) > 0)
putenv(p);
if (WIFEXITED(status))
-@@ -936,6 +990,9 @@ int start_daemon(int f_in, int f_out)
+@@ -944,6 +998,9 @@ int start_daemon(int f_in, int f_out)
if (exchange_protocols(f_in, f_out, line, sizeof line, 0) < 0)
return -1;
line[0] = 0;
if (!read_line_old(f_in, line, sizeof line))
return -1;
-@@ -947,6 +1004,20 @@ int start_daemon(int f_in, int f_out)
+@@ -955,6 +1012,20 @@ int start_daemon(int f_in, int f_out)
return -1;
}
if (*line == '#') {
/* it's some sort of command that I don't understand */
io_printf(f_out, "@ERROR: Unknown command '%s'\n", line);
-diff --git a/configure.in b/configure.in
---- a/configure.in
-+++ b/configure.in
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
@@ -312,6 +312,25 @@ if test x"$enable_locale" != x"no"; then
AC_DEFINE(CONFIG_LOCALE)
fi
diff --git a/main.c b/main.c
--- a/main.c
+++ b/main.c
-@@ -78,6 +78,9 @@ extern char *password_file;
+@@ -79,6 +79,9 @@ extern char *password_file;
extern char curr_dir[MAXPATHLEN];
extern struct file_list *first_flist;
extern struct filter_list_struct daemon_filter_list;
uid_t our_uid;
int am_receiver = 0; /* Only set to 1 after the receiver/generator fork. */
-@@ -136,6 +139,52 @@ pid_t wait_process(pid_t pid, int *status_ptr, int flags)
+@@ -137,6 +140,52 @@ pid_t wait_process(pid_t pid, int *status_ptr, int flags)
return waited_pid;
}
/* Wait for a process to exit, calling io_flush while waiting. */
static void wait_process_with_flush(pid_t pid, int *exit_code_ptr)
{
-@@ -717,6 +766,11 @@ static void do_server_sender(int f_in, int f_out, int argc, char *argv[])
+@@ -727,6 +776,11 @@ static void do_server_sender(int f_in, int f_out, int argc, char *argv[])
argv[0] = ".";
}
flist = send_file_list(f_out,argc,argv);
if (!flist || flist->used == 0)
exit_cleanup(0);
-@@ -818,6 +872,10 @@ static int do_recv(int f_in, int f_out, char *local_name)
+@@ -828,6 +882,10 @@ static int do_recv(int f_in, int f_out, char *local_name)
close(f_in);
io_start_buffering_out(f_out);
set_msg_fd_in(error_pipe[0]);
io_start_buffering_in(error_pipe[0]);
-@@ -1012,6 +1070,10 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[])
+@@ -1022,6 +1080,10 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[])
io_start_buffering_out(f_out);
if (!filesfrom_host)
set_msg_fd_in(f_in);
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -184,6 +184,14 @@ int logfile_format_has_o_or_i = 0;
+@@ -183,6 +183,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;
-@@ -224,6 +232,7 @@ static void print_rsync_version(enum logcode f)
+@@ -223,6 +231,7 @@ static void print_rsync_version(enum logcode f)
char const *links = "no ";
char const *iconv = "no ";
char const *ipv6 = "no ";
STRUCT_STAT *dumstat;
#if SUBPROTOCOL_VERSION != 0
-@@ -257,6 +266,9 @@ static void print_rsync_version(enum logcode f)
- #if defined HAVE_LUTIMES && defined HAVE_UTIMES
+@@ -256,6 +265,9 @@ static void print_rsync_version(enum logcode f)
+ #ifdef CAN_SET_SYMLINK_TIMES
symtimes = "";
#endif
+#ifdef HAVE_OPENSSL
rprintf(f, "%s version %s protocol version %d%s\n",
RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION, subprotocol);
-@@ -270,8 +282,8 @@ static void print_rsync_version(enum logcode f)
+@@ -269,8 +281,8 @@ static void print_rsync_version(enum logcode f)
(int)(sizeof (int64) * 8));
rprintf(f, " %ssocketpairs, %shardlinks, %ssymlinks, %sIPv6, batchfiles, %sinplace,\n",
got_socketpair, hardlinks, links, ipv6, have_inplace);
#ifdef MAINTAINER_MODE
rprintf(f, "Panic Action: \"%s\"\n", get_panic_action());
-@@ -433,6 +445,13 @@ void usage(enum logcode F)
+@@ -432,6 +444,13 @@ void usage(enum logcode F)
#endif
rprintf(F," -4, --ipv4 prefer IPv4\n");
rprintf(F," -6, --ipv6 prefer IPv6\n");
+ rprintf(F," --ssl-ca-certs=FILE path to trusted CA certificates\n");
+#endif
rprintf(F," --version print version number\n");
- rprintf(F,"(-h) --help show this help (-h works with no other options)\n");
+ rprintf(F,"(-h) --help show this help (-h is --help only if used alone)\n");
-@@ -446,7 +465,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -445,7 +464,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
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[] = {
-@@ -649,6 +668,13 @@ static struct poptOption long_options[] = {
+@@ -648,6 +667,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 },
-@@ -674,6 +700,13 @@ static void daemon_usage(enum logcode F)
+@@ -673,6 +699,13 @@ static void daemon_usage(enum logcode F)
rprintf(F," -v, --verbose increase verbosity\n");
rprintf(F," -4, --ipv4 prefer IPv4\n");
rprintf(F," -6, --ipv6 prefer IPv6\n");
rprintf(F," --help show this help screen\n");
rprintf(F,"\n");
-@@ -698,6 +731,13 @@ static struct poptOption long_daemon_options[] = {
+@@ -697,6 +730,13 @@ static struct poptOption long_daemon_options[] = {
{"protocol", 0, POPT_ARG_INT, &protocol_version, 0, 0, 0 },
{"server", 0, POPT_ARG_NONE, &am_server, 0, 0, 0 },
{"temp-dir", 'T', POPT_ARG_STRING, &tmpdir, 0, 0, 0 },
{"verbose", 'v', POPT_ARG_NONE, 0, 'v', 0, 0 },
{"no-verbose", 0, POPT_ARG_VAL, &verbose, 0, 0, 0 },
{"no-v", 0, POPT_ARG_VAL, &verbose, 0, 0, 0 },
-@@ -979,6 +1019,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -978,6 +1018,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
verbose++;
break;
default:
rprintf(FERROR,
"rsync: %s: %s (in daemon mode)\n",
-@@ -1002,6 +1048,17 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1001,6 +1047,17 @@ int parse_arguments(int *argc_p, const char ***argv_p)
exit_cleanup(RERR_SYNTAX);
}
*argv_p = argv = poptGetArgs(pc);
*argc_p = argc = count_args(argv);
am_starting_up = 0;
-@@ -1260,6 +1317,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1259,6 +1316,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
return 0;
#endif
default:
/* A large opt value means that set_refuse_options()
* turned this option off. */
-@@ -1599,6 +1662,17 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1604,6 +1667,17 @@ int parse_arguments(int *argc_p, const char ***argv_p)
if (delay_updates && !partial_dir)
partial_dir = tmp_partialdir;
if (inplace) {
#ifdef HAVE_FTRUNCATE
if (partial_dir) {
-@@ -2147,9 +2221,26 @@ static char *parse_hostspec(char *str, char **path_start_ptr, int *port_ptr)
+@@ -2152,9 +2226,26 @@ static char *parse_hostspec(char *str, char **path_start_ptr, int *port_ptr)
char *check_for_hostspec(char *s, char **host_ptr, int *port_ptr)
{
char *path;
#define SYMLINK_PREFIX "/rsyncd-munged/" /* This MUST have a trailing slash! */
#define SYMLINK_PREFIX_LEN ((int)sizeof SYMLINK_PREFIX - 1)
-@@ -550,6 +551,11 @@ typedef unsigned int size_t;
+@@ -569,6 +570,11 @@ typedef unsigned int size_t;
# define SIZEOF_INT64 SIZEOF_OFF_T
#endif