if (verbose > 2)
rprintf(FINFO,"_exit_cleanup(code=%d, file=%s, line=%d): about to call exit(%d)\n",
---- clientserver.c 27 Mar 2004 09:44:01 -0000 1.118
-+++ clientserver.c 8 Apr 2004 05:56:31 -0000
-@@ -316,6 +316,9 @@
+--- clientserver.c 14 Apr 2004 23:33:34 -0000 1.121
++++ clientserver.c 15 Apr 2004 18:51:14 -0000
+@@ -311,6 +311,9 @@
exclude_path_prefix = NULL;
log_init();
if (use_chroot) {
/*
-@@ -434,6 +437,9 @@
+@@ -429,6 +432,9 @@
rprintf(FINFO,"rsync %s %s from %s@%s (%s)\n",
am_sender?"on":"to",
request, auth_user, host, addr);
} else {
rprintf(FINFO,"rsync %s %s from %s (%s)\n",
am_sender?"on":"to",
---- configure.in 24 Mar 2004 21:59:07 -0000 1.188
-+++ configure.in 8 Apr 2004 05:56:31 -0000
+--- configure.in 9 Apr 2004 18:09:16 -0000 1.190
++++ configure.in 15 Apr 2004 18:51:14 -0000
@@ -94,6 +94,8 @@
[ --with-rsync-path=PATH set default --rsync-path to PATH (default: rsync)],
[ RSYNC_PATH="$with_rsync_path" ],
AC_DEFINE_UNQUOTED(RSYNC_PATH, "$RSYNC_PATH", [location of rsync on remote machine])
-@@ -459,6 +461,14 @@
+@@ -458,6 +460,14 @@
if test x"$with_included_popt" != x"yes"
then
AC_CHECK_LIB(popt, poptGetContext, , [with_included_popt=yes])
if (f == -1 || !am_sender) return;
}
---- proto.h 27 Mar 2004 09:44:34 -0000 1.185
-+++ proto.h 8 Apr 2004 05:56:32 -0000
+--- proto.h 14 Apr 2004 23:33:30 -0000 1.188
++++ proto.h 15 Apr 2004 18:51:15 -0000
@@ -51,6 +51,12 @@
int daemon_main(void);
void setup_protocol(int f_out,int f_in);
int claim_connection(char *fname,int max_connections);
-+char *sanitizeSql(const char *input) ;
++char *sanitizeSql(const char *input);
+void db_log_open(void);
+void db_log_close();
+void db_log_session();
+void db_log_transfer(struct file_struct *file,struct stats *initial_stats,char *operation);
+void db_log_exit(int code, const char *file, int line);
- void free_exclude_list(struct exclude_struct ***listp);
- int check_exclude(struct exclude_struct **list, char *name, int name_is_dir);
- void add_exclude(struct exclude_struct ***listp, const char *pattern, int include);
-@@ -137,6 +143,17 @@
+ void free_exclude_list(struct exclude_list_struct *listp);
+ int check_exclude(struct exclude_list_struct *listp, char *name, int name_is_dir,
+ const char *type);
+@@ -136,6 +142,17 @@
BOOL lp_list(int );
BOOL lp_use_chroot(int );
BOOL lp_transfer_logging(int );
BOOL lp_ignore_errors(int );
BOOL lp_ignore_nonreadable(int );
char *lp_uid(int );
-@@ -158,6 +175,7 @@
+@@ -157,6 +174,7 @@
BOOL lp_load(char *pszFname, int globals_only);
int lp_numservices(void);
int lp_number(char *name);
+ }
+ return 0;
+}
---- flist.c 11 Feb 2004 02:48:58 -0000 1.205
-+++ flist.c 20 Mar 2004 18:26:01 -0000
+--- flist.c 14 Apr 2004 23:33:34 -0000 1.213
++++ flist.c 15 Apr 2004 19:00:26 -0000
@@ -33,6 +33,7 @@ extern int verbose;
extern int do_progress;
extern int am_root;
extern int am_server;
+extern int am_sender;
+ extern int am_daemon;
extern int always_checksum;
extern int module_id;
- extern int ignore_errors;
-@@ -63,6 +64,8 @@ extern int sanitize_paths;
+@@ -64,6 +65,8 @@ extern int sanitize_paths;
extern int read_batch;
extern int write_batch;
+extern struct chmod_mode_struct *chmod_modes;
+
- extern struct exclude_struct **exclude_list;
- extern struct exclude_struct **server_exclude_list;
- extern struct exclude_struct **local_exclude_list;
-@@ -831,7 +834,10 @@ skip_excludes:
+ extern struct exclude_list_struct exclude_list;
+ extern struct exclude_list_struct server_exclude_list;
+ extern struct exclude_list_struct local_exclude_list;
+@@ -863,7 +866,10 @@ skip_excludes:
file->flags = flags;
file->modtime = st.st_mtime;
file->length = st.st_size;
file->uid = st.st_uid;
file->gid = st.st_gid;
---- options.c 22 Feb 2004 08:56:43 -0000 1.139
-+++ options.c 20 Mar 2004 17:56:45 -0000
-@@ -119,6 +119,7 @@ char *log_format = NULL;
+--- options.c 14 Apr 2004 23:33:34 -0000 1.146
++++ options.c 15 Apr 2004 19:00:26 -0000
+@@ -121,6 +121,7 @@ char *log_format = NULL;
char *password_file = NULL;
char *rsync_path = RSYNC_PATH;
char *backup_dir = NULL;
char backup_dir_buf[MAXPATHLEN];
int rsync_port = RSYNC_PORT;
int link_dest = 0;
-@@ -132,6 +133,8 @@ int list_only = 0;
+@@ -134,6 +135,8 @@ int list_only = 0;
#define MAX_BATCH_PREFIX_LEN 256 /* Must be less than MAXPATHLEN-13 */
char *batch_prefix = NULL;
static int daemon_opt; /* sets am_daemon after option error-reporting */
static int modify_window_set;
-@@ -239,6 +242,7 @@ void usage(enum logcode F)
+@@ -241,6 +244,7 @@ void usage(enum logcode F)
rprintf(F," -g, --group preserve group\n");
rprintf(F," -D, --devices preserve devices (root only)\n");
rprintf(F," -t, --times preserve times\n");
rprintf(F," -S, --sparse handle sparse files efficiently\n");
rprintf(F," -n, --dry-run show what would have been transferred\n");
rprintf(F," -W, --whole-file copy whole files, no incremental checks\n");
-@@ -342,6 +346,7 @@ static struct poptOption long_options[]
+@@ -344,6 +348,7 @@ static struct poptOption long_options[]
{"perms", 'p', POPT_ARG_NONE, &preserve_perms, 0, 0, 0 },
{"owner", 'o', POPT_ARG_NONE, &preserve_uid, 0, 0, 0 },
{"group", 'g', POPT_ARG_NONE, &preserve_gid, 0, 0, 0 },
{"devices", 'D', POPT_ARG_NONE, &preserve_devices, 0, 0, 0 },
{"times", 't', POPT_ARG_NONE, &preserve_times, 0, 0, 0 },
{"checksum", 'c', POPT_ARG_NONE, &always_checksum, 0, 0, 0 },
-@@ -687,6 +692,13 @@ int parse_arguments(int *argc, const cha
+@@ -720,6 +725,13 @@ int parse_arguments(int *argc, const cha
exit_cleanup(RERR_SYNTAX);
}
if (do_progress && !verbose)
verbose = 1;
-@@ -932,6 +944,11 @@ void server_options(char **args,int *arg
+@@ -951,6 +963,11 @@ void server_options(char **args,int *arg
*/
args[ac++] = link_dest ? "--link-dest" : "--compare-dest";
args[ac++] = compare_dest;
}
if (files_from && (!am_sender || remote_filesfrom_file)) {
---- proto.h 17 Feb 2004 23:13:06 -0000 1.184
-+++ proto.h 20 Mar 2004 17:56:45 -0000
+--- proto.h 14 Apr 2004 23:33:30 -0000 1.188
++++ proto.h 15 Apr 2004 19:00:26 -0000
@@ -25,6 +25,9 @@ void file_checksum(char *fname,char *sum
void sum_init(void);
void sum_update(char *p, int len);
void close_all(void);
void _exit_cleanup(int code, const char *file, int line);
void cleanup_disable(void);
---- rsync.1 2 Feb 2004 18:23:09 -0000 1.163
-+++ rsync.1 20 Mar 2004 18:12:57 -0000
-@@ -336,6 +336,7 @@ to the detailed description below for a
- -g, --group preserve group
- -D, --devices preserve devices (root only)
- -t, --times preserve times
-+ --chmod=CHMOD change destination permissions
- -S, --sparse handle sparse files efficiently
- -n, --dry-run show what would have been transferred
- -W, --whole-file copy whole files, no incremental checks
-@@ -614,6 +615,17 @@ modified cannot be effective; in other w
- cause the next transfer to behave as if it used -I, and all files will have
- their checksums compared and show up in log messages even if they haven\&'t
- changed\&.
-+.IP
-+.IP "\fB--chmod\fP"
-+This options tells rsync to apply the listed "chmod" pattern
-+to the permission of the files on the destination\&. In addition to the normal
-+parsing rules specified in the chmod manpage, you can specify an item that
-+should only apply to a directory by prefixing it with a \&'D\&', or specify an
-+item that should only apply to a file by prefixing it with a \&'F\&'\&. For example:
-+.IP
-+.RS
-+--chmod=Dg+s,ug+w,Fo-w,+X
-+.RE
- .IP
- .IP "\fB-n, --dry-run\fP"
- This tells rsync to not do any file transfers,
---- rsync.yo 2 Feb 2004 18:23:09 -0000 1.147
-+++ rsync.yo 20 Mar 2004 18:12:58 -0000
+--- rsync.yo 15 Apr 2004 18:32:24 -0000 1.157
++++ rsync.yo 15 Apr 2004 19:00:27 -0000
@@ -299,6 +299,7 @@ verb(
-g, --group preserve group
-D, --devices preserve devices (root only)
-S, --sparse handle sparse files efficiently
-n, --dry-run show what would have been transferred
-W, --whole-file copy whole files, no incremental checks
-@@ -534,6 +535,14 @@ modified cannot be effective; in other w
+@@ -536,6 +537,14 @@ modified cannot be effective; in other w
cause the next transfer to behave as if it used -I, and all files will have
their checksums compared and show up in log messages even if they haven't
changed.
[Patched update to have context and apply to latest CVS source.]
---- generator.c 10 Feb 2004 22:56:16 -0000 1.75
-+++ generator.c 24 Feb 2004 19:17:31 -0000
-@@ -43,11 +43,14 @@
- extern int always_checksum;
- extern char *compare_dest;
- extern int link_dest;
+--- generator.c 15 Apr 2004 16:55:23 -0000 1.79
++++ generator.c 15 Apr 2004 19:06:13 -0000
+@@ -50,11 +50,14 @@ extern int list_only;
+ extern int only_existing;
+ extern int orig_umask;
+ extern int safe_symlinks;
+extern int date_only;
if (st->st_size != file->length) {
return 0;
}
---- options.c 22 Feb 2004 08:56:43 -0000 1.139
-+++ options.c 24 Feb 2004 19:17:31 -0000
-@@ -80,6 +80,7 @@
+--- options.c 14 Apr 2004 23:33:34 -0000 1.146
++++ options.c 15 Apr 2004 19:06:13 -0000
+@@ -82,6 +82,7 @@ int keep_partial = 0;
int safe_symlinks = 0;
int copy_unsafe_links = 0;
int size_only = 0;
int bwlimit = 0;
int delete_after = 0;
int only_existing = 0;
-@@ -260,6 +261,7 @@
+@@ -262,6 +263,7 @@ void usage(enum logcode F)
rprintf(F," --timeout=TIME set I/O timeout in seconds\n");
rprintf(F," -I, --ignore-times turn off mod time & file size quick check\n");
rprintf(F," --size-only ignore mod time for quick check (use size)\n");
rprintf(F," --modify-window=NUM compare mod times with reduced accuracy\n");
rprintf(F," -T --temp-dir=DIR create temporary files in directory DIR\n");
rprintf(F," --compare-dest=DIR also compare destination files relative to DIR\n");
-@@ -314,6 +316,7 @@
+@@ -316,6 +318,7 @@ static struct poptOption long_options[]
{"password-file", 0, POPT_ARG_STRING, &password_file, 0, 0, 0 },
{"ignore-times", 'I', POPT_ARG_NONE, &ignore_times, 0, 0, 0 },
{"size-only", 0, POPT_ARG_NONE, &size_only, 0, 0, 0 },
{"modify-window", 0, POPT_ARG_INT, &modify_window, OPT_MODIFY_WINDOW, 0, 0 },
{"one-file-system", 'x', POPT_ARG_NONE, &one_file_system, 0, 0, 0 },
{"delete", 0, POPT_ARG_NONE, &delete_mode, 0, 0, 0 },
-@@ -886,6 +889,9 @@
+@@ -905,6 +908,9 @@ void server_options(char **args,int *arg
if (size_only)
args[ac++] = "--size-only";
if (modify_window_set) {
if (asprintf(&arg, "--modify-window=%d", modify_window) < 0)
---- rsync.1 2 Feb 2004 18:23:09 -0000 1.163
-+++ rsync.1 24 Feb 2004 19:17:32 -0000
-@@ -357,6 +357,7 @@
- --timeout=TIME set I/O timeout in seconds
- -I, --ignore-times turn off mod time & file size quick check
- --size-only ignore mod time for quick check (use size)
-+ --date-only ignore size for quick check (use mod time)
- --modify-window=NUM compare mod times with reduced accuracy
- -T --temp-dir=DIR create temporary files in directory DIR
- --compare-dest=DIR also compare received files relative to DIR
-@@ -435,6 +436,13 @@
- regardless of timestamp\&. This is useful when starting to use rsync
- after using another mirroring system which may not preserve timestamps
- exactly\&.
-+.IP
-+.IP "\fB--date-only\fP"
-+Normally rsync will skip any files that are
-+already the same size and have the same modification time-stamp\&. With the
-+--date-only option, files will be skipped if they have the same
-+timestamp, regardless of size\&. This may be useful when the remote
-+files have passed through a size-changing filter, e\&.g\&. for encryption\&.
- .IP
- .IP "\fB--modify-window\fP"
- When comparing two timestamps rsync treats
---- rsync.yo 2 Feb 2004 18:23:09 -0000 1.147
-+++ rsync.yo 24 Feb 2004 19:17:33 -0000
+--- rsync.yo 15 Apr 2004 18:32:24 -0000 1.157
++++ rsync.yo 15 Apr 2004 19:06:15 -0000
@@ -320,6 +320,7 @@
--timeout=TIME set I/O timeout in seconds
-I, --ignore-times turn off mod time & file size quick check
---- rsync.c 13 Mar 2004 20:18:03 -0000 1.134
-+++ rsync.c 13 Mar 2004 20:19:40 -0000
+--- rsync.c 23 Mar 2004 16:16:15 -0000 1.135
++++ rsync.c 15 Apr 2004 19:14:12 -0000
@@ -235,6 +235,9 @@ void finish_transfer(char *fname, char *
if (make_backups && !make_backup(fname))
return;
}
}
---- t_stub.c 11 Sep 2003 04:48:13 -0000 1.4
-+++ t_stub.c 13 Mar 2004 20:19:40 -0000
+--- t_stub.c 14 Apr 2004 23:33:34 -0000 1.6
++++ t_stub.c 15 Apr 2004 19:14:12 -0000
@@ -26,6 +26,7 @@
* functions, so that module test harnesses can run standalone.
**/
+int am_root = 0;
int modify_window = 0;
int module_id = -1;
- struct exclude_struct **server_exclude_list;
---- util.c 17 Feb 2004 23:13:10 -0000 1.132
-+++ util.c 13 Mar 2004 20:19:40 -0000
+ struct exclude_list_struct server_exclude_list;
+--- util.c 14 Apr 2004 23:33:34 -0000 1.135
++++ util.c 15 Apr 2004 19:14:13 -0000
@@ -28,6 +28,7 @@
#include "rsync.h"
extern int verbose;
+extern int am_root;
+ extern struct exclude_list_struct server_exclude_list;
int sanitize_paths = 0;
-
-@@ -262,6 +263,8 @@ int copy_file(char *source, char *dest,
+@@ -263,6 +264,8 @@ int copy_file(char *source, char *dest,
return -1;
}
ofd = do_open(dest, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, mode);
if (ofd == -1) {
rprintf(FERROR,"open %s: %s\n",
-@@ -353,8 +356,8 @@ int robust_unlink(char *fname)
+@@ -354,8 +357,8 @@ int robust_unlink(char *fname)
#endif
}
int robust_rename(char *from, char *to, int mode)
{
int tries = 4;
-@@ -371,10 +374,12 @@ int robust_rename(char *from, char *to,
+@@ -372,10 +375,12 @@ int robust_rename(char *from, char *to,
break;
#endif
case EXDEV:
--- Makefile.in 10 Feb 2004 17:06:11 -0000 1.98
+++ Makefile.in 27 Feb 2004 08:57:09 -0000
-@@ -32,7 +32,7 @@
+@@ -32,7 +32,7 @@ ZLIBOBJ=zlib/deflate.o zlib/infblock.o z
zlib/inflate.o zlib/inftrees.o zlib/infutil.o zlib/trees.o \
zlib/zutil.o zlib/adler32.o
OBJS1=rsync.o generator.o receiver.o cleanup.o sender.o exclude.o util.o \
OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o \
fileio.o batch.o clientname.o
OBJS3=progress.o pipe.o
---- generator.c 27 Feb 2004 08:03:49 -0000 1.76
-+++ generator.c 27 Feb 2004 08:57:09 -0000
-@@ -43,10 +43,12 @@
- extern int always_checksum;
- extern char *compare_dest;
- extern int link_dest;
+--- generator.c 15 Apr 2004 16:55:23 -0000 1.79
++++ generator.c 15 Apr 2004 19:27:47 -0000
+@@ -50,6 +50,7 @@ extern int list_only;
+ extern int only_existing;
+ extern int orig_umask;
+ extern int safe_symlinks;
+extern int fuzzy;
/* choose whether to skip a particular file */
--static int skip_file(char *fname, struct file_struct *file, STRUCT_STAT *st)
-+static int skip_file(char *fname, struct file_struct *file,
-+ const STRUCT_STAT *st)
- {
- if (st->st_size != file->length) {
- return 0;
-@@ -252,7 +254,62 @@
+@@ -255,7 +256,62 @@ static void generate_and_send_sums(struc
}
}
/**
* Acts on file number @p i from @p flist, whose name is @p fname.
-@@ -268,9 +325,6 @@ void recv_generator(char *fname, struct
+@@ -271,8 +327,6 @@ void recv_generator(char *fname, struct
STRUCT_STAT st;
struct map_struct *mapbuf;
int statret;
- char *fnamecmp;
- char fnamecmpbuf[MAXPATHLEN];
-- extern char *compare_dest;
- extern int list_only;
- extern int only_existing;
- extern int orig_umask;
-@@ -397,108 +451,38 @@ void recv_generator(char *fname, struct
+
+ if (list_only)
+ return;
+@@ -396,108 +450,38 @@ void recv_generator(char *fname, struct
}
#endif
return;
}
-@@ -508,7 +492,7 @@ void recv_generator(char *fname, struct
+@@ -507,7 +491,7 @@ void recv_generator(char *fname, struct
mapbuf = NULL;
if (verbose > 3) {
(double)st.st_size);
}
---- options.c 22 Feb 2004 08:56:43 -0000 1.139
-+++ options.c 27 Feb 2004 08:57:10 -0000
-@@ -89,6 +89,7 @@
+--- options.c 14 Apr 2004 23:33:34 -0000 1.146
++++ options.c 15 Apr 2004 19:27:47 -0000
+@@ -91,6 +91,7 @@ int ignore_errors = 0;
int modify_window = 0;
int blocking_io = -1;
int checksum_seed = 0;
unsigned int block_size = 0;
-@@ -288,6 +289,7 @@ void usage(enum logcode F)
+@@ -290,6 +291,7 @@ void usage(enum logcode F)
rprintf(F," --bwlimit=KBPS limit I/O bandwidth, KBytes per second\n");
rprintf(F," --write-batch=PREFIX write batch fileset starting with PREFIX\n");
rprintf(F," --read-batch=PREFIX read batch fileset starting with PREFIX\n");
rprintf(F," -h, --help show this help screen\n");
#ifdef INET6
rprintf(F," -4 prefer IPv4\n");
-@@ -383,6 +385,7 @@ static struct poptOption long_options[]
+@@ -385,6 +387,7 @@ static struct poptOption long_options[]
{"files-from", 0, POPT_ARG_STRING, &files_from, 0, 0, 0 },
{"from0", '0', POPT_ARG_NONE, &eol_nulls, 0, 0, 0},
{"no-implied-dirs", 0, POPT_ARG_VAL, &implied_dirs, 0, 0, 0 },
{"protocol", 0, POPT_ARG_INT, &protocol_version, 0, 0, 0 },
#ifdef INET6
{0, '4', POPT_ARG_VAL, &default_af_hint, AF_INET, 0, 0 },
-@@ -945,6 +948,9 @@ void server_options(char **args,int *arg
+@@ -964,6 +967,9 @@ void server_options(char **args,int *arg
args[ac++] = "--from0";
}
}
*argc = ac;
return;
---- proto.h 17 Feb 2004 23:13:06 -0000 1.184
-+++ proto.h 27 Feb 2004 08:57:10 -0000
-@@ -1,6 +1,9 @@
- /* This file is automatically generated with "make proto". DO NOT EDIT */
-
- int allow_access(char *addr, char *host, char *allow_list, char *deny_list);
-+int do_open_regular(char *fname);
-+int open_alternate_base_fuzzy(const char *fname);
-+int open_alternate_base_comparedir(const char *fname);
- void base64_encode(char *buf, int len, char *out);
- char *auth_server(int f_in, int f_out, int module, char *addr, char *leader);
- void auth_client(int fd, char *user, char *challenge);
---- receiver.c 27 Feb 2004 08:03:49 -0000 1.73
-+++ receiver.c 27 Feb 2004 08:57:10 -0000
-@@ -39,6 +39,7 @@
- extern char *backup_suffix;
- extern int backup_suffix_len;
- extern int cleanup_got_literal;
+--- receiver.c 23 Mar 2004 16:50:40 -0000 1.75
++++ receiver.c 15 Apr 2004 19:25:05 -0000
+@@ -45,6 +45,7 @@ extern int cleanup_got_literal;
+ extern int module_id;
+ extern int ignore_errors;
+ extern int orig_umask;
+extern int fuzzy;
static void delete_one(char *fn, int is_dir)
{
-@@ -288,8 +289,6 @@ int recv_files(int f_in,struct file_list
+@@ -292,8 +293,6 @@ int recv_files(int f_in,struct file_list
char *fname, fbuf[MAXPATHLEN];
char template[MAXPATHLEN];
char fnametmp[MAXPATHLEN];
- - - - - - - - - - - - - - - - - - - - - - - - -
---- options.c 22 Feb 2004 08:56:43 -0000 1.139
-+++ options.c 23 Feb 2004 19:25:19 -0000
-@@ -87,6 +87,7 @@ int opt_ignore_existing = 0;
+--- options.c 14 Apr 2004 23:33:34 -0000 1.146
++++ options.c 15 Apr 2004 19:16:00 -0000
+@@ -89,6 +89,7 @@ int opt_ignore_existing = 0;
int max_delete = 0;
int ignore_errors = 0;
int modify_window = 0;
int blocking_io = -1;
int checksum_seed = 0;
unsigned int block_size = 0;
-@@ -273,6 +274,7 @@ void usage(enum logcode F)
+@@ -275,6 +276,7 @@ void usage(enum logcode F)
rprintf(F," --include-from=FILE don't exclude patterns listed in FILE\n");
rprintf(F," --files-from=FILE read FILE for list of source-file names\n");
rprintf(F," -0 --from0 all *-from file lists are delimited by nulls\n");
rprintf(F," --version print version number\n");
rprintf(F," --daemon run as an rsync daemon\n");
rprintf(F," --no-detach do not detach from the parent\n");
-@@ -327,6 +329,7 @@ static struct poptOption long_options[]
+@@ -329,6 +331,7 @@ static struct poptOption long_options[]
{"include", 0, POPT_ARG_STRING, 0, OPT_INCLUDE, 0, 0 },
{"exclude-from", 0, POPT_ARG_STRING, 0, OPT_EXCLUDE_FROM, 0, 0 },
{"include-from", 0, POPT_ARG_STRING, 0, OPT_INCLUDE_FROM, 0, 0 },
{"safe-links", 0, POPT_ARG_NONE, &safe_symlinks, 0, 0, 0 },
{"help", 'h', POPT_ARG_NONE, 0, 'h', 0, 0 },
{"backup", 'b', POPT_ARG_NONE, &make_backups, 0, 0, 0 },
-@@ -892,6 +895,9 @@ void server_options(char **args,int *arg
+@@ -911,6 +914,9 @@ void server_options(char **args,int *arg
goto oom;
args[ac++] = arg;
}
if (keep_partial)
args[ac++] = "--partial";
---- util.c 17 Feb 2004 23:13:10 -0000 1.132
-+++ util.c 23 Feb 2004 19:25:20 -0000
-@@ -890,6 +890,19 @@ int u_strcmp(const char *cs1, const char
+--- util.c 14 Apr 2004 23:33:34 -0000 1.135
++++ util.c 15 Apr 2004 19:16:00 -0000
+@@ -919,6 +919,19 @@ int u_strcmp(const char *cs1, const char
{
const uchar *s1 = (const uchar *)cs1;
const uchar *s2 = (const uchar *)cs2;
+}
+
+#endif
---- Makefile.in 2004-02-23 10:22:51.000000000 -0500
-+++ Makefile.in 2004-02-23 10:22:51.000000000 -0500
-@@ -35,7 +35,7 @@
+--- Makefile.in 10 Feb 2004 17:06:11 -0000 1.98
++++ Makefile.in 15 Apr 2004 19:18:59 -0000
+@@ -35,7 +35,7 @@ OBJS1=rsync.o generator.o receiver.o cle
main.o checksum.o match.o syscall.o log.o backup.o
OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o \
fileio.o batch.o clientname.o
DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
popt/popthelp.o popt/poptparse.o
---- options.c 2004-02-23 10:22:51.000000000 -0500
-+++ options.c 2004-02-23 10:29:14.000000000 -0500
-@@ -119,6 +119,7 @@
+--- options.c 14 Apr 2004 23:33:34 -0000 1.146
++++ options.c 15 Apr 2004 19:19:00 -0000
+@@ -121,6 +121,7 @@ char *log_format = NULL;
char *password_file = NULL;
char *rsync_path = RSYNC_PATH;
char *backup_dir = NULL;
char backup_dir_buf[MAXPATHLEN];
int rsync_port = RSYNC_PORT;
int link_dest = 0;
-@@ -264,6 +265,7 @@
+@@ -266,6 +267,7 @@ void usage(enum logcode F)
rprintf(F," -T --temp-dir=DIR create temporary files in directory DIR\n");
rprintf(F," --compare-dest=DIR also compare destination files relative to DIR\n");
rprintf(F," --link-dest=DIR create hardlinks to DIR for unchanged files\n");
rprintf(F," -P equivalent to --partial --progress\n");
rprintf(F," -z, --compress compress file data\n");
rprintf(F," -C, --cvs-exclude auto ignore files in the same way CVS does\n");
-@@ -303,7 +305,7 @@
+@@ -305,7 +307,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,
OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW,
OPT_REFUSED_BASE = 9000};
static struct poptOption long_options[] = {
-@@ -360,6 +362,7 @@
+@@ -362,6 +364,7 @@ static struct poptOption long_options[]
{"temp-dir", 'T', POPT_ARG_STRING, &tmpdir, 0, 0, 0 },
{"compare-dest", 0, POPT_ARG_STRING, &compare_dest, 0, 0, 0 },
- {"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 },
+ {"link-dest", 0, POPT_ARG_STRING, &compare_dest, OPT_LINK_DEST, 0, 0 },
+ {"link-by-hash", 0, POPT_ARG_STRING, 0, OPT_LINK_BY_HASH, 0, 0},
/* TODO: Should this take an optional int giving the compression level? */
{"compress", 'z', POPT_ARG_NONE, &do_compression, 0, 0, 0 },
{"daemon", 0, POPT_ARG_NONE, &daemon_opt, 0, 0, 0 },
-@@ -577,6 +580,19 @@
+@@ -584,6 +587,19 @@ int parse_arguments(int *argc, const cha
return 0;
#endif
default:
/* A large opt value means that set_refuse_options()
* turned this option off (opt-BASE is its index). */
-@@ -934,6 +950,11 @@
+@@ -951,6 +967,11 @@ void server_options(char **args,int *arg
+ */
+ args[ac++] = link_dest ? "--link-dest" : "--compare-dest";
args[ac++] = compare_dest;
- }
-
++ }
++
+ if (link_by_hash_dir && am_sender) {
+ args[ac++] = "--link-by-hash";
+ args[ac++] = link_by_hash_dir;
-+ }
-+
+ }
+
if (files_from && (!am_sender || remote_filesfrom_file)) {
- if (remote_filesfrom_file) {
- args[ac++] = "--files-from";
---- proto.h 2004-02-23 10:22:51.000000000 -0500
-+++ proto.h 2004-02-23 11:06:03.000000000 -0500
-@@ -93,6 +93,12 @@
+--- proto.h 14 Apr 2004 23:33:30 -0000 1.188
++++ proto.h 15 Apr 2004 19:19:00 -0000
+@@ -92,6 +92,12 @@ char *f_name(struct file_struct *f);
void write_sum_head(int f, struct sum_struct *sum);
void recv_generator(char *fname, struct file_struct *file, int i, int f_out);
void generate_files(int f, struct file_list *flist, char *local_name);
void init_hard_links(struct file_list *flist);
int hard_link_check(struct file_struct *file, int skip);
void do_hard_links(void);
---- receiver.c 2004-02-23 10:22:51.000000000 -0500
-+++ receiver.c 2004-02-23 10:22:51.000000000 -0500
-@@ -186,10 +186,11 @@
+--- receiver.c 23 Mar 2004 16:50:40 -0000 1.75
++++ receiver.c 15 Apr 2004 19:19:00 -0000
+@@ -45,6 +45,7 @@ extern int cleanup_got_literal;
+ extern int module_id;
+ extern int ignore_errors;
+ extern int orig_umask;
++extern char *link_by_hash_dir;
+
+ static void delete_one(char *fn, int is_dir)
+ {
+@@ -190,10 +191,11 @@ static int get_tmpname(char *fnametmp, c
static int receive_data(int f_in,struct map_struct *mapbuf,int fd,char *fname,
unsigned int len;
OFF_T offset = 0;
OFF_T offset2;
-@@ -199,7 +200,9 @@
+@@ -203,7 +205,9 @@ static int receive_data(int f_in,struct
char *map=NULL;
read_sum_head(f_in, &sum);
sum_init();
while ((i = recv_token(f_in, &data)) != 0) {
-@@ -216,6 +219,8 @@
+@@ -220,6 +224,8 @@ static int receive_data(int f_in,struct
cleanup_got_literal = 1;
sum_update(data,i);
if (fd != -1 && write_file(fd,data,i) != i) {
rprintf(FERROR, "write failed on %s: %s\n",
-@@ -243,6 +248,8 @@
+@@ -247,6 +253,8 @@ static int receive_data(int f_in,struct
see_token(map, len);
sum_update(map,len);
}
if (fd != -1 && write_file(fd,map,len) != (int) len) {
-@@ -265,6 +272,8 @@
+@@ -269,6 +277,8 @@ static int receive_data(int f_in,struct
}
sum_end(file_sum1);
read_buf(f_in,file_sum2,MD4_SUM_LENGTH);
if (verbose > 2) {
-@@ -299,6 +308,7 @@
- extern int preserve_perms;
- extern int delete_after;
- extern int orig_umask;
-+ extern char *link_by_hash_dir;
- struct stats initial_stats;
-
- if (verbose > 2) {
-@@ -372,7 +382,7 @@
+@@ -372,7 +382,7 @@ int recv_files(int f_in,struct file_list
if (fd1 != -1 && do_fstat(fd1,&st) != 0) {
rprintf(FERROR, "fstat %s failed: %s\n",
full_fname(fnamecmp), strerror(errno));
close(fd1);
continue;
}
-@@ -385,7 +395,7 @@
+@@ -385,7 +395,7 @@ int recv_files(int f_in,struct file_list
*/
rprintf(FERROR,"recv_files: %s is a directory\n",
full_fname(fnamecmp));
close(fd1);
continue;
}
-@@ -437,7 +447,7 @@
+@@ -437,7 +447,7 @@ int recv_files(int f_in,struct file_list
if (fd2 == -1) {
rprintf(FERROR, "mkstemp %s failed: %s\n",
full_fname(fnametmp), strerror(errno));
if (mapbuf) unmap_file(mapbuf);
if (fd1 != -1) close(fd1);
continue;
-@@ -450,7 +460,12 @@
+@@ -450,7 +460,12 @@ int recv_files(int f_in,struct file_list
}
/* recv file data */
log_recv(file, &initial_stats);
---- rsync.c 2004-02-23 10:22:51.000000000 -0500
-+++ rsync.c 2004-02-23 12:49:33.000000000 -0500
-@@ -33,6 +33,7 @@
+--- rsync.c 23 Mar 2004 16:16:15 -0000 1.135
++++ rsync.c 15 Apr 2004 19:19:00 -0000
+@@ -33,6 +33,7 @@ extern int preserve_uid;
extern int preserve_gid;
extern int preserve_perms;
extern int make_backups;
/*
-@@ -236,8 +237,13 @@
+@@ -235,8 +236,12 @@ void finish_transfer(char *fname, char *
if (make_backups && !make_backup(fname))
return;
+ else
+#endif
+ ret = robust_rename(fnametmp, fname, file->mode & INITACCESSPERMS);
-+
- if (ret != 0) {
+ if (ret < 0) {
rprintf(FERROR, "%s %s -> \"%s\": %s\n",
ret == -2 ? "copy" : "rename",
---- rsync.h 2004-02-23 10:22:51.000000000 -0500
-+++ rsync.h 2004-02-23 12:42:59.000000000 -0500
-@@ -513,6 +513,14 @@
+--- rsync.h 14 Apr 2004 23:33:37 -0000 1.196
++++ rsync.h 15 Apr 2004 19:19:00 -0000
+@@ -519,6 +519,14 @@ struct stats {
int current_file_index;
};
if (argc == 0) {
list_only = 1;
---- options.c 22 Feb 2004 08:56:43 -0000 1.139
-+++ options.c 23 Feb 2004 18:16:25 -0000
-@@ -82,6 +82,7 @@ int copy_unsafe_links = 0;
+--- options.c 14 Apr 2004 23:33:34 -0000 1.146
++++ options.c 15 Apr 2004 19:11:00 -0000
+@@ -84,6 +84,7 @@ int copy_unsafe_links = 0;
int size_only = 0;
int bwlimit = 0;
int delete_after = 0;
int only_existing = 0;
int opt_ignore_existing = 0;
int max_delete = 0;
-@@ -89,6 +90,7 @@ int ignore_errors = 0;
+@@ -91,6 +92,7 @@ int ignore_errors = 0;
int modify_window = 0;
int blocking_io = -1;
int checksum_seed = 0;
unsigned int block_size = 0;
-@@ -252,6 +254,7 @@ void usage(enum logcode F)
+@@ -254,6 +256,7 @@ void usage(enum logcode F)
rprintf(F," --delete delete files that don't exist on the sending side\n");
rprintf(F," --delete-excluded also delete excluded files on the receiving side\n");
rprintf(F," --delete-after receiver deletes after transferring, not before\n");
rprintf(F," --ignore-errors delete even if there are I/O errors\n");
rprintf(F," --max-delete=NUM don't delete more than NUM files\n");
rprintf(F," --partial keep partially transferred files\n");
-@@ -301,8 +304,8 @@ void usage(enum logcode F)
+@@ -303,8 +306,8 @@ void usage(enum logcode F)
}
enum {OPT_VERSION = 1000, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
OPT_READ_BATCH, OPT_WRITE_BATCH,
OPT_REFUSED_BASE = 9000};
-@@ -321,6 +324,7 @@ static struct poptOption long_options[]
+@@ -323,6 +326,7 @@ static struct poptOption long_options[]
{"ignore-existing", 0, POPT_ARG_NONE, &opt_ignore_existing, 0, 0, 0 },
{"delete-after", 0, POPT_ARG_NONE, 0, OPT_DELETE_AFTER, 0, 0 },
{"delete-excluded", 0, POPT_ARG_NONE, 0, OPT_DELETE_EXCLUDED, 0, 0 },
{"force", 0, POPT_ARG_NONE, &force_delete, 0, 0, 0 },
{"numeric-ids", 0, POPT_ARG_NONE, &numeric_ids, 0, 0, 0 },
{"exclude", 0, POPT_ARG_STRING, 0, OPT_EXCLUDE, 0, 0 },
-@@ -506,6 +510,11 @@ int parse_arguments(int *argc, const cha
+@@ -509,6 +513,11 @@ int parse_arguments(int *argc, const cha
delete_mode = 1;
break;
+ break;
+
case OPT_EXCLUDE:
- add_exclude(&exclude_list, poptGetOptArg(pc),
- ADD_EXCLUDE);
-@@ -945,6 +954,9 @@ void server_options(char **args,int *arg
+ add_exclude(&exclude_list, poptGetOptArg(pc), 0);
+ break;
+@@ -964,6 +973,9 @@ void server_options(char **args,int *arg
args[ac++] = "--from0";
}
}
*argc = ac;
return;
---- proto.h 17 Feb 2004 23:13:06 -0000 1.184
-+++ proto.h 23 Feb 2004 18:16:25 -0000
-@@ -199,6 +199,7 @@ void sig_int(void);
+--- proto.h 14 Apr 2004 23:33:30 -0000 1.188
++++ proto.h 15 Apr 2004 19:11:00 -0000
+@@ -198,6 +198,7 @@ void sig_int(void);
void finish_transfer(char *fname, char *fnametmp, struct file_struct *file);
const char *who_am_i(void);
void read_sum_head(int f, struct sum_struct *sum);
void send_files(struct file_list *flist, int f_out, int f_in);
int try_bind_local(int s, int ai_family, int ai_socktype,
const char *bind_address);
---- receiver.c 10 Feb 2004 17:28:59 -0000 1.72
-+++ receiver.c 23 Feb 2004 18:16:26 -0000
-@@ -39,6 +39,7 @@ extern char *backup_dir;
- extern char *backup_suffix;
- extern int backup_suffix_len;
- extern int cleanup_got_literal;
+--- receiver.c 23 Mar 2004 16:50:40 -0000 1.75
++++ receiver.c 15 Apr 2004 19:11:01 -0000
+@@ -45,6 +45,7 @@ extern int cleanup_got_literal;
+ extern int module_id;
+ extern int ignore_errors;
+ extern int orig_umask;
+extern int delete_sent_files;
static void delete_one(char *fn, int is_dir)
{
-@@ -288,7 +289,7 @@ int recv_files(int f_in,struct file_list
+@@ -292,7 +293,7 @@ int recv_files(int f_in,struct file_list
char *fname, fbuf[MAXPATHLEN];
char template[MAXPATHLEN];
char fnametmp[MAXPATHLEN];
}
}
}
---- rsync.1 2 Feb 2004 18:23:09 -0000 1.163
-+++ rsync.1 23 Feb 2004 18:16:26 -0000
-@@ -349,6 +349,7 @@ to the detailed description below for a
- --delete delete files that don\&'t exist on sender
- --delete-excluded also delete excluded files on receiver
- --delete-after receiver deletes after transfer, not before
-+ --delete-sent-files updated/sent files are removed from sender
- --ignore-errors delete even if there are I/O errors
- --max-delete=NUM don\&'t delete more than NUM files
- --partial keep partially transferred files
-@@ -673,6 +674,12 @@ By default rsync does file deletions on
- receiving side before transferring files to try to ensure that there is
- sufficient space on the receiving filesystem\&. If you want to delete
- after transferring, use the --delete-after switch\&. Implies --delete\&.
-+.IP
-+.IP "\fB--delete-sent-files\fP"
-+This tells rsync to remove the source files
-+on the sending side that are successfully transferred to the receiving
-+side\&. Directories are not removed, nor are files that are identical on
-+both systems\&.
- .IP
- .IP "\fB--ignore-errors\fP"
- Tells --delete to go ahead and delete files
---- rsync.h 11 Feb 2004 08:01:21 -0000 1.186
-+++ rsync.h 23 Feb 2004 18:16:26 -0000
-@@ -59,6 +59,7 @@
+--- rsync.h 14 Apr 2004 23:33:37 -0000 1.196
++++ rsync.h 15 Apr 2004 19:11:02 -0000
+@@ -60,6 +60,7 @@
#define FLAG_TOP_DIR (1<<0)
#define FLAG_HLINK_EOL (1<<1) /* generator only */
#define FLAG_MOUNT_POINT (1<<2) /* sender only */
};
#include "errcode.h"
---- rsync.yo 2 Feb 2004 18:23:09 -0000 1.147
-+++ rsync.yo 23 Feb 2004 18:16:27 -0000
-@@ -312,6 +312,7 @@ verb(
+--- rsync.yo 15 Apr 2004 18:32:24 -0000 1.157
++++ rsync.yo 15 Apr 2004 19:11:02 -0000
+@@ -312,6 +312,7 @@
--delete delete files that don't exist on sender
--delete-excluded also delete excluded files on receiver
--delete-after receiver deletes after transfer, not before
--ignore-errors delete even if there are I/O errors
--max-delete=NUM don't delete more than NUM files
--partial keep partially transferred files
-@@ -585,6 +586,11 @@ dit(bf(--delete-after)) By default rsync
+@@ -587,6 +588,11 @@
receiving side before transferring files to try to ensure that there is
sufficient space on the receiving filesystem. If you want to delete
after transferring, use the --delete-after switch. Implies --delete.
if (!relative_paths && !push_dir(dir)) {
rprintf(FERROR, "push_dir %s failed: %s (3)\n",
full_fname(dir), strerror(errno));
---- proto.h 17 Feb 2004 23:13:06 -0000 1.184
-+++ proto.h 27 Feb 2004 18:53:40 -0000
-@@ -134,6 +134,7 @@ char *lp_comment(int );
+--- proto.h 14 Apr 2004 23:33:30 -0000 1.188
++++ proto.h 15 Apr 2004 19:29:43 -0000
+@@ -133,6 +133,7 @@ char *lp_comment(int );
char *lp_path(int );
char *lp_lock_file(int );
BOOL lp_read_only(int );