From: Wayne Davison Date: Sat, 14 Jan 2006 08:36:07 +0000 (+0000) Subject: Fixed failing hunks. X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/commitdiff_plain/93ca4d27d3d0806c3085aef4dbb331ba451b3dc4?hp=66e2df0e031d076e65863d4c2ffe132850aa2ff3 Fixed failing hunks. --- diff --git a/ODBC-dblog.diff b/ODBC-dblog.diff index 022e234..7ba9fcc 100644 --- a/ODBC-dblog.diff +++ b/ODBC-dblog.diff @@ -10,7 +10,7 @@ After applying this patch, run these commands for a successful build: See the file "instructions" (after applying this patch) for more info. ---- orig/Makefile.in 2005-11-07 04:29:00 +--- orig/Makefile.in 2006-01-14 08:14:29 +++ Makefile.in 2005-09-23 15:59:02 @@ -31,7 +31,7 @@ LIBOBJ=lib/wildmatch.o lib/compat.o lib/ ZLIBOBJ=zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o \ @@ -21,7 +21,7 @@ See the file "instructions" (after applying this patch) for more info. OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o \ fileio.o batch.o clientname.o chmod.o OBJS3=progress.o pipe.o ---- orig/cleanup.c 2005-11-10 16:58:36 +--- orig/cleanup.c 2006-01-14 08:14:29 +++ cleanup.c 2005-09-23 15:59:19 @@ -23,6 +23,7 @@ @@ -46,9 +46,9 @@ See the file "instructions" (after applying this patch) for more info. if (verbose > 2) { rprintf(FINFO,"_exit_cleanup(code=%d, file=%s, line=%d): about to call exit(%d)\n", ---- orig/clientserver.c 2005-10-24 21:04:44 +--- orig/clientserver.c 2006-01-14 08:14:29 +++ clientserver.c 2005-09-23 15:59:36 -@@ -369,6 +369,9 @@ static int rsync_module(int f_in, int f_ +@@ -387,6 +387,9 @@ static int rsync_module(int f_in, int f_ XFLG_ABS_IF_SLASH | XFLG_OLD_PREFIXES); log_init(); @@ -58,7 +58,7 @@ See the file "instructions" (after applying this patch) for more info. #ifdef HAVE_PUTENV if (*lp_prexfer_exec(i) || *lp_postxfer_exec(i)) { -@@ -592,6 +595,9 @@ static int rsync_module(int f_in, int f_ +@@ -624,6 +627,9 @@ static int rsync_module(int f_in, int f_ rprintf(FLOG, "rsync %s %s from %s@%s (%s)\n", am_sender ? "on" : "to", request, auth_user, host, addr); @@ -68,9 +68,9 @@ See the file "instructions" (after applying this patch) for more info. } else { rprintf(FLOG, "rsync %s %s from %s (%s)\n", am_sender ? "on" : "to", ---- orig/configure.in 2005-09-24 17:40:30 +--- orig/configure.in 2006-01-14 08:14:30 +++ configure.in 2005-09-24 18:38:47 -@@ -547,6 +547,12 @@ then +@@ -546,6 +546,12 @@ if test x"$with_included_popt" != x"yes" AC_CHECK_LIB(popt, poptGetContext, , [with_included_popt=yes]) fi @@ -81,8 +81,8 @@ See the file "instructions" (after applying this patch) for more info. + AC_SUBST(EXTRA_OBJECT) ]) + AC_MSG_CHECKING([whether to use included libpopt]) - if test x"$with_included_popt" = x"yes" - then + if test x"$with_included_popt" = x"yes"; then + AC_MSG_RESULT($srcdir/popt) --- orig/db_log_error-list.txt 2005-09-23 15:58:32 +++ db_log_error-list.txt 2005-09-23 15:58:32 @@ -0,0 +1,35 @@ @@ -652,7 +652,7 @@ See the file "instructions" (after applying this patch) for more info. + return; + + if (db_handle != NULL) { -+ strFileNamePtr = safe_fname(f_name(file)); ++ strFileNamePtr = f_name(file); + if (am_sender && file->dir.root) { + pathjoin(strFileName, sizeof strFileName, + file->dir.root, strFileNamePtr); @@ -1046,9 +1046,9 @@ See the file "instructions" (after applying this patch) for more info. FN_LOCAL_BOOL(lp_ignore_errors, ignore_errors) FN_LOCAL_BOOL(lp_ignore_nonreadable, ignore_nonreadable) FN_LOCAL_BOOL(lp_list, list) ---- orig/log.c 2005-10-26 16:49:08 +--- orig/log.c 2006-01-14 08:14:30 +++ log.c 2005-09-23 16:01:13 -@@ -86,7 +86,7 @@ struct { +@@ -88,7 +88,7 @@ struct { /* * Map from rsync error code to name, or return NULL. */ @@ -1057,7 +1057,7 @@ See the file "instructions" (after applying this patch) for more info. { int i; for (i = 0; rerr_names[i].name; i++) { ---- orig/main.c 2005-11-12 20:13:05 +--- orig/main.c 2006-01-14 08:14:30 +++ main.c 2005-09-23 16:01:22 @@ -159,6 +159,9 @@ static void handle_stats(int f) @@ -1069,20 +1069,20 @@ See the file "instructions" (after applying this patch) for more info. if (f == -1 || !am_sender) return; } ---- orig/receiver.c 2005-11-10 16:58:36 -+++ receiver.c 2005-09-24 17:57:43 -@@ -175,6 +175,10 @@ static int get_tmpname(char *fnametmp, c +--- orig/receiver.c 2006-01-14 08:14:31 ++++ receiver.c 2006-01-14 08:27:51 +@@ -174,6 +174,10 @@ static int get_tmpname(char *fnametmp, c + if (maxname < 1) { - rprintf(FERROR, "temporary filename too long: %s\n", - safe_fname(fname)); + rprintf(FERROR, "temporary filename too long: %s\n", fname); +#ifdef HAVE_LIBODBC + db_log_error(FERROR,13, "temporary filename too long: %s\n", -+ safe_fname(fname)); ++ fname); +#endif fnametmp[0] = '\0'; return 0; } -@@ -291,6 +295,11 @@ static int receive_data(int f_in, char * +@@ -290,6 +294,11 @@ static int receive_data(int f_in, char * rsyserr(FERROR, errno, "lseek failed on %s", full_fname(fname)); @@ -1094,7 +1094,7 @@ See the file "instructions" (after applying this patch) for more info. exit_cleanup(RERR_FILEIO); } continue; -@@ -316,6 +325,9 @@ static int receive_data(int f_in, char * +@@ -315,6 +324,9 @@ static int receive_data(int f_in, char * report_write_error: rsyserr(FERROR, errno, "write failed on %s", full_fname(fname)); @@ -1104,20 +1104,20 @@ See the file "instructions" (after applying this patch) for more info. exit_cleanup(RERR_FILEIO); } -@@ -361,6 +373,12 @@ static void handle_delayed_updates(struc +@@ -358,6 +370,12 @@ static void handle_delayed_updates(struc + rsyserr(FERROR, errno, "rename failed for %s (from %s)", - full_fname(fname), - safe_fname(partialptr)); + full_fname(fname), partialptr); +#ifdef HAVE_LIBODBC + db_log_error(FERROR, 16, + "rename failed for %s (from %s)", + full_fname(fname), -+ safe_fname(partialptr)); ++ partialptr); +#endif } else { if (remove_sent_files || (preserve_hard_links -@@ -484,6 +502,9 @@ int recv_files(int f_in, struct file_lis +@@ -480,6 +498,9 @@ int recv_files(int f_in, struct file_lis if (server_filter_list.head && check_filter(&server_filter_list, fname, 0) < 0) { rprintf(FERROR, "attempt to hack rsync failed.\n"); @@ -1127,7 +1127,7 @@ See the file "instructions" (after applying this patch) for more info. exit_cleanup(RERR_PROTOCOL); } -@@ -538,6 +559,11 @@ int recv_files(int f_in, struct file_lis +@@ -535,6 +556,11 @@ int recv_files(int f_in, struct file_lis rprintf(FERROR, "invalid basis_dir index: %d.\n", fnamecmp_type); @@ -1139,7 +1139,7 @@ See the file "instructions" (after applying this patch) for more info. exit_cleanup(RERR_PROTOCOL); } pathjoin(fnamecmpbuf, sizeof fnamecmpbuf, -@@ -583,6 +609,9 @@ int recv_files(int f_in, struct file_lis +@@ -580,6 +606,9 @@ int recv_files(int f_in, struct file_lis if (fd1 != -1 && do_fstat(fd1,&st) != 0) { rsyserr(FERROR, errno, "fstat %s failed", full_fname(fnamecmp)); @@ -1149,7 +1149,7 @@ See the file "instructions" (after applying this patch) for more info. discard_receive_data(f_in, file->length); close(fd1); continue; -@@ -596,6 +625,9 @@ int recv_files(int f_in, struct file_lis +@@ -593,6 +622,9 @@ int recv_files(int f_in, struct file_lis */ rprintf(FERROR,"recv_files: %s is a directory\n", full_fname(fnamecmp)); @@ -1159,7 +1159,7 @@ See the file "instructions" (after applying this patch) for more info. discard_receive_data(f_in, file->length); close(fd1); continue; -@@ -619,6 +651,9 @@ int recv_files(int f_in, struct file_lis +@@ -616,6 +648,9 @@ int recv_files(int f_in, struct file_lis if (fd2 == -1) { rsyserr(FERROR, errno, "open %s failed", full_fname(fname)); @@ -1169,7 +1169,7 @@ See the file "instructions" (after applying this patch) for more info. discard_receive_data(f_in, file->length); if (fd1 != -1) close(fd1); -@@ -652,6 +687,10 @@ int recv_files(int f_in, struct file_lis +@@ -649,6 +684,10 @@ int recv_files(int f_in, struct file_lis if (fd2 == -1) { rsyserr(FERROR, errno, "mkstemp %s failed", full_fname(fnametmp)); @@ -1180,7 +1180,7 @@ See the file "instructions" (after applying this patch) for more info. discard_receive_data(f_in, file->length); if (fd1 != -1) close(fd1); -@@ -674,12 +713,19 @@ int recv_files(int f_in, struct file_lis +@@ -671,12 +710,19 @@ int recv_files(int f_in, struct file_lis if (!log_before_transfer) log_item(file, &initial_stats, iflags, NULL); @@ -1200,22 +1200,22 @@ See the file "instructions" (after applying this patch) for more info. exit_cleanup(RERR_FILEIO); } -@@ -731,6 +777,12 @@ int recv_files(int f_in, struct file_lis +@@ -727,6 +773,12 @@ int recv_files(int f_in, struct file_lis + rprintf(msgtype, "%s: %s failed verification -- update %s%s.\n", - errstr, safe_fname(fname), - keptstr, redostr); + errstr, fname, keptstr, redostr); +#ifdef HAVE_LIBODBC + db_log_error(msgtype,24, + "%s: %s failed verification -- update %s%s.\n", -+ errstr, safe_fname(fname), ++ errstr, fname, + keptstr, redostr); +#endif } if (!phase) { SIVAL(numbuf, 0, i); ---- orig/sender.c 2005-07-28 01:46:25 +--- orig/sender.c 2006-01-14 08:14:31 +++ sender.c 2005-09-23 16:01:44 -@@ -356,6 +356,9 @@ void send_files(struct file_list *flist, +@@ -352,6 +352,9 @@ void send_files(struct file_list *flist, if (!log_before_transfer) log_item(file, &initial_stats, iflags, NULL); diff --git a/acls.diff b/acls.diff index 0a27c1a..5345511 100644 --- a/acls.diff +++ b/acls.diff @@ -11,7 +11,7 @@ from a disk that doesn't support ACLs. This should be changed to silently notice that no ACLs are available to copy. Of course, trying to write out ACLs to a non-ACL-supporting disk should complain. ---- orig/Makefile.in 2005-11-07 04:29:00 +--- orig/Makefile.in 2006-01-14 08:14:29 +++ Makefile.in 2005-11-07 04:31:05 @@ -25,15 +25,15 @@ VERSION=@VERSION@ .SUFFIXES: @@ -1165,9 +1165,9 @@ ACLs to a non-ACL-supporting disk should complain. +} + +#endif /* SUPPORT_ACLS */ ---- orig/backup.c 2005-11-10 16:58:36 +--- orig/backup.c 2006-01-14 08:14:29 +++ backup.c 2004-10-06 00:13:09 -@@ -135,6 +135,7 @@ static int make_bak_dir(char *fullpath) +@@ -134,6 +134,7 @@ static int make_bak_dir(char *fullpath) } else { do_lchown(fullpath, st.st_uid, st.st_gid); do_chmod(fullpath, st.st_mode); @@ -1175,7 +1175,7 @@ ACLs to a non-ACL-supporting disk should complain. } } *p = '/'; -@@ -187,6 +188,8 @@ static int keep_backup(char *fname) +@@ -186,6 +187,8 @@ static int keep_backup(char *fname) if (!(buf = get_backup_name(fname))) return 0; @@ -1184,7 +1184,7 @@ ACLs to a non-ACL-supporting disk should complain. /* Check to see if this is a device file, or link */ if (IS_DEVICE(file->mode) && am_root && preserve_devices) { do_unlink(buf); -@@ -261,6 +264,7 @@ static int keep_backup(char *fname) +@@ -260,6 +263,7 @@ static int keep_backup(char *fname) } } set_perms(buf, file, NULL, 0); @@ -1192,9 +1192,9 @@ ACLs to a non-ACL-supporting disk should complain. free(file); if (verbose > 1) { ---- orig/configure.in 2005-09-24 17:40:30 +--- orig/configure.in 2006-01-14 08:14:30 +++ configure.in 2004-08-19 19:53:27 -@@ -489,6 +489,11 @@ if test x"$ac_cv_func_strcasecmp" = x"no +@@ -478,6 +478,11 @@ if test x"$ac_cv_func_strcasecmp" = x"no AC_CHECK_LIB(resolv, strcasecmp) fi @@ -1206,7 +1206,7 @@ ACLs to a non-ACL-supporting disk should complain. dnl At the moment we don't test for a broken memcmp(), because all we dnl need to do is test for equality, not comparison, and it seems that dnl every platform has a memcmp that can do at least that. -@@ -746,6 +751,77 @@ AC_SUBST(OBJ_RESTORE) +@@ -744,6 +749,77 @@ AC_SUBST(OBJ_RESTORE) AC_SUBST(CC_SHOBJ_FLAG) AC_SUBST(BUILD_POPT) @@ -1284,9 +1284,9 @@ ACLs to a non-ACL-supporting disk should complain. AC_CONFIG_FILES([Makefile lib/dummy zlib/dummy popt/dummy shconfig]) AC_OUTPUT ---- orig/flist.c 2005-11-10 16:58:36 +--- orig/flist.c 2006-01-14 08:14:30 +++ flist.c 2005-07-29 02:49:06 -@@ -961,6 +961,8 @@ static struct file_struct *send_file_nam +@@ -960,6 +960,8 @@ static struct file_struct *send_file_nam file = make_file(fname, flist, f == -2 ? SERVER_FILTERS : ALL_FILTERS); if (!file) return NULL; @@ -1295,7 +1295,7 @@ ACLs to a non-ACL-supporting disk should complain. maybe_emit_filelist_progress(flist->count + flist_count_offset); -@@ -969,6 +971,10 @@ static struct file_struct *send_file_nam +@@ -968,6 +970,10 @@ static struct file_struct *send_file_nam if (file->basename[0]) { flist->files[flist->count++] = file; send_file_entry(file, f, base_flags); @@ -1306,7 +1306,7 @@ ACLs to a non-ACL-supporting disk should complain. } return file; } -@@ -1323,6 +1329,8 @@ struct file_list *recv_file_list(int f) +@@ -1322,6 +1328,8 @@ struct file_list *recv_file_list(int f) flags |= read_byte(f) << 8; file = receive_file_entry(flist, flags, f); @@ -1315,7 +1315,7 @@ ACLs to a non-ACL-supporting disk should complain. if (S_ISREG(file->mode)) stats.total_size += file->length; -@@ -1345,6 +1353,8 @@ struct file_list *recv_file_list(int f) +@@ -1342,6 +1350,8 @@ struct file_list *recv_file_list(int f) clean_flist(flist, relative_paths, 1); @@ -1324,12 +1324,12 @@ ACLs to a non-ACL-supporting disk should complain. if (f >= 0) { /* Now send the uid/gid list. This was introduced in * protocol version 15 */ ---- orig/generator.c 2005-11-12 20:31:04 -+++ generator.c 2005-05-12 23:34:00 -@@ -744,6 +744,10 @@ static void recv_generator(char *fname, +--- orig/generator.c 2006-01-14 08:14:30 ++++ generator.c 2006-01-14 08:17:25 +@@ -890,6 +890,10 @@ static void recv_generator(char *fname, if (set_perms(fname, file, statret ? NULL : &st, 0) && verbose && code && f_out != -1) - rprintf(code, "%s/\n", safe_fname(fname)); + rprintf(code, "%s/\n", fname); +#ifdef SUPPORT_ACLS + if (f_out == -1) + SET_ACL(fname, file); @@ -4624,7 +4624,7 @@ ACLs to a non-ACL-supporting disk should complain. next; } ---- orig/options.c 2005-11-15 07:01:03 +--- orig/options.c 2006-01-14 08:14:30 +++ options.c 2005-08-27 21:15:29 @@ -44,6 +44,7 @@ int keep_dirlinks = 0; int copy_links = 0; @@ -4683,7 +4683,7 @@ ACLs to a non-ACL-supporting disk should complain. {"times", 't', POPT_ARG_VAL, &preserve_times, 1, 0, 0 }, {"no-times", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 }, {"no-t", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 }, -@@ -997,6 +1007,24 @@ int parse_arguments(int *argc, const cha +@@ -1000,6 +1010,24 @@ int parse_arguments(int *argc, const cha basis_dir[basis_dir_cnt++] = (char *)arg; break; @@ -4708,7 +4708,7 @@ ACLs to a non-ACL-supporting disk should complain. default: /* A large opt value means that set_refuse_options() * turned this option off. */ -@@ -1429,6 +1457,8 @@ void server_options(char **args,int *arg +@@ -1434,6 +1462,8 @@ void server_options(char **args,int *arg if (preserve_hard_links) argstr[x++] = 'H'; @@ -4717,7 +4717,7 @@ ACLs to a non-ACL-supporting disk should complain. if (preserve_uid) argstr[x++] = 'o'; if (preserve_gid) ---- orig/rsync.c 2005-07-27 23:31:12 +--- orig/rsync.c 2006-01-14 08:14:31 +++ rsync.c 2004-07-03 20:11:58 @@ -139,6 +139,14 @@ int set_perms(char *fname,struct file_st } @@ -4734,7 +4734,7 @@ ACLs to a non-ACL-supporting disk should complain. if (verbose > 1 && flags & PERMS_REPORT) { enum logcode code = daemon_log_format_has_i || dry_run ? FCLIENT : FINFO; ---- orig/rsync.h 2005-11-12 20:31:04 +--- orig/rsync.h 2006-01-14 08:14:31 +++ rsync.h 2005-07-29 02:25:55 @@ -646,6 +646,44 @@ struct stats { #include "lib/permstring.h" @@ -4781,7 +4781,7 @@ ACLs to a non-ACL-supporting disk should complain. #include "proto.h" /* We have replacement versions of these if they're missing. */ ---- orig/rsync.yo 2005-11-15 07:01:04 +--- orig/rsync.yo 2006-01-14 08:14:31 +++ rsync.yo 2004-07-03 20:11:58 @@ -316,6 +316,7 @@ to the detailed description below for a -H, --hard-links preserve hard links @@ -4791,7 +4791,7 @@ ACLs to a non-ACL-supporting disk should complain. -o, --owner preserve owner (root only) -g, --group preserve group -D, --devices preserve devices (root only) -@@ -672,6 +673,11 @@ based on the source file's permissions, +@@ -681,6 +682,11 @@ based on the source file's permissions, umask setting (which is the same behavior as other file-copy utilities, such as cp). diff --git a/atimes.diff b/atimes.diff index fd7ab01..7ca9204 100644 --- a/atimes.diff +++ b/atimes.diff @@ -4,7 +4,7 @@ command before "make": make proto ---- orig/batch.c 2005-10-26 16:49:08 +--- orig/batch.c 2006-01-14 08:14:29 +++ batch.c 2004-07-03 20:15:41 @@ -225,6 +225,8 @@ void show_flist(int index, struct file_s rprintf(FINFO, "flist->flags=%#x\n", fptr[i]->flags); @@ -15,8 +15,8 @@ command before "make": rprintf(FINFO, "flist->length=%.0f\n", (double) fptr[i]->length); rprintf(FINFO, "flist->mode=%#o\n", (int) fptr[i]->mode); ---- orig/flist.c 2005-11-10 16:58:36 -+++ flist.c 2005-07-28 00:16:34 +--- orig/flist.c 2006-01-14 08:14:30 ++++ flist.c 2006-01-14 08:19:03 @@ -50,6 +50,7 @@ extern int preserve_perms; extern int preserve_devices; extern int preserve_uid; @@ -34,7 +34,7 @@ command before "make": perms, (double)f->length, timestring(f->modtime), + timestring(f->atime), - safe_fname(f_name(f)), safe_fname(f->u.link)); + f_name(f), f->u.link); } else #endif { @@ -43,7 +43,7 @@ command before "make": perms, (double)f->length, timestring(f->modtime), + timestring(f->atime), - safe_fname(f_name(f))); + f_name(f)); } } @@ -311,6 +314,7 @@ void send_file_entry(struct file_struct @@ -119,7 +119,7 @@ command before "make": file->length = file_length; file->mode = mode; file->uid = uid; -@@ -867,6 +883,7 @@ struct file_struct *make_file(char *fnam +@@ -866,6 +882,7 @@ struct file_struct *make_file(char *fnam file->flags = flags; file->modtime = st.st_mtime; @@ -127,7 +127,7 @@ command before "make": file->length = st.st_size; if (chmod_modes && am_sender && (S_ISREG(st.st_mode) || S_ISDIR(st.st_mode))) file->mode = tweak_mode(st.st_mode, chmod_modes); ---- orig/generator.c 2005-12-15 23:00:49 +--- orig/generator.c 2006-01-14 08:14:30 +++ generator.c 2005-12-15 23:05:32 @@ -44,6 +44,7 @@ extern int preserve_uid; extern int preserve_gid; @@ -177,16 +177,16 @@ command before "make": if (verbose > 4) { rprintf(FINFO, "fuzzy size/modtime match for %s\n", -@@ -1086,7 +1095,7 @@ static void recv_generator(char *fname, +@@ -1068,7 +1077,7 @@ static void recv_generator(char *fname, } if (update_only && statret == 0 - && cmp_modtime(st.st_mtime, file->modtime) > 0) { + && cmp_time(st.st_mtime, file->modtime) > 0) { if (verbose > 1) - rprintf(FINFO, "%s is newer\n", safe_fname(fname)); + rprintf(FINFO, "%s is newer\n", fname); return; ---- orig/log.c 2005-12-15 23:00:49 +--- orig/log.c 2006-01-14 08:14:30 +++ log.c 2005-12-15 23:05:44 @@ -38,6 +38,7 @@ extern int module_id; extern int msg_fd_out; @@ -196,7 +196,7 @@ command before "make": extern int log_format_has_i; extern int log_format_has_o_or_i; extern int daemon_log_format_has_o_or_i; -@@ -504,11 +505,14 @@ static void log_formatted(enum logcode c +@@ -517,11 +518,14 @@ static void log_formatted(enum logcode c n[4] = !(iflags & ITEM_REPORT_TIME) ? '.' : !preserve_times || IS_DEVICE(file->mode) || S_ISLNK(file->mode) ? 'T' : 't'; @@ -216,7 +216,7 @@ command before "make": if (iflags & (ITEM_IS_NEW|ITEM_MISSING_DATA)) { char ch = iflags & ITEM_IS_NEW ? '+' : '?'; ---- orig/options.c 2005-11-15 18:21:22 +--- orig/options.c 2006-01-14 08:14:30 +++ options.c 2005-11-07 04:32:19 @@ -50,6 +50,7 @@ int preserve_uid = 0; int preserve_gid = 0; @@ -248,7 +248,7 @@ command before "make": {"omit-dir-times", 'O', POPT_ARG_VAL, &omit_dir_times, 2, 0, 0 }, {"modify-window", 0, POPT_ARG_INT, &modify_window, OPT_MODIFY_WINDOW, 0, 0 }, {"owner", 'o', POPT_ARG_VAL, &preserve_uid, 1, 0, 0 }, -@@ -1440,6 +1445,8 @@ void server_options(char **args,int *arg +@@ -1442,6 +1447,8 @@ void server_options(char **args,int *arg argstr[x++] = 'D'; if (preserve_times) argstr[x++] = 't'; @@ -257,7 +257,7 @@ command before "make": if (omit_dir_times == 2 && am_sender) argstr[x++] = 'O'; if (preserve_perms) ---- orig/rsync.c 2005-07-27 23:31:12 +--- orig/rsync.c 2006-01-14 08:14:31 +++ rsync.c 2005-07-28 00:17:37 @@ -27,6 +27,7 @@ extern int dry_run; extern int daemon_log_format_has_i; @@ -309,7 +309,7 @@ command before "make": } change_uid = am_root && preserve_uid && st->st_uid != file->uid; ---- orig/rsync.h 2005-12-15 23:00:49 +--- orig/rsync.h 2006-01-14 08:14:31 +++ rsync.h 2005-07-28 00:04:51 @@ -54,6 +54,7 @@ #define XMIT_HAS_IDEV_DATA (1<<9) @@ -343,7 +343,7 @@ command before "make": uid_t uid; gid_t gid; mode_t mode; ---- orig/rsync.yo 2005-12-15 07:55:39 +--- orig/rsync.yo 2006-01-14 08:14:31 +++ rsync.yo 2005-11-07 04:34:55 @@ -319,8 +319,9 @@ to the detailed description below for a -o, --owner preserve owner (root only) @@ -357,7 +357,7 @@ command before "make": --chmod=CHMOD change destination permissions -S, --sparse handle sparse files efficiently -n, --dry-run show what would have been transferred -@@ -702,6 +703,12 @@ it is preserving modification times (see +@@ -711,6 +712,12 @@ it is preserving modification times (see the directories on the receiving side, it is a good idea to use bf(-O). This option is inferred if you use bf(--backup) without bf(--backup-dir). @@ -370,7 +370,7 @@ command before "make": dit(bf(--chmod)) 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 -@@ -1153,7 +1160,7 @@ changes that are being made to each file +@@ -1160,7 +1167,7 @@ changes that are being made to each file This is exactly the same as specifying bf(--log-format='%i %n%L'). The "%i" escape has a cryptic output that is 9 letters long. The general @@ -379,7 +379,7 @@ command before "make": kind of update being done, bf(X) is replaced by the file-type, and the other letters represent attributes that may be output if they are being modified. -@@ -1192,17 +1199,22 @@ quote(itemize( +@@ -1199,17 +1206,22 @@ quote(itemize( by the file transfer. it() A bf(t) means the modification time is different and is being updated to the sender's value (requires bf(--times)). An alternate value of bf(T) @@ -814,8 +814,8 @@ command before "make": return 0; } ---- orig/util.c 2005-11-12 20:13:05 -+++ util.c 2005-07-27 23:37:27 +--- orig/util.c 2006-01-14 08:14:31 ++++ util.c 2006-01-14 08:20:29 @@ -130,7 +130,7 @@ void overflow_exit(char *str) @@ -835,7 +835,7 @@ command before "make": + strlcpy(mtimebuf, timestring(modtime), sizeof mtimebuf); + rprintf(FINFO, + "set modtime, atime of %s to (%ld) %s, (%ld) %s\n", - safe_fname(fname), (long)modtime, + fname, (long)modtime, - asctime(localtime(&modtime))); + mtimebuf, (long)atime, timestring(atime)); } @@ -865,7 +865,7 @@ command before "make": t[1] = modtime; return utime(fname,t); #else -@@ -1229,8 +1233,8 @@ int msleep(int t) +@@ -1191,8 +1195,8 @@ int msleep(int t) /** @@ -876,7 +876,7 @@ command before "make": * --modify-window). * * @retval 0 if the times should be treated as the same -@@ -1239,7 +1243,7 @@ int msleep(int t) +@@ -1201,7 +1205,7 @@ int msleep(int t) * * @retval -1 if the 2nd is later **/ diff --git a/link-by-hash.diff b/link-by-hash.diff index bb7e574..d8d7c06 100644 --- a/link-by-hash.diff +++ b/link-by-hash.diff @@ -11,7 +11,7 @@ will only store one copy of the unique contents of each file, regardless of the file's name. ---- orig/Makefile.in 2005-11-07 04:29:00 +--- orig/Makefile.in 2006-01-14 08:14:29 +++ Makefile.in 2005-11-07 04:37:17 @@ -34,7 +34,7 @@ OBJS1=rsync.o generator.o receiver.o cle main.o checksum.o match.o syscall.o log.o backup.o @@ -365,9 +365,9 @@ the file's name. +} + +#endif ---- orig/options.c 2005-11-07 04:29:01 +--- orig/options.c 2006-01-14 08:14:30 +++ options.c 2005-11-07 04:37:30 -@@ -145,6 +145,7 @@ char *password_file = NULL; +@@ -146,6 +146,7 @@ char *password_file = NULL; char *rsync_path = RSYNC_PATH; char *backup_dir = NULL; char *chmod_mode = NULL; @@ -375,7 +375,7 @@ the file's name. char backup_dir_buf[MAXPATHLEN]; int rsync_port = 0; int compare_dest = 0; -@@ -329,6 +330,7 @@ void usage(enum logcode F) +@@ -330,6 +331,7 @@ void usage(enum logcode F) rprintf(F," --compare-dest=DIR also compare destination files relative to DIR\n"); rprintf(F," --copy-dest=DIR ... and include copies of unchanged files\n"); rprintf(F," --link-dest=DIR hardlink to files in DIR when unchanged\n"); @@ -383,8 +383,8 @@ the file's name. rprintf(F," -z, --compress compress file data during the transfer\n"); rprintf(F," --compress-level=NUM explicitly set compression level\n"); rprintf(F," -C, --cvs-exclude auto-ignore files the same way CVS does\n"); -@@ -372,7 +374,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OP - OPT_FILTER, OPT_COMPARE_DEST, OPT_COPY_DEST, OPT_LINK_DEST, +@@ -375,7 +377,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OP + 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_READ_BATCH, OPT_WRITE_BATCH, OPT_ONLY_WRITE_BATCH, OPT_MAX_SIZE, - OPT_REFUSED_BASE = 9000}; @@ -392,7 +392,7 @@ the file's name. static struct poptOption long_options[] = { /* longName, shortName, argInfo, argPtr, value, descrip, argDesc */ -@@ -458,6 +460,7 @@ static struct poptOption long_options[] +@@ -463,6 +465,7 @@ static struct poptOption long_options[] {"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 }, {"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 }, {"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 }, @@ -400,7 +400,7 @@ the file's name. {"fuzzy", 'y', POPT_ARG_NONE, &fuzzy_basis, 0, 0, 0 }, {"compress", 'z', POPT_ARG_NONE, 0, 'z', 0, 0 }, {"compress-level", 0, POPT_ARG_INT, &def_compress_level, 'z', 0, 0 }, -@@ -994,6 +997,21 @@ int parse_arguments(int *argc, const cha +@@ -1000,6 +1003,21 @@ int parse_arguments(int *argc, const cha basis_dir[basis_dir_cnt++] = (char *)arg; break; @@ -422,7 +422,7 @@ the file's name. default: /* A large opt value means that set_refuse_options() * turned this option off. */ -@@ -1616,6 +1634,11 @@ void server_options(char **args,int *arg +@@ -1629,6 +1647,11 @@ void server_options(char **args,int *arg args[ac++] = chmod_mode; } @@ -434,7 +434,7 @@ the file's name. if (files_from && (!am_sender || filesfrom_host)) { if (filesfrom_host) { args[ac++] = "--files-from"; ---- orig/receiver.c 2005-09-16 05:41:02 +--- orig/receiver.c 2006-01-14 08:14:31 +++ receiver.c 2005-01-15 21:29:13 @@ -54,6 +54,7 @@ extern int delay_updates; extern struct stats stats; @@ -444,7 +444,7 @@ the file's name. extern char *partial_dir; extern char *basis_dir[]; extern struct file_list *the_file_list; -@@ -187,12 +188,13 @@ static int get_tmpname(char *fnametmp, c +@@ -186,12 +187,13 @@ static int get_tmpname(char *fnametmp, c static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, @@ -459,7 +459,7 @@ the file's name. int32 len; OFF_T offset = 0; OFF_T offset2; -@@ -212,6 +214,9 @@ static int receive_data(int f_in, char * +@@ -211,6 +213,9 @@ static int receive_data(int f_in, char * } else mapbuf = NULL; @@ -469,7 +469,7 @@ the file's name. sum_init(checksum_seed); if (append_mode) { -@@ -254,6 +259,8 @@ static int receive_data(int f_in, char * +@@ -253,6 +258,8 @@ static int receive_data(int f_in, char * cleanup_got_literal = 1; sum_update(data, i); @@ -478,7 +478,7 @@ the file's name. if (fd != -1 && write_file(fd,data,i) != i) goto report_write_error; -@@ -280,6 +287,8 @@ static int receive_data(int f_in, char * +@@ -279,6 +286,8 @@ static int receive_data(int f_in, char * see_token(map, len); sum_update(map, len); @@ -487,7 +487,7 @@ the file's name. } if (inplace) { -@@ -320,6 +329,8 @@ static int receive_data(int f_in, char * +@@ -319,6 +328,8 @@ static int receive_data(int f_in, char * } sum_end(file_sum1); @@ -496,7 +496,7 @@ the file's name. if (mapbuf) unmap_file(mapbuf); -@@ -335,7 +346,7 @@ static int receive_data(int f_in, char * +@@ -334,7 +345,7 @@ static int receive_data(int f_in, char * static void discard_receive_data(int f_in, OFF_T length) { @@ -505,8 +505,8 @@ the file's name. } static void handle_delayed_updates(struct file_list *flist, char *local_name) -@@ -669,8 +680,12 @@ int recv_files(int f_in, struct file_lis - rprintf(FINFO, "%s\n", safe_fname(fname)); +@@ -666,8 +677,12 @@ int recv_files(int f_in, struct file_lis + rprintf(FINFO, "%s\n", fname); /* recv file data */ +#if HAVE_LINK @@ -519,8 +519,8 @@ the file's name. if (!log_before_transfer) log_item(file, &initial_stats, iflags, NULL); ---- orig/rsync.c 2005-07-27 23:31:12 -+++ rsync.c 2005-02-21 11:04:36 +--- orig/rsync.c 2006-01-14 08:14:31 ++++ rsync.c 2006-01-14 08:26:01 @@ -38,6 +38,7 @@ extern int inplace; extern int keep_dirlinks; extern int make_backups; @@ -529,10 +529,10 @@ the file's name. /* -@@ -190,7 +191,12 @@ void finish_transfer(char *fname, char * - rprintf(FINFO, "renaming %s to %s\n", - safe_fname(fnametmp), safe_fname(fname)); - } +@@ -188,7 +189,12 @@ void finish_transfer(char *fname, char * + /* move tmp file over real file */ + if (verbose > 2) + rprintf(FINFO, "renaming %s to %s\n", fnametmp, fname); - ret = robust_rename(fnametmp, fname, file->mode & INITACCESSPERMS); +#if HAVE_LINK + if (link_by_hash_dir) @@ -542,10 +542,10 @@ the file's name. + ret = robust_rename(fnametmp, fname, file->mode & INITACCESSPERMS); if (ret < 0) { rsyserr(FERROR, errno, "%s %s -> \"%s\"", - ret == -2 ? "copy" : "rename", ---- orig/rsync.h 2005-10-14 18:45:50 + ret == -2 ? "copy" : "rename", +--- orig/rsync.h 2006-01-14 08:14:31 +++ rsync.h 2004-07-03 20:20:15 -@@ -644,6 +644,14 @@ struct stats { +@@ -639,6 +639,14 @@ struct stats { int current_file_index; }; @@ -560,7 +560,7 @@ the file's name. #include "byteorder.h" #include "lib/mdfour.h" ---- orig/rsync.yo 2005-11-07 04:29:02 +--- orig/rsync.yo 2006-01-14 08:14:31 +++ rsync.yo 2005-02-13 06:58:47 @@ -356,6 +356,7 @@ to the detailed description below for a --compare-dest=DIR also compare received files relative to DIR diff --git a/source-filter_dest-filter.diff b/source-filter_dest-filter.diff index e48f884..cec9390 100644 --- a/source-filter_dest-filter.diff +++ b/source-filter_dest-filter.diff @@ -25,28 +25,28 @@ Implementation details for the --source-filter and -dest-filter options: You should run "make proto" before running "make". ---- orig/generator.c 2005-08-17 06:45:07 +--- orig/generator.c 2006-01-14 08:14:30 +++ generator.c 2005-08-17 07:28:01 -@@ -58,6 +58,7 @@ extern int append_mode; +@@ -59,6 +59,7 @@ extern int append_mode; extern int make_backups; extern int csum_length; extern int ignore_times; +extern int times_only; extern int size_only; extern OFF_T max_size; - extern int io_error; -@@ -360,7 +361,7 @@ void itemize(struct file_struct *file, i + extern OFF_T min_size; +@@ -378,7 +379,7 @@ void itemize(struct file_struct *file, i /* Perform our quick-check heuristic for determining if a file is unchanged. */ - static int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st) + int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st) { - if (st->st_size != file->length) + if (!times_only && st->st_size != file->length) return 0; /* if always checksum is set then we use the checksum instead ---- orig/options.c 2005-08-27 21:11:26 +--- orig/options.c 2006-01-14 08:14:30 +++ options.c 2005-08-27 21:27:17 -@@ -90,6 +90,7 @@ int keep_partial = 0; +@@ -93,6 +93,7 @@ int keep_partial = 0; int safe_symlinks = 0; int copy_unsafe_links = 0; int size_only = 0; @@ -54,7 +54,7 @@ You should run "make proto" before running "make". int daemon_bwlimit = 0; int bwlimit = 0; int fuzzy_basis = 0; -@@ -138,6 +139,8 @@ char *basis_dir[MAX_BASIS_DIRS+1]; +@@ -142,6 +143,8 @@ char *basis_dir[MAX_BASIS_DIRS+1]; char *config_file = NULL; char *shell_cmd = NULL; char *log_format = NULL; @@ -63,7 +63,7 @@ You should run "make proto" before running "make". char *password_file = NULL; char *rsync_path = RSYNC_PATH; char *backup_dir = NULL; -@@ -316,6 +319,7 @@ void usage(enum logcode F) +@@ -324,6 +327,7 @@ void usage(enum logcode F) rprintf(F," --timeout=TIME set I/O timeout in seconds\n"); rprintf(F," -I, --ignore-times don't skip files that match in size and mod-time\n"); rprintf(F," --size-only skip files that match in size\n"); @@ -71,7 +71,7 @@ You should run "make proto" before running "make". 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," -y, --fuzzy find similar file for basis if no dest file\n"); -@@ -347,6 +351,8 @@ void usage(enum logcode F) +@@ -358,6 +362,8 @@ void usage(enum logcode F) rprintf(F," --write-batch=FILE write a batched update to FILE\n"); rprintf(F," --only-write-batch=FILE like --write-batch but w/o updating destination\n"); rprintf(F," --read-batch=FILE read a batched update from FILE\n"); @@ -80,15 +80,15 @@ You should run "make proto" before running "make". rprintf(F," --protocol=NUM force an older protocol version to be used\n"); #ifdef INET6 rprintf(F," -4, --ipv4 prefer IPv4\n"); -@@ -413,6 +419,7 @@ static struct poptOption long_options[] - {"no-implied-dirs", 0, POPT_ARG_VAL, &implied_dirs, 0, 0, 0 }, +@@ -428,6 +434,7 @@ static struct poptOption long_options[] + {"chmod", 0, POPT_ARG_STRING, &chmod_mode, 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 }, + {"times-only", 0, POPT_ARG_NONE, ×_only , 0, 0, 0 }, {"one-file-system", 'x', POPT_ARG_NONE, &one_file_system, 0, 0, 0 }, {"update", 'u', POPT_ARG_NONE, &update_only, 0, 0, 0 }, - {"existing", 0, POPT_ARG_NONE, &only_existing, 0, 0, 0 }, -@@ -481,6 +488,8 @@ static struct poptOption long_options[] + {"existing", 0, POPT_ARG_NONE, &ignore_non_existing, 0, 0, 0 }, +@@ -499,6 +506,8 @@ static struct poptOption long_options[] {"password-file", 0, POPT_ARG_STRING, &password_file, 0, 0, 0 }, {"blocking-io", 0, POPT_ARG_VAL, &blocking_io, 1, 0, 0 }, {"no-blocking-io", 0, POPT_ARG_VAL, &blocking_io, 0, 0, 0 }, @@ -97,7 +97,7 @@ You should run "make proto" before running "make". {"protocol", 0, POPT_ARG_INT, &protocol_version, 0, 0, 0 }, {"checksum-seed", 0, POPT_ARG_INT, &checksum_seed, 0, 0, 0 }, {"server", 0, POPT_ARG_NONE, &am_server, 0, 0, 0 }, -@@ -1219,6 +1228,16 @@ int parse_arguments(int *argc, const cha +@@ -1324,6 +1333,16 @@ int parse_arguments(int *argc, const cha } } @@ -114,7 +114,7 @@ You should run "make proto" before running "make". if (files_from) { char *h, *p; int q; -@@ -1442,6 +1461,25 @@ void server_options(char **args,int *arg +@@ -1558,6 +1577,25 @@ void server_options(char **args,int *arg args[ac++] = "--only-write-batch=X"; } @@ -140,9 +140,9 @@ You should run "make proto" before running "make". if (size_only) args[ac++] = "--size-only"; ---- orig/pipe.c 2005-04-09 18:00:29 -+++ pipe.c 2005-08-17 07:24:44 -@@ -158,3 +158,79 @@ pid_t local_child(int argc, char **argv, +--- orig/pipe.c 2006-01-14 08:14:31 ++++ pipe.c 2006-01-14 08:34:59 +@@ -157,3 +157,77 @@ pid_t local_child(int argc, char **argv, return pid; } @@ -178,8 +178,7 @@ You should run "make proto" before running "make". + if (blocking_io) + set_blocking(STDOUT_FILENO); + execvp(command[0], command); -+ rsyserr(FERROR, errno, "Failed to exec %s", -+ safe_fname(command[0])); ++ rsyserr(FERROR, errno, "Failed to exec %s", command[0]); + exit_cleanup(RERR_IPC); + } + @@ -215,16 +214,15 @@ You should run "make proto" before running "make". + if (blocking_io) + set_blocking(STDOUT_FILENO); + execvp(command[0], command); -+ rsyserr(FERROR, errno, "Failed to exec %s", -+ safe_fname(command[0])); ++ rsyserr(FERROR, errno, "Failed to exec %s", command[0]); + exit_cleanup(RERR_IPC); + } + + return pid; +} ---- orig/receiver.c 2005-08-17 06:45:08 +--- orig/receiver.c 2006-01-14 08:14:31 +++ receiver.c 2005-08-17 07:57:33 -@@ -52,6 +52,7 @@ extern int inplace; +@@ -53,6 +53,7 @@ extern int inplace; extern int delay_updates; extern struct stats stats; extern char *log_format; @@ -232,7 +230,7 @@ You should run "make proto" before running "make". extern char *tmpdir; extern char *partial_dir; extern char *basis_dir[]; -@@ -412,6 +413,8 @@ int recv_files(int f_in, struct file_lis +@@ -411,6 +412,8 @@ int recv_files(int f_in, struct file_lis : !am_server && log_format_has_i; int max_phase = protocol_version >= 29 ? 2 : 1; int i, recv_ok; @@ -241,7 +239,7 @@ You should run "make proto" before running "make". if (verbose > 2) rprintf(FINFO,"recv_files(%d) starting\n",flist->count); -@@ -424,6 +427,23 @@ int recv_files(int f_in, struct file_lis +@@ -423,6 +426,23 @@ int recv_files(int f_in, struct file_lis if (delay_updates) init_delayed_bits(flist->count); @@ -265,9 +263,9 @@ You should run "make proto" before running "make". while (1) { cleanup_disable(); -@@ -662,6 +682,9 @@ int recv_files(int f_in, struct file_lis +@@ -665,6 +685,9 @@ int recv_files(int f_in, struct file_lis else if (!am_server && verbose && do_progress) - rprintf(FINFO, "%s\n", safe_fname(fname)); + rprintf(FINFO, "%s\n", fname); + if (dest_filter) + pid = run_filter(filter_argv, fd2, &fd2); @@ -275,7 +273,7 @@ You should run "make proto" before running "make". /* recv file data */ recv_ok = receive_data(f_in, fnamecmp, fd1, st.st_size, fname, fd2, file->length); -@@ -677,6 +700,16 @@ int recv_files(int f_in, struct file_lis +@@ -680,6 +703,16 @@ int recv_files(int f_in, struct file_lis exit_cleanup(RERR_FILEIO); } @@ -292,7 +290,7 @@ You should run "make proto" before running "make". if ((recv_ok && (!delay_updates || !partialptr)) || inplace) { finish_transfer(fname, fnametmp, file, recv_ok, 1); if (partialptr != fname && fnamecmp == partialptr) { ---- orig/rsync.h 2005-08-17 06:45:08 +--- orig/rsync.h 2006-01-14 08:14:31 +++ rsync.h 2005-08-17 07:10:11 @@ -103,6 +103,7 @@ #define IOERR_DEL_LIMIT (1<<2) @@ -302,7 +300,7 @@ You should run "make proto" before running "make". #define MAX_BASIS_DIRS 20 #define MAX_SERVER_ARGS (MAX_BASIS_DIRS*2 + 100) ---- orig/rsync.yo 2005-08-27 21:05:12 +--- orig/rsync.yo 2006-01-14 08:14:31 +++ rsync.yo 2005-08-17 07:08:21 @@ -350,6 +350,7 @@ to the detailed description below for a --timeout=TIME set I/O timeout in seconds @@ -312,7 +310,7 @@ You should run "make proto" before running "make". --modify-window=NUM compare mod-times with reduced accuracy -T, --temp-dir=DIR create temporary files in directory DIR -y, --fuzzy find similar file for basis if no dest file -@@ -381,6 +382,8 @@ to the detailed description below for a +@@ -384,6 +385,8 @@ to the detailed description below for a --write-batch=FILE write a batched update to FILE --only-write-batch=FILE like --write-batch but w/o updating dest --read-batch=FILE read a batched update from FILE @@ -321,8 +319,8 @@ You should run "make proto" before running "make". --protocol=NUM force an older protocol version to be used --checksum-seed=NUM set block/file checksum seed (advanced) -4, --ipv4 prefer IPv4 -@@ -1346,6 +1349,33 @@ file previously generated by bf(--write- - If em(FILE) is "-" the batch data will be read from standard input. +@@ -1411,6 +1414,33 @@ file previously generated by bf(--write- + If em(FILE) is bf(-), the batch data will be read from standard input. See the "BATCH MODE" section for details. +dit(bf(--source-filter=COMMAND)) This option allows the user to specify a @@ -355,7 +353,7 @@ You should run "make proto" before running "make". dit(bf(--protocol=NUM)) Force an older protocol version to be used. This is useful for creating a batch file that is compatible with an older version of rsync. For instance, if rsync 2.6.4 is being used with the ---- orig/sender.c 2005-07-28 01:46:25 +--- orig/sender.c 2006-01-14 08:14:31 +++ sender.c 2005-08-17 07:40:49 @@ -41,6 +41,7 @@ extern int write_batch; extern struct stats stats; @@ -365,7 +363,7 @@ You should run "make proto" before running "make". /** -@@ -221,6 +222,26 @@ void send_files(struct file_list *flist, +@@ -219,6 +220,26 @@ void send_files(struct file_list *flist, : !am_server && log_format_has_i; int f_xfer = write_batch < 0 ? batch_fd : f_out; int i, j; @@ -392,7 +390,7 @@ You should run "make proto" before running "make". if (verbose > 2) rprintf(FINFO, "send_files starting\n"); -@@ -295,6 +316,7 @@ void send_files(struct file_list *flist, +@@ -293,6 +314,7 @@ void send_files(struct file_list *flist, return; } @@ -400,7 +398,7 @@ You should run "make proto" before running "make". fd = do_open(fname, O_RDONLY, 0); if (fd == -1) { if (errno == ENOENT) { -@@ -323,6 +345,33 @@ void send_files(struct file_list *flist, +@@ -321,6 +343,33 @@ void send_files(struct file_list *flist, return; } @@ -434,7 +432,7 @@ You should run "make proto" before running "make". if (st.st_size) { int32 read_size = MAX(s->blength * 3, MAX_MAP_SIZE); mbuf = map_file(fd, st.st_size, read_size, s->blength); -@@ -367,6 +416,8 @@ void send_files(struct file_list *flist, +@@ -363,6 +412,8 @@ void send_files(struct file_list *flist, } } close(fd); diff --git a/threaded-receiver.diff b/threaded-receiver.diff index 6cdf480..4db4cb4 100644 --- a/threaded-receiver.diff +++ b/threaded-receiver.diff @@ -18,7 +18,7 @@ mailing list with your results, build changes, bug reports, etc. Thanks! Be sure to run "make proto" before running "make". ---- orig/Makefile.in 2005-11-07 04:29:00 +--- orig/Makefile.in 2006-01-14 08:14:29 +++ Makefile.in 2005-12-10 18:35:39 @@ -6,7 +6,7 @@ exec_prefix=@exec_prefix@ bindir=@bindir@ @@ -29,7 +29,7 @@ Be sure to run "make proto" before running "make". CC=@CC@ CFLAGS=@CFLAGS@ CPPFLAGS=@CPPFLAGS@ ---- orig/cleanup.c 2005-11-10 16:58:36 +--- orig/cleanup.c 2006-01-14 08:14:29 +++ cleanup.c 2005-12-08 23:17:08 @@ -94,9 +94,6 @@ void _exit_cleanup(int code, const char } @@ -40,7 +40,7 @@ Be sure to run "make proto" before running "make". - if (verbose > 3) { rprintf(FINFO,"_exit_cleanup(code=%d, file=%s, line=%d): entered\n", - code, safe_fname(file), line); + code, file, line); @@ -127,8 +124,6 @@ void _exit_cleanup(int code, const char io_flush(FULL_FLUSH); if (cleanup_fname) @@ -60,7 +60,7 @@ Be sure to run "make proto" before running "make". #define RERR_SIGNAL 20 /* status returned when sent SIGINT, SIGTERM, SIGHUP */ #define RERR_WAITCHILD 21 /* some error returned by waitpid() */ #define RERR_MALLOC 22 /* error allocating core memory buffers */ ---- orig/generator.c 2005-12-16 04:03:06 +--- orig/generator.c 2006-01-14 08:14:30 +++ generator.c 2005-12-08 23:17:08 @@ -65,7 +65,6 @@ extern OFF_T min_size; extern int io_error; @@ -120,7 +120,7 @@ Be sure to run "make proto" before running "make". continue; } -@@ -1143,7 +1147,7 @@ static void recv_generator(char *fname, +@@ -1135,7 +1139,7 @@ static void recv_generator(char *fname, return; } @@ -129,7 +129,7 @@ Be sure to run "make proto" before running "make". return; if (fnamecmp_type <= FNAMECMP_BASIS_DIR_HIGH) -@@ -1198,7 +1202,7 @@ static void recv_generator(char *fname, +@@ -1190,7 +1194,7 @@ static void recv_generator(char *fname, goto notify_others; } @@ -138,7 +138,7 @@ Be sure to run "make proto" before running "make". if (!(backupptr = get_backup_name(fname))) { close(fd); return; -@@ -1288,7 +1292,10 @@ void generate_files(int f_out, struct fi +@@ -1280,7 +1284,10 @@ void generate_files(int f_out, struct fi int save_ignore_existing = ignore_existing; int save_ignore_non_existing = ignore_non_existing; int save_do_progress = do_progress; @@ -150,7 +150,7 @@ Be sure to run "make proto" before running "make". if (protocol_version >= 29) { itemizing = 1; -@@ -1317,7 +1324,7 @@ void generate_files(int f_out, struct fi +@@ -1309,7 +1316,7 @@ void generate_files(int f_out, struct fi do_delete_pass(flist); do_progress = 0; @@ -159,7 +159,7 @@ Be sure to run "make proto" before running "make". whole_file = 0; if (verbose >= 2) { rprintf(FINFO, "delta-transmission %s\n", -@@ -1326,12 +1333,6 @@ void generate_files(int f_out, struct fi +@@ -1318,12 +1325,6 @@ void generate_files(int f_out, struct fi : "enabled"); } @@ -172,7 +172,7 @@ Be sure to run "make proto" before running "make". for (i = 0; i < flist->count; i++) { struct file_struct *file = flist->files[i]; -@@ -1375,23 +1376,34 @@ void generate_files(int f_out, struct fi +@@ -1367,23 +1368,34 @@ void generate_files(int f_out, struct fi delete_in_dir(NULL, NULL, NULL); phase++; @@ -213,7 +213,7 @@ Be sure to run "make proto" before running "make". if (local_name) strlcpy(fbuf, local_name, sizeof fbuf); else -@@ -1403,27 +1415,43 @@ void generate_files(int f_out, struct fi +@@ -1395,27 +1407,43 @@ void generate_files(int f_out, struct fi phase++; ignore_non_existing = save_ignore_non_existing; ignore_existing = save_ignore_existing; @@ -705,7 +705,7 @@ Be sure to run "make proto" before running "make". - write_batch_monitor_out = -1; - write_batch_monitor_in = -1; -} ---- orig/log.c 2005-12-16 23:48:44 +--- orig/log.c 2006-01-14 08:14:30 +++ log.c 2005-12-16 23:49:57 @@ -35,7 +35,6 @@ extern int am_sender; extern int local_server; @@ -734,7 +734,7 @@ Be sure to run "make proto" before running "make". send_msg((enum msgcode)code, buf, len); return; } ---- orig/main.c 2005-12-16 23:48:44 +--- orig/main.c 2006-01-14 08:14:30 +++ main.c 2005-12-16 23:50:33 @@ -30,7 +30,6 @@ extern int list_only; extern int am_root; @@ -972,7 +972,7 @@ Be sure to run "make proto" before running "make". show_progress(last_match, buf->file_size); sum_update(map_ptr(buf, last_match, len), len); last_match = s->flength; ---- orig/options.c 2005-12-16 23:48:44 +--- orig/options.c 2006-01-14 08:14:30 +++ options.c 2005-12-08 23:17:09 @@ -69,7 +69,6 @@ int def_compress_level = Z_DEFAULT_COMPR int am_root = 0; @@ -990,7 +990,7 @@ Be sure to run "make proto" before running "make". int keep_partial = 0; int safe_symlinks = 0; int copy_unsafe_links = 0; -@@ -1236,6 +1236,7 @@ int parse_arguments(int *argc, const cha +@@ -1234,6 +1234,7 @@ int parse_arguments(int *argc, const cha if ((do_progress || dry_run) && !verbose && !log_before_transfer && !am_server) verbose = 1; @@ -998,7 +998,7 @@ Be sure to run "make proto" before running "make". if (dry_run) do_xfers = 0; ---- orig/pipe.c 2005-10-24 21:04:45 +--- orig/pipe.c 2006-01-14 08:14:31 +++ pipe.c 2005-12-08 23:17:09 @@ -55,7 +55,7 @@ pid_t piped_child(char **command, int *f exit_cleanup(RERR_IPC); @@ -1009,7 +1009,7 @@ Be sure to run "make proto" before running "make". if (pid == -1) { rsyserr(FERROR, errno, "fork"); exit_cleanup(RERR_IPC); -@@ -117,7 +117,7 @@ pid_t local_child(int argc, char **argv, +@@ -116,7 +116,7 @@ pid_t local_child(int argc, char **argv, exit_cleanup(RERR_IPC); } @@ -1018,8 +1018,8 @@ Be sure to run "make proto" before running "make". if (pid == -1) { rsyserr(FERROR, errno, "fork"); exit_cleanup(RERR_IPC); ---- orig/receiver.c 2005-11-10 16:58:36 -+++ receiver.c 2005-12-08 23:17:10 +--- orig/receiver.c 2006-01-14 08:14:31 ++++ receiver.c 2006-01-14 08:30:29 @@ -24,7 +24,7 @@ extern int verbose; extern int do_xfers; extern int am_daemon; @@ -1029,7 +1029,7 @@ Be sure to run "make proto" before running "make". extern int log_before_transfer; extern int log_format_has_i; extern int daemon_log_format_has_i; -@@ -220,7 +220,7 @@ static int receive_data(int f_in, char * +@@ -219,7 +219,7 @@ static int receive_data(int f_in, char * if (sum.remainder) sum.flength -= sum.blength - sum.remainder; for (j = CHUNK_SIZE; j < sum.flength; j += CHUNK_SIZE) { @@ -1038,7 +1038,7 @@ Be sure to run "make proto" before running "make". show_progress(offset, total_size); sum_update(map_ptr(mapbuf, offset, CHUNK_SIZE), CHUNK_SIZE); -@@ -228,7 +228,7 @@ static int receive_data(int f_in, char * +@@ -227,7 +227,7 @@ static int receive_data(int f_in, char * } if (offset < sum.flength) { int32 len = sum.flength - offset; @@ -1047,7 +1047,7 @@ Be sure to run "make proto" before running "make". show_progress(offset, total_size); sum_update(map_ptr(mapbuf, offset, len), len); offset = sum.flength; -@@ -241,7 +241,7 @@ static int receive_data(int f_in, char * +@@ -240,7 +240,7 @@ static int receive_data(int f_in, char * } while ((i = recv_token(f_in, &data)) != 0) { @@ -1056,7 +1056,7 @@ Be sure to run "make proto" before running "make". show_progress(offset, total_size); if (i > 0) { -@@ -309,7 +309,7 @@ static int receive_data(int f_in, char * +@@ -308,7 +308,7 @@ static int receive_data(int f_in, char * ftruncate(fd, offset); #endif @@ -1065,9 +1065,9 @@ Be sure to run "make proto" before running "make". end_progress(total_size); if (fd != -1 && offset > 0 && sparse_end(fd) != 0) { -@@ -362,14 +362,13 @@ static void handle_delayed_updates(struc - full_fname(fname), - safe_fname(partialptr)); +@@ -359,12 +359,12 @@ static void handle_delayed_updates(struc + "rename failed for %s (from %s)", + full_fname(fname), partialptr); } else { - if (remove_sent_files - || (preserve_hard_links @@ -1076,15 +1076,12 @@ Be sure to run "make proto" before running "make". SIVAL(numbuf, 0, i); send_msg(MSG_SUCCESS,numbuf,4); } -- handle_partial_dir(partialptr, -- PDIR_DELETE); + if (preserve_hard_links && file->link_u.links) + push_hlink_num(i); -+ handle_partial_dir(partialptr, PDIR_DELETE); + handle_partial_dir(partialptr, PDIR_DELETE); } } - } -@@ -419,11 +418,6 @@ int recv_files(int f_in, struct file_lis +@@ -415,11 +415,6 @@ int recv_files(int f_in, struct file_lis if (verbose > 2) rprintf(FINFO,"recv_files(%d) starting\n",flist->count); @@ -1096,7 +1093,7 @@ Be sure to run "make proto" before running "make". if (delay_updates) init_delayed_bits(flist->count); -@@ -444,7 +438,7 @@ int recv_files(int f_in, struct file_lis +@@ -440,7 +435,7 @@ int recv_files(int f_in, struct file_lis rprintf(FINFO, "recv_files phase=%d\n", phase); if (phase == 2 && delay_updates) handle_delayed_updates(flist, local_name); @@ -1105,16 +1102,16 @@ Be sure to run "make proto" before running "make". if (keep_partial && !partial_dir) make_backups = 0; /* prevents double backup */ if (append_mode) { -@@ -665,7 +659,7 @@ int recv_files(int f_in, struct file_lis +@@ -662,7 +657,7 @@ int recv_files(int f_in, struct file_lis /* log the transfer */ if (log_before_transfer) log_item(file, &initial_stats, iflags, NULL); - else if (!am_server && verbose && do_progress) + else if (!am_server && verbose && recv_progress) - rprintf(FINFO, "%s\n", safe_fname(fname)); + rprintf(FINFO, "%s\n", fname); /* recv file data */ -@@ -705,11 +699,12 @@ int recv_files(int f_in, struct file_lis +@@ -702,11 +697,12 @@ int recv_files(int f_in, struct file_lis cleanup_disable(); if (recv_ok > 0) { @@ -1129,9 +1126,9 @@ Be sure to run "make proto" before running "make". } else if (!recv_ok) { int msgtype = phase || read_batch ? FERROR : FINFO; if (msgtype == FERROR || verbose) { -@@ -732,10 +727,8 @@ int recv_files(int f_in, struct file_lis - errstr, safe_fname(fname), - keptstr, redostr); +@@ -728,10 +724,8 @@ int recv_files(int f_in, struct file_lis + "%s: %s failed verification -- update %s%s.\n", + errstr, fname, keptstr, redostr); } - if (!phase) { - SIVAL(numbuf, 0, i); @@ -1142,7 +1139,7 @@ Be sure to run "make proto" before running "make". } } make_backups = save_make_backups; ---- orig/rsync.c 2005-07-27 23:31:12 +--- orig/rsync.c 2006-01-14 08:14:31 +++ rsync.c 2005-12-08 23:17:10 @@ -30,7 +30,6 @@ extern int omit_dir_times; extern int am_root; @@ -1152,14 +1149,14 @@ Be sure to run "make proto" before running "make". extern int am_starting_up; extern int preserve_uid; extern int preserve_gid; -@@ -210,5 +209,5 @@ const char *who_am_i(void) +@@ -208,5 +207,5 @@ const char *who_am_i(void) { if (am_starting_up) return am_server ? "server" : "client"; - return am_sender ? "sender" : am_generator ? "generator" : "receiver"; + return am_sender ? "sender" : am_generator() ? "generator" : "receiver"; } ---- orig/rsync.h 2005-12-15 23:00:49 +--- orig/rsync.h 2006-01-14 08:14:31 +++ rsync.h 2005-12-10 19:02:58 @@ -165,10 +165,8 @@ enum msgcode { MSG_DATA=0, /* raw data on the multiplexed stream */ @@ -1180,7 +1177,7 @@ Be sure to run "make proto" before running "make". #include "lib/pool_alloc.h" ---- orig/util.c 2005-11-12 20:13:05 +--- orig/util.c 2006-01-14 08:14:31 +++ util.c 2005-12-08 23:17:10 @@ -405,51 +405,6 @@ int robust_rename(char *from, char *to, return -1;