The patches for 3.0.9.
[rsync.git/patches.git] / openssl-support.diff
index bb3c4a2fd0a22ee40e568517def295a1854ce497..efc55430b1eb04e11e96a469e8ec542508ff4113 100644 (file)
@@ -35,7 +35,7 @@ To use this patch, run these commands for a successful build:
     ./configure
     make
 
-based-on: 11f4f34ed96eafd0ff9e1d5813e5476790a4b6e9
+based-on: 40afd365cc8ca968fd16e161d24df5b8a8a520cc
 diff --git a/Makefile.in b/Makefile.in
 --- a/Makefile.in
 +++ b/Makefile.in
@@ -61,7 +61,7 @@ diff --git a/cleanup.c b/cleanup.c
  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);
                }
  
@@ -75,7 +75,7 @@ diff --git a/cleanup.c b/cleanup.c
 +
                /* FALLTHROUGH */
  #include "case_N.h"
+               switch_step++;
 diff --git a/clientserver.c b/clientserver.c
 --- a/clientserver.c
 +++ b/clientserver.c
@@ -109,7 +109,7 @@ diff --git 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);
  
@@ -142,7 +142,7 @@ diff --git a/clientserver.c b/clientserver.c
        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. */
@@ -153,7 +153,7 @@ diff --git a/clientserver.c b/clientserver.c
                        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. */
@@ -164,7 +164,7 @@ diff --git a/clientserver.c b/clientserver.c
                        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) {
@@ -182,7 +182,7 @@ diff --git a/clientserver.c b/clientserver.c
                                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;
  
@@ -192,7 +192,7 @@ diff --git a/clientserver.c b/clientserver.c
        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;
        }
  
@@ -213,9 +213,9 @@ diff --git a/clientserver.c b/clientserver.c
        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
@@ -245,7 +245,7 @@ diff --git a/configure.in b/configure.in
 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;
@@ -255,7 +255,7 @@ diff --git a/main.c b/main.c
  
  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;
  }
  
@@ -308,7 +308,7 @@ diff --git a/main.c b/main.c
  /* 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] = ".";
        }
  
@@ -320,7 +320,7 @@ diff --git a/main.c b/main.c
        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);
@@ -331,7 +331,7 @@ diff --git a/main.c b/main.c
  
        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);
@@ -345,7 +345,7 @@ diff --git a/main.c b/main.c
 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;
  
@@ -360,7 +360,7 @@ diff --git a/options.c b/options.c
  #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 ";
@@ -368,8 +368,8 @@ diff --git a/options.c b/options.c
        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
@@ -378,7 +378,7 @@ diff --git a/options.c b/options.c
  
        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);
@@ -389,7 +389,7 @@ diff --git a/options.c b/options.c
  
  #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");
@@ -401,9 +401,9 @@ diff --git a/options.c b/options.c
 +  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,
@@ -412,7 +412,7 @@ diff --git a/options.c b/options.c
        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 },
@@ -426,7 +426,7 @@ diff --git a/options.c b/options.c
    /* 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");
@@ -440,7 +440,7 @@ diff --git a/options.c b/options.c
    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 },
@@ -454,7 +454,7 @@ diff --git a/options.c b/options.c
    {"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;
  
@@ -467,7 +467,7 @@ diff --git a/options.c b/options.c
                                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);
                        }
  
@@ -485,7 +485,7 @@ diff --git a/options.c b/options.c
                        *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
  
@@ -498,7 +498,7 @@ diff --git a/options.c b/options.c
                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;
  
@@ -516,7 +516,7 @@ diff --git a/options.c b/options.c
        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;
@@ -557,7 +557,7 @@ diff --git a/rsync.h b/rsync.h
  
  #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