Fixed a failing hunk.
[rsync/rsync-patches.git] / openssl-support.diff
index 870f24c..1e34fad 100644 (file)
@@ -37,7 +37,7 @@ All warnings apply; I don't do C programming all that often, so I
 can't say if I've left any cleanup/compatibility errors in the code.
 
 
---- orig/Makefile.in   2004-10-08 20:16:26
+--- orig/Makefile.in   2004-11-03 11:56:03
 +++ Makefile.in        2004-10-08 20:17:06
 @@ -39,7 +39,7 @@ OBJS3=progress.o pipe.o
  DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
@@ -46,21 +46,21 @@ can't say if I've left any cleanup/compatibility errors in the code.
 -OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) $(ZLIBOBJ) @BUILD_POPT@
 +OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) $(ZLIBOBJ) @BUILD_POPT@ @SSL_OBJS@
  
- TLS_OBJ = tls.o syscall.o lib/compat.o lib/permstring.o
+ TLS_OBJ = tls.o syscall.o lib/compat.o lib/snprintf.o lib/permstring.o
+--- orig/cleanup.c     2005-01-10 09:46:11
++++ cleanup.c  2005-01-10 10:43:22
+@@ -22,6 +22,9 @@
+ #include "rsync.h"
  
---- orig/cleanup.c     2004-07-29 16:08:03
-+++ cleanup.c  2004-07-03 20:22:28
-@@ -24,6 +24,9 @@
  extern int io_error;
- extern int keep_partial;
- extern int log_got_error;
 +#ifdef HAVE_OPENSSL
 +extern int use_ssl;
 +#endif
- /**
-  * Close all open sockets and files, allowing a (somewhat) graceful
-@@ -97,6 +100,11 @@ void _exit_cleanup(int code, const char 
+ extern int keep_partial;
+ extern int log_got_error;
+ extern char *partial_dir;
+@@ -98,6 +101,11 @@ void _exit_cleanup(int code, const char 
        signal(SIGUSR1, SIG_IGN);
        signal(SIGUSR2, SIG_IGN);
  
@@ -72,9 +72,9 @@ can't say if I've left any cleanup/compatibility errors in the code.
        if (verbose > 3) {
                rprintf(FINFO,"_exit_cleanup(code=%d, file=%s, line=%d): entered\n",
                        code, file, line);
---- orig/clientserver.c        2004-08-02 02:29:16
+--- orig/clientserver.c        2005-01-01 21:11:00
 +++ clientserver.c     2004-10-08 20:44:59
-@@ -46,6 +46,9 @@ extern int io_timeout;
+@@ -47,6 +47,9 @@ extern int select_timeout;
  extern int orig_umask;
  extern int no_detach;
  extern int default_af_hint;
@@ -84,7 +84,7 @@ can't say if I've left any cleanup/compatibility errors in the code.
  extern char *bind_address;
  extern struct exclude_list_struct server_exclude_list;
  extern char *exclude_path_prefix;
-@@ -94,8 +97,18 @@ int start_socket_client(char *host, char
+@@ -98,8 +101,18 @@ int start_socket_client(char *host, char
                exit_cleanup(RERR_SOCKETIO);
  
        ret = start_inband_exchange(user, path, fd, fd, argc);
@@ -104,7 +104,7 @@ can't say if I've left any cleanup/compatibility errors in the code.
  }
  
  int start_inband_exchange(char *user, char *path, int f_in, int f_out, 
-@@ -150,6 +163,33 @@ int start_inband_exchange(char *user, ch
+@@ -154,6 +167,33 @@ int start_inband_exchange(char *user, ch
        if (protocol_version > remote_protocol)
                protocol_version = remote_protocol;
  
@@ -138,7 +138,7 @@ can't say if I've left any cleanup/compatibility errors in the code.
        p = strchr(path,'/');
        if (p) *p = 0;
        io_printf(f_out, "%s\n", path);
-@@ -178,6 +218,10 @@ int start_inband_exchange(char *user, ch
+@@ -182,6 +222,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. */
@@ -149,7 +149,7 @@ can't say if I've left any cleanup/compatibility errors in the code.
                        exit(0);
                }
  
-@@ -185,6 +229,10 @@ int start_inband_exchange(char *user, ch
+@@ -189,6 +233,10 @@ int start_inband_exchange(char *user, ch
                        rprintf(FERROR, "%s\n", line);
                        /* This is always fatal; the server will now
                         * close the socket. */
@@ -160,7 +160,7 @@ can't say if I've left any cleanup/compatibility errors in the code.
                        return RERR_STARTCLIENT;
                } else {
                        rprintf(FINFO,"%s\n", line);
-@@ -497,6 +545,7 @@ static void send_listing(int fd)
+@@ -504,6 +552,7 @@ static void send_listing(int fd)
                io_printf(fd,"@RSYNCD: EXIT\n");
  }
  
@@ -168,7 +168,7 @@ can't say if I've left any cleanup/compatibility errors in the code.
  /* 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 */
-@@ -546,6 +595,9 @@ int start_daemon(int f_in, int f_out)
+@@ -553,6 +602,9 @@ int start_daemon(int f_in, int f_out)
        if (protocol_version > remote_protocol)
                protocol_version = remote_protocol;
  
@@ -178,7 +178,7 @@ can't say if I've left any cleanup/compatibility errors in the code.
        line[0] = 0;
        if (!read_line(f_in, line, sizeof line - 1))
                return -1;
-@@ -555,6 +607,20 @@ int start_daemon(int f_in, int f_out)
+@@ -562,6 +614,20 @@ int start_daemon(int f_in, int f_out)
                return -1;
        }
  
