else
ok = do_rmdir(fname) == 0;
if (ok) {
---- orig/options.c 2005-02-25 18:44:31
-+++ options.c 2005-02-21 11:02:45
+--- orig/options.c 2005-03-01 01:22:59
++++ options.c 2005-03-01 01:25:39
@@ -127,10 +127,14 @@ int no_detach
int write_batch = 0;
int read_batch = 0;
backup_dir = sanitize_path(NULL, backup_dir, NULL, 0);
+ if (backup_dir_dels)
+ backup_dir_dels = sanitize_path(NULL, backup_dir_dels, NULL, 0);
- if (files_from)
- files_from = sanitize_path(NULL, files_from, NULL, 0);
}
-@@ -1036,6 +1048,12 @@ int parse_arguments(int *argc, const cha
- if (check_filter(elp, backup_dir, 1) < 0)
- goto options_rejected;
+ if (server_filter_list.head && !am_sender) {
+ struct filter_list_struct *elp = &server_filter_list;
+@@ -1038,6 +1050,14 @@ int parse_arguments(int *argc, const cha
+ return 0;
+ }
}
+ /* Clean backup_dir_dels same as for backup_dir */
+ if (backup_dir_dels) {
++ if (!*backup_dir_dels)
++ goto options_rejected;
+ clean_fname(backup_dir_dels, 1);
+ if (check_filter(elp, backup_dir_dels, 1) < 0)
+ goto options_rejected;
+ }
}
- if (server_filter_list.head && files_from) {
- if (!*files_from)
-@@ -1058,6 +1076,16 @@ int parse_arguments(int *argc, const cha
+
+ if (!backup_suffix)
+@@ -1049,6 +1069,16 @@ int parse_arguments(int *argc, const cha
backup_suffix);
return 0;
}
if (backup_dir) {
backup_dir_len = strlcpy(backup_dir_buf, backup_dir, sizeof backup_dir_buf);
backup_dir_remainder = sizeof backup_dir_buf - backup_dir_len;
-@@ -1079,6 +1107,31 @@ int parse_arguments(int *argc, const cha
+@@ -1070,6 +1100,31 @@ int parse_arguments(int *argc, const cha
"--suffix cannot be a null string without --backup-dir\n");
return 0;
}
if (make_backups && !backup_dir)
omit_dir_times = 1;
-@@ -1346,6 +1399,10 @@ void server_options(char **args,int *arg
+@@ -1348,6 +1403,10 @@ void server_options(char **args,int *arg
args[ac++] = "--backup-dir";
args[ac++] = backup_dir;
}
/* Only send --suffix if it specifies a non-default value. */
if (strcmp(backup_suffix, backup_dir ? "" : BACKUP_SUFFIX) != 0) {
-@@ -1354,7 +1411,13 @@ void server_options(char **args,int *arg
+@@ -1356,7 +1415,13 @@ void server_options(char **args,int *arg
goto oom;
args[ac++] = arg;
}
file->uid = st.st_uid;
file->gid = st.st_gid;
---- orig/options.c 2005-02-25 18:44:31
-+++ options.c 2005-02-16 15:38:40
+--- orig/options.c 2005-03-01 01:22:59
++++ options.c 2005-03-01 01:26:56
@@ -140,6 +140,7 @@ char *log_format = NULL;
char *password_file = NULL;
char *rsync_path = RSYNC_PATH;
{"devices", 'D', POPT_ARG_NONE, &preserve_devices, 0, 0, 0 },
{"times", 't', POPT_ARG_NONE, &preserve_times, 0, 0, 0 },
{"omit-dir-times", 'O', POPT_ARG_VAL, &omit_dir_times, 2, 0, 0 },
-@@ -1082,6 +1087,13 @@ int parse_arguments(int *argc, const cha
+@@ -1073,6 +1078,13 @@ int parse_arguments(int *argc, const cha
if (make_backups && !backup_dir)
omit_dir_times = 1;
if (log_format) {
if (strstr(log_format, "%i") != NULL)
log_format_has_i = 1;
-@@ -1433,6 +1445,11 @@ void server_options(char **args,int *arg
+@@ -1435,6 +1447,11 @@ void server_options(char **args,int *arg
}
}
+ args[ac++] = chmod_mode;
+ }
+
- if (files_from && (!am_sender || remote_filesfrom_file)) {
- if (remote_filesfrom_file) {
+ if (files_from && (!am_sender || filesfrom_host)) {
+ if (filesfrom_host) {
args[ac++] = "--files-from";
---- orig/rsync.yo 2005-02-28 02:16:55
+--- orig/rsync.yo 2005-03-01 01:22:59
+++ rsync.yo 2005-01-24 01:48:43
@@ -322,6 +322,7 @@ to the detailed description below for a
-D, --devices preserve devices (root only)
+}
+
+#endif
---- orig/options.c 2005-02-25 18:44:31
-+++ options.c 2005-02-14 02:52:09
+--- orig/options.c 2005-03-01 01:22:59
++++ options.c 2005-03-01 01:27:55
@@ -140,6 +140,7 @@ char *log_format = NULL;
char *password_file = NULL;
char *rsync_path = RSYNC_PATH;
default:
/* A large opt value means that set_refuse_options()
* turned this option off. */
-@@ -1433,6 +1451,11 @@ void server_options(char **args,int *arg
+@@ -1435,6 +1453,11 @@ void server_options(char **args,int *arg
}
}
+ args[ac++] = link_by_hash_dir;
+ }
+
- if (files_from && (!am_sender || remote_filesfrom_file)) {
- if (remote_filesfrom_file) {
+ if (files_from && (!am_sender || filesfrom_host)) {
+ if (filesfrom_host) {
args[ac++] = "--files-from";
--- orig/receiver.c 2005-02-26 19:27:54
+++ receiver.c 2005-01-15 21:29:13
#include "byteorder.h"
#include "lib/mdfour.h"
---- orig/rsync.yo 2005-02-28 02:16:55
+--- orig/rsync.yo 2005-03-01 01:22:59
+++ rsync.yo 2005-02-13 06:58:47
@@ -355,6 +355,7 @@ to the detailed description below for a
-y, --fuzzy find similar file for basis if no dest file
if (verbose > 3) {
rprintf(FINFO,"_exit_cleanup(code=%d, file=%s, line=%d): entered\n",
code, safe_fname(file), line);
---- orig/clientserver.c 2005-02-27 07:33:41
+--- orig/clientserver.c 2005-03-01 01:22:59
+++ clientserver.c 2004-10-08 20:44:59
@@ -45,6 +45,9 @@ extern int select_timeout;
extern int orig_umask;
return RERR_STARTCLIENT;
} else {
rprintf(FINFO,"%s\n", line);
-@@ -536,6 +584,7 @@ static void send_listing(int fd)
+@@ -552,6 +600,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 */
-@@ -585,6 +634,9 @@ int start_daemon(int f_in, int f_out)
+@@ -601,6 +650,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;
-@@ -594,6 +646,20 @@ int start_daemon(int f_in, int f_out)
+@@ -610,6 +662,20 @@ int start_daemon(int f_in, int f_out)
return -1;
}
AC_MSG_CHECKING([whether to call shutdown on all sockets])
case $host_os in
*cygwin* ) AC_MSG_RESULT(yes)
---- orig/main.c 2005-02-28 02:16:55
-+++ main.c 2004-10-08 20:15:28
-@@ -56,6 +56,9 @@ extern int write_batch;
- extern int batch_fd;
- extern int batch_gen_fd;
- extern int filesfrom_fd;
-+#if HAVE_OPENSSL
-+extern int use_ssl;
-+#endif
- extern pid_t cleanup_child_pid;
- extern struct stats stats;
- extern char *files_from;
-@@ -866,33 +869,48 @@ static int start_client(int argc, char *
- if ((rc = copy_argv(argv)))
- return rc;
-
-- /* rsync:// always uses rsync server over direct socket connection */
-- if (strncasecmp(URL_PREFIX, argv[0], strlen(URL_PREFIX)) == 0
-- && !read_batch) {
-- char *host, *path;
-+ if (!read_batch) { /* for read_batch, NO source is specified */
-+ int url_prefix_len = sizeof URL_PREFIX - 1;
-
-- host = argv[0] + strlen(URL_PREFIX);
-- p = strchr(host,'/');
-- if (p) {
-- *p = '\0';
-- path = p+1;
-- } else
-- path = "";
-- if (*host == '[' && (p = strchr(host, ']')) != NULL) {
-- host++;
-- *p++ = '\0';
-- if (*p != ':')
-- p = NULL;
-- } else
-- p = strchr(host, ':');
-- if (p) {
-- rsync_port = atoi(p+1);
-- *p = '\0';
-+ /* rsync:// always uses rsync server over direct socket connection */
-+ if (strncasecmp(URL_PREFIX, argv[0], url_prefix_len) != 0) {
-+#if HAVE_OPENSSL
-+ url_prefix_len = sizeof SSL_URL_PREFIX - 1;
-+ if (strncasecmp(SSL_URL_PREFIX, argv[0], url_prefix_len) != 0)
-+ url_prefix_len = 0;
-+ else {
-+ if (!use_ssl)
-+ init_tls();
-+ use_ssl = 1;
-+ }
-+#else
-+ url_prefix_len = 0;
-+#endif
-+ }
-+ if (url_prefix_len) {
-+ char *host, *path;
-+
-+ host = argv[0] + url_prefix_len;
-+ p = strchr(host,'/');
-+ if (p) {
-+ *p = '\0';
-+ path = p+1;
-+ } else
-+ path = "";
-+ if (*host == '[' && (p = strchr(host, ']')) != NULL) {
-+ host++;
-+ *p++ = '\0';
-+ if (*p != ':')
-+ p = NULL;
-+ } else
-+ p = strchr(host, ':');
-+ if (p) {
-+ rsync_port = atoi(p+1);
-+ *p = '\0';
-+ }
-+ return start_socket_client(host, path, argc-1, argv+1);
- }
-- return start_socket_client(host, path, argc-1, argv+1);
-- }
-
-- if (!read_batch) { /* for read_batch, NO source is specified */
- p = find_colon(argv[0]);
- if (p) { /* source is remote */
- if (remote_filesfrom_file
-@@ -924,12 +942,26 @@ static int start_client(int argc, char *
- argv++;
- } else { /* source is local */
- am_sender = 1;
--
-+ url_prefix_len = sizeof URL_PREFIX - 1;
- /* rsync:// destination uses rsync server over direct socket */
-- if (strncasecmp(URL_PREFIX, argv[argc-1], strlen(URL_PREFIX)) == 0) {
-+ if (strncasecmp(URL_PREFIX, argv[argc-1], url_prefix_len) != 0) {
-+#if HAVE_OPENSSL
-+ url_prefix_len = sizeof SSL_URL_PREFIX - 1;
-+ if (strncasecmp(SSL_URL_PREFIX, argv[argc-1], url_prefix_len) != 0)
-+ url_prefix_len = 0;
-+ else {
-+ if (!use_ssl)
-+ init_tls();
-+ use_ssl = 1;
-+ }
-+#else
-+ url_prefix_len = 0;
-+#endif
-+ }
-+ if (url_prefix_len) {
- char *host, *path;
-
-- host = argv[argc-1] + strlen(URL_PREFIX);
-+ host = argv[argc-1] + url_prefix_len;
- p = strchr(host,'/');
- if (p) {
- *p = '\0';
---- orig/options.c 2005-02-25 18:44:31
-+++ options.c 2004-11-27 18:31:46
+--- orig/options.c 2005-03-01 01:22:59
++++ options.c 2005-03-01 01:34:42
@@ -155,6 +155,14 @@ int log_format_has_o_or_i = 0;
int always_checksum = 0;
int list_only = 0;
default:
/* A large opt value means that set_refuse_options()
* turned this option off. */
-@@ -1117,6 +1150,17 @@ int parse_arguments(int *argc, const cha
+@@ -1108,6 +1141,17 @@ int parse_arguments(int *argc, const cha
if (delay_updates && !partial_dir)
partial_dir = partialdir_for_delayupdate;
if (inplace) {
#ifdef HAVE_FTRUNCATE
if (partial_dir) {
+@@ -1475,11 +1519,28 @@ char *check_for_hostspec(char *s, char *
+ {
+ char *p;
+ int not_host;
++ int url_prefix_len = sizeof URL_PREFIX - 1;
+
+- if (port_ptr && strncasecmp(URL_PREFIX, s, strlen(URL_PREFIX)) == 0) {
++ if (!port_ptr)
++ url_prefix_len = 0;
++ else if (strncasecmp(URL_PREFIX, s, url_prefix_len) != 0) {
++#if HAVE_OPENSSL
++ url_prefix_len = sizeof SSL_URL_PREFIX - 1;
++ if (strncasecmp(SSL_URL_PREFIX, s, url_prefix_len) != 0)
++ url_prefix_len = 0;
++ else {
++ if (!use_ssl)
++ init_tls();
++ use_ssl = 1;
++ }
++#else
++ url_prefix_len = 0;
++#endif
++ }
++ if (url_prefix_len) {
+ char *path;
+ int hostlen;
+- s += strlen(URL_PREFIX);
++ s += url_prefix_len;
+ if ((p = strchr(s, '/')) != NULL) {
+ hostlen = p - s;
+ path = p + 1;
--- orig/rsync.h 2005-02-23 02:57:27
+++ rsync.h 2004-10-08 21:01:33
@@ -32,6 +32,7 @@
while (1) {
char fname2[MAXPATHLEN];
---- orig/options.c 2005-02-25 18:44:31
-+++ options.c 2005-02-22 18:06:58
-@@ -81,6 +81,7 @@ char *remote_filesfrom_file = NULL;
+--- orig/options.c 2005-03-01 01:22:59
++++ options.c 2005-03-01 01:37:22
+@@ -81,6 +81,7 @@ char *filesfrom_host = NULL;
int eol_nulls = 0;
int recurse = 0;
int xfer_dirs = 0;
if (read_batch && files_from) {
snprintf(err_buf, sizeof err_buf,
"--read-batch cannot be used with --files-from\n");
-@@ -1006,6 +1014,14 @@ int parse_arguments(int *argc, const cha
+@@ -1004,6 +1012,14 @@ int parse_arguments(int *argc, const cha
+ partial_dir = sanitize_path(NULL, partial_dir, NULL, 0);
+ if (backup_dir)
backup_dir = sanitize_path(NULL, backup_dir, NULL, 0);
- if (files_from)
- files_from = sanitize_path(NULL, files_from, NULL, 0);
+ if (source_cd)
+ source_cd = sanitize_path(NULL, source_cd, NULL, 0);
+ } else if (source_cd && am_daemon) {
}
if (server_filter_list.head && !am_sender) {
struct filter_list_struct *elp = &server_filter_list;
-@@ -1395,6 +1411,11 @@ void server_options(char **args,int *arg
+@@ -1397,6 +1413,11 @@ void server_options(char **args,int *arg
} else if (keep_partial)
args[ac++] = "--partial";
if (ignore_errors)
args[ac++] = "--ignore-errors";
---- orig/rsync.yo 2005-02-28 02:16:55
+--- orig/rsync.yo 2005-03-01 01:22:59
+++ rsync.yo 2005-02-22 18:20:24
@@ -304,6 +304,7 @@ to the detailed description below for a
-R, --relative use relative path names