@@ -199,7 +199,7 @@ can't say if I've left any cleanup/compatibility errors in the code.
        if (*line == '#') {
                /* it's some sort of command that I don't understand */
                io_printf(f_out, "@ERROR: Unknown command '%s'\n", line);
---- orig/configure.in  2004-10-06 00:12:16
+--- orig/configure.in  2005-01-10 00:21:12
 +++ configure.in       2004-07-03 20:22:28
 @@ -271,6 +271,21 @@ yes
        AC_SEARCH_LIBS(getaddrinfo, inet6)
@@ -223,7 +223,7 @@ can't say if I've left any cleanup/compatibility errors in the code.
  AC_MSG_CHECKING([whether to call shutdown on all sockets])
  case $host_os in
        *cygwin* ) AC_MSG_RESULT(yes)
---- orig/main.c        2004-10-08 20:16:26
+--- orig/main.c        2005-01-10 00:22:54
 +++ main.c     2004-10-08 20:15:28
 @@ -56,6 +56,9 @@ extern int write_batch;
  extern int batch_fd;
@@ -235,7 +235,7 @@ can't say if I've left any cleanup/compatibility errors in the code.
  extern pid_t cleanup_child_pid;
  extern char *files_from;
  extern char *remote_filesfrom_file;
-@@ -777,33 +780,48 @@ static int start_client(int argc, char *
+@@ -806,33 +809,48 @@ static int start_client(int argc, char *
        if ((rc = copy_argv(argv)))
                return rc;
  
@@ -308,7 +308,7 @@ can't say if I've left any cleanup/compatibility errors in the code.
                p = find_colon(argv[0]);
                if (p) { /* source is remote */
                        if (remote_filesfrom_file
-@@ -835,12 +853,26 @@ static int start_client(int argc, char *
+@@ -864,12 +882,26 @@ static int start_client(int argc, char *
                        argv++;
                } else { /* source is local */
                        am_sender = 1;
@@ -338,9 +338,9 @@ can't say if I've left any cleanup/compatibility errors in the code.
                                p = strchr(host,'/');
                                if (p) {
                                        *p = '\0';
---- orig/options.c     2004-10-08 20:16:26
-+++ options.c  2004-07-16 20:19:50
-@@ -135,6 +135,14 @@ int quiet = 0;
+--- orig/options.c     2005-01-01 21:11:00
++++ options.c  2004-11-27 18:31:46
+@@ -138,6 +138,14 @@ int quiet = 0;
  int always_checksum = 0;
  int list_only = 0;
  
@@ -355,7 +355,7 @@ can't say if I've left any cleanup/compatibility errors in the code.
  #define MAX_BATCH_NAME_LEN 256        /* Must be less than MAXPATHLEN-13 */
  char *batch_name = NULL;
  
-@@ -154,6 +162,7 @@ static void print_rsync_version(enum log
+@@ -161,6 +169,7 @@ static void print_rsync_version(enum log
        char const *hardlinks = "no ";
        char const *links = "no ";
        char const *ipv6 = "no ";
@@ -363,7 +363,7 @@ can't say if I've left any cleanup/compatibility errors in the code.
        STRUCT_STAT *dumstat;
  
  #ifdef HAVE_SOCKETPAIR
-@@ -176,6 +185,10 @@ static void print_rsync_version(enum log
+@@ -183,6 +192,10 @@ static void print_rsync_version(enum log
        ipv6 = "";
  #endif
  
@@ -374,7 +374,7 @@ can't say if I've left any cleanup/compatibility errors in the code.
        rprintf(f, "%s  version %s  protocol version %d\n",
                RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION);
        rprintf(f,
-@@ -189,10 +202,10 @@ static void print_rsync_version(enum log
+@@ -196,10 +209,10 @@ 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. */
@@ -387,7 +387,7 @@ can't say if I've left any cleanup/compatibility errors in the code.
  #ifdef MAINTAINER_MODE
        rprintf(f, "              panic action: \"%s\"\n",
                get_panic_action());
-@@ -308,6 +321,13 @@ void usage(enum logcode F)
+@@ -312,6 +325,13 @@ void usage(enum logcode F)
    rprintf(F," -4, --ipv4                  prefer IPv4\n");
    rprintf(F," -6, --ipv6                  prefer IPv6\n");
  #endif
@@ -400,33 +400,33 @@ can't say if I've left any cleanup/compatibility errors in the code.
 +#endif
    rprintf(F," -h, --help                  show this help screen\n");
  
-   rprintf(F,"\n");
-@@ -319,7 +339,7 @@ void usage(enum logcode F)
enum {OPT_VERSION = 1000, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
-       OPT_DELETE_AFTER, OPT_DELETE_EXCLUDED, OPT_LINK_DEST,
+   rprintf(F,"\nUse \"rsync --daemon --help\" to see the daemon-mode command-line options.\n");
+@@ -323,7 +343,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OP
      OPT_DELETE_AFTER, OPT_DELETE_EXCLUDED,
+       OPT_COMPARE_DEST, OPT_COPY_DEST, OPT_LINK_DEST,
        OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW,
--      OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_TIMEOUT,
-+      OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_TIMEOUT, OPT_USE_SSL,
+-      OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_TIMEOUT, OPT_MAX_SIZE,
++      OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_TIMEOUT, OPT_MAX_SIZE, OPT_USE_SSL,
        OPT_REFUSED_BASE = 9000};
  
  static struct poptOption long_options[] = {
-@@ -408,6 +428,13 @@ static struct poptOption long_options[] 
+@@ -410,6 +430,13 @@ static struct poptOption long_options[] 
    {"ipv4",            '4', POPT_ARG_VAL,    &default_af_hint, AF_INET, 0, 0 },
    {"ipv6",            '6', POPT_ARG_VAL,    &default_af_hint, AF_INET6, 0, 0 },
  #endif
 +#ifdef HAVE_OPENSSL
-+  {"ssl",              0,  POPT_ARG_NONE,   0,               OPT_USE_SSL, 0, 0},
-+  {"ssl-cert",         0,  POPT_ARG_STRING, &ssl_cert_path,  OPT_USE_SSL, 0, 0},
-+  {"ssl-key",          0,  POPT_ARG_STRING, &ssl_key_path,   OPT_USE_SSL, 0, 0},
++  {"ssl",              0,  POPT_ARG_NONE,   0, OPT_USE_SSL, 0, 0},
++  {"ssl-cert",         0,  POPT_ARG_STRING, &ssl_cert_path, OPT_USE_SSL, 0, 0},
++  {"ssl-key",          0,  POPT_ARG_STRING, &ssl_key_path, OPT_USE_SSL, 0, 0},
 +  {"ssl-key-passwd",   0,  POPT_ARG_STRING, &ssl_key_passwd, OPT_USE_SSL, 0, 0},
-+  {"ssl-ca-certs",     0,  POPT_ARG_STRING, &ssl_ca_path,    OPT_USE_SSL, 0, 0},
++  {"ssl-ca-certs",     0,  POPT_ARG_STRING, &ssl_ca_path, OPT_USE_SSL, 0, 0},
 +#endif
-   {0,0,0,0, 0, 0, 0}
- };
-@@ -616,6 +643,12 @@ int parse_arguments(int *argc, const cha
-                       return 0;
- #endif
+   /* All these options switch us into daemon-mode option-parsing. */
+   {"address",          0,  POPT_ARG_STRING, 0, OPT_DAEMON, 0, 0 },
+   {"config",           0,  POPT_ARG_STRING, 0, OPT_DAEMON, 0, 0 },
+@@ -750,6 +777,12 @@ int parse_arguments(int *argc, const cha
+                       basis_dir[basis_dir_cnt++] = (char *)arg;
+                       break;
  
 +              case OPT_USE_SSL:
 +#ifdef HAVE_OPENSSL
@@ -437,9 +437,9 @@ can't say if I've left any cleanup/compatibility errors in the code.
                default:
                        /* A large opt value means that set_refuse_options()
                         * turned this option off (opt-BASE is its index). */
-@@ -807,6 +840,17 @@ int parse_arguments(int *argc, const cha
-       if (do_progress && !verbose)
-               verbose = 1;
+@@ -944,6 +977,17 @@ int parse_arguments(int *argc, const cha
+                       bwlimit_writemax = 512;
+       }
  
 +#ifdef HAVE_OPENSSL
 +      if (use_ssl) {
@@ -452,10 +452,10 @@ can't say if I've left any cleanup/compatibility errors in the code.
 +      }
 +#endif
 +
-       if (bwlimit) {
-               bwlimit_writemax = (size_t)bwlimit * 128;
-               if (bwlimit_writemax < 512)
---- orig/rsync.h       2004-09-22 08:47:31
+       if (inplace) {
+ #if HAVE_FTRUNCATE
+               if (partial_dir) {
+--- orig/rsync.h       2005-01-10 00:21:12
 +++ rsync.h    2004-10-08 21:01:33
 @@ -32,6 +32,7 @@
  
@@ -465,7 +465,7 @@ can't say if I've left any cleanup/compatibility errors in the code.
  
  #define BACKUP_SUFFIX "~"
  
-@@ -330,6 +331,11 @@ enum msgcode {
+@@ -340,6 +341,11 @@ enum msgcode {
  #define uint64 unsigned off_t
  #endif