diff -urN rsync-2.6.1/NEWS rsync-2.6.2/NEWS --- rsync-2.6.1/NEWS 2004-04-26 20:53:28.000000000 -0700 +++ rsync-2.6.2/NEWS 2004-04-30 10:53:51.000000000 -0700 @@ -1,3 +1,42 @@ +NEWS for rsync 2.6.2 (30 Apr 2004) +Protocol: 28 (unchanged) +Changes since 2.6.1: + + BUG FIXES: + + - Fixed a major bug in the sorting of the filenames when --relative + is used for some sources (probably just "/", but don't depend on + that). This fix ensures that we ask for the right file-list item + when requesting changes from the sender. + + - Rsync now checks the return value of the close() function to + better report disk-full problems on an NFS file system. + + - Restored the old daemon-server behavior of logging error messages + rather than returning them to the user. (A better long-term fix + will be sought in the future.) + + - An obscure uninitialized-variable bug was fixed in the uid/gid + code. (This bug probably had no ill effects.) + + - Got rid of the configure check for sys/sysctl.h (it wasn't used + and was causing a problem on some systems). Also improved the + broken-largefile-locking test to try to avoid failure due to an + NFS build-dir. + + - Fixed a compile problem on systems that don't define + AI_NUMERICHOST. + + - Fixed a compile problem in the popt source for compilers that + don't support __attribute__. + + INTERNAL: + + - Improved the testsuite's "merge" test to work on OSF1. + + - Two new diffs were added to the patches dir. + + NEWS for rsync 2.6.1 (26 Apr 2004) Protocol: 28 (changed) Changes since 2.6.0: diff -urN rsync-2.6.1/TODO rsync-2.6.2/TODO --- rsync-2.6.1/TODO 2004-02-21 13:37:14.000000000 -0800 +++ rsync-2.6.2/TODO 2004-04-29 14:12:46.000000000 -0700 @@ -425,7 +425,9 @@ our load? (Debian #28416) Probably fixed now, but a test case would be good. - + When running as a daemon, some errors should both be returned to the + user and logged. This will make interacting with a daemon less + cryptic. -- -- diff -urN rsync-2.6.1/clientname.c rsync-2.6.2/clientname.c --- rsync-2.6.1/clientname.c 2004-04-01 13:39:35.000000000 -0800 +++ rsync-2.6.2/clientname.c 2004-04-30 09:10:45.000000000 -0700 @@ -118,7 +118,9 @@ memset(&hint, 0, sizeof hint); +#ifdef AI_NUMERICHOST hint.ai_flags = AI_NUMERICHOST; +#endif hint.ai_socktype = SOCK_STREAM; if ((err = getaddrinfo(addr, NULL, &hint, &answer)) != 0) { diff -urN rsync-2.6.1/config.h.in rsync-2.6.2/config.h.in --- rsync-2.6.1/config.h.in 2004-04-09 11:09:30.000000000 -0700 +++ rsync-2.6.2/config.h.in 2004-04-29 12:40:39.000000000 -0700 @@ -277,9 +277,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SYSCTL_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H diff -urN rsync-2.6.1/configure rsync-2.6.2/configure --- rsync-2.6.1/configure 2004-04-26 20:54:05.000000000 -0700 +++ rsync-2.6.2/configure 2004-04-30 11:02:43.000000000 -0700 @@ -1314,7 +1314,7 @@ -RSYNC_VERSION=2.6.1 +RSYNC_VERSION=2.6.2 { echo "$as_me:$LINENO: Configuring rsync $RSYNC_VERSION" >&5 echo "$as_me: Configuring rsync $RSYNC_VERSION" >&6;} @@ -2905,21 +2905,26 @@ int main(void) { struct flock lock; - int status; - int fd = open("conftest.dat", O_CREAT|O_RDWR, 0600); + int status; + char tpl[32] = "/tmp/locktest.XXXXXX"; + int fd = mkstemp(tpl); + if (fd < 0) { + strcpy(tpl, "conftest.dat"); + fd = open(tpl, O_CREAT|O_RDWR, 0600); + } + lock.l_type = F_WRLCK; lock.l_whence = SEEK_SET; lock.l_start = 0; lock.l_len = 1; lock.l_pid = 0; - fcntl(fd,F_SETLK,&lock); if (fork() == 0) { lock.l_start = 1; - exit(fcntl(fd,F_SETLK,&lock) == 0); - } - wait(&status); - unlink("conftest.dat"); + _exit(fcntl(fd,F_SETLK,&lock) == 0); + } + wait(&status); + unlink(tpl); exit(WEXITSTATUS(status)); } @@ -4599,11 +4604,10 @@ - for ac_header in sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h \ unistd.h utime.h grp.h compat.h sys/param.h ctype.h sys/wait.h \ sys/ioctl.h sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h \ - sys/un.h glob.h mcheck.h sys/sysctl.h arpa/inet.h arpa/nameser.h \ + sys/un.h glob.h mcheck.h arpa/inet.h arpa/nameser.h \ netdb.h malloc.h float.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` diff -urN rsync-2.6.1/configure.in rsync-2.6.2/configure.in --- rsync-2.6.1/configure.in 2004-04-26 20:54:05.000000000 -0700 +++ rsync-2.6.2/configure.in 2004-04-30 11:02:43.000000000 -0700 @@ -5,7 +5,7 @@ AC_CONFIG_HEADER(config.h) AC_PREREQ(2.52) -RSYNC_VERSION=2.6.1 +RSYNC_VERSION=2.6.2 AC_SUBST(RSYNC_VERSION) AC_MSG_NOTICE([Configuring rsync $RSYNC_VERSION]) @@ -146,21 +146,26 @@ int main(void) { struct flock lock; - int status; - int fd = open("conftest.dat", O_CREAT|O_RDWR, 0600); + int status; + char tpl[32] = "/tmp/locktest.XXXXXX"; + int fd = mkstemp(tpl); + if (fd < 0) { + strcpy(tpl, "conftest.dat"); + fd = open(tpl, O_CREAT|O_RDWR, 0600); + } + lock.l_type = F_WRLCK; lock.l_whence = SEEK_SET; lock.l_start = 0; lock.l_len = 1; lock.l_pid = 0; - fcntl(fd,F_SETLK,&lock); if (fork() == 0) { - lock.l_start = 1; - exit(fcntl(fd,F_SETLK,&lock) == 0); - } - wait(&status); - unlink("conftest.dat"); + lock.l_start = 1; + _exit(fcntl(fd,F_SETLK,&lock) == 0); + } + wait(&status); + unlink(tpl); exit(WEXITSTATUS(status)); } ], @@ -282,7 +287,7 @@ AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h \ unistd.h utime.h grp.h compat.h sys/param.h ctype.h sys/wait.h \ sys/ioctl.h sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h \ - sys/un.h glob.h mcheck.h sys/sysctl.h arpa/inet.h arpa/nameser.h \ + sys/un.h glob.h mcheck.h arpa/inet.h arpa/nameser.h \ netdb.h malloc.h float.h) AC_HEADER_MAJOR diff -urN rsync-2.6.1/flist.c rsync-2.6.2/flist.c --- rsync-2.6.1/flist.c 2004-04-26 18:36:10.000000000 -0700 +++ rsync-2.6.2/flist.c 2004-04-29 12:37:15.000000000 -0700 @@ -1517,11 +1517,17 @@ if (!(c1 = (uchar*)f1->dirname)) { state1 = fnc_BASE; c1 = (uchar*)f1->basename; + } else if (!*c1) { + state1 = fnc_SLASH; + c1 = (uchar*)"/"; } else state1 = fnc_DIR; if (!(c2 = (uchar*)f2->dirname)) { state2 = fnc_BASE; c2 = (uchar*)f2->basename; + } else if (!*c2) { + state2 = fnc_SLASH; + c2 = (uchar*)"/"; } else state2 = fnc_DIR; diff -urN rsync-2.6.1/log.c rsync-2.6.2/log.c --- rsync-2.6.1/log.c 2004-01-19 21:15:14.000000000 -0800 +++ rsync-2.6.2/log.c 2004-04-29 12:34:31.000000000 -0700 @@ -182,7 +182,8 @@ send_msg((enum msgcode)code, buf, len); return; } - if (io_multiplex_write((enum msgcode)code, buf, len)) + if (!am_daemon + && io_multiplex_write((enum msgcode)code, buf, len)) return; } diff -urN rsync-2.6.1/packaging/lsb/rsync.spec rsync-2.6.2/packaging/lsb/rsync.spec --- rsync-2.6.1/packaging/lsb/rsync.spec 2004-04-26 20:54:05.000000000 -0700 +++ rsync-2.6.2/packaging/lsb/rsync.spec 2004-04-30 11:02:43.000000000 -0700 @@ -1,6 +1,6 @@ Summary: Program for efficient remote updates of files. Name: rsync -Version: 2.6.1 +Version: 2.6.2 Release: 1 Copyright: GPL Group: Applications/Networking diff -urN rsync-2.6.1/patches/fsync.diff rsync-2.6.2/patches/fsync.diff --- rsync-2.6.1/patches/fsync.diff 1969-12-31 16:00:00.000000000 -0800 +++ rsync-2.6.2/patches/fsync.diff 2004-04-27 13:06:00.000000000 -0700 @@ -0,0 +1,85 @@ +This patch from Sami Farin lets you specify --fsync if you want fsync() +to be called on every file we write. + +--- options.c 17 Apr 2004 17:07:23 -0000 1.147 ++++ options.c 27 Apr 2004 20:05:03 -0000 +@@ -37,6 +37,7 @@ int make_backups = 0; + **/ + int whole_file = -1; + ++int do_fsync = 0; + int archive_mode = 0; + int copy_links = 0; + int preserve_links = 0; +@@ -230,6 +231,7 @@ void usage(enum logcode F) + rprintf(F," -b, --backup make backups (see --suffix & --backup-dir)\n"); + rprintf(F," --backup-dir make backups into this directory\n"); + rprintf(F," --suffix=SUFFIX backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX); ++ rprintf(F," --fsync fsync every written file\n"); + rprintf(F," -u, --update update only (don't overwrite newer files)\n"); + rprintf(F," -l, --links copy symlinks as symlinks\n"); + rprintf(F," -L, --copy-links copy the referent of all symlinks\n"); +@@ -332,6 +334,7 @@ static struct poptOption long_options[] + {"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 }, ++ {"fsync", 0, POPT_ARG_NONE, &do_fsync, 0, 0, 0 }, + {"dry-run", 'n', POPT_ARG_NONE, &dry_run, 0, 0, 0 }, + {"sparse", 'S', POPT_ARG_NONE, &sparse_files, 0, 0, 0 }, + {"cvs-exclude", 'C', POPT_ARG_NONE, &cvs_exclude, 0, 0, 0 }, +@@ -943,6 +946,9 @@ void server_options(char **args,int *arg + args[ac++] = "--temp-dir"; + args[ac++] = tmpdir; + } ++ ++ if (do_fsync && am_sender) ++ args[ac++] = "--fsync"; + + if (compare_dest && am_sender) { + /* the server only needs this option if it is not the sender, +--- receiver.c 27 Apr 2004 19:51:33 -0000 1.76 ++++ receiver.c 27 Apr 2004 20:05:03 -0000 +@@ -45,6 +45,7 @@ extern int cleanup_got_literal; + extern int module_id; + extern int ignore_errors; + extern int orig_umask; ++extern int do_fsync; + + static void delete_one(char *fn, int is_dir) + { +@@ -264,6 +265,12 @@ static int receive_data(int f_in,struct + + if (fd != -1 && offset > 0 && sparse_end(fd) != 0) { + rprintf(FERROR, "write failed on %s: %s\n", ++ full_fname(fname), strerror(errno)); ++ exit_cleanup(RERR_FILEIO); ++ } ++ ++ if (do_fsync && (fd != -1) && (fsync(fd) != 0)) { ++ rprintf(FERROR, "fsync failed on %s: %s\n", + full_fname(fname), strerror(errno)); + exit_cleanup(RERR_FILEIO); + } +--- util.c 27 Apr 2004 19:59:37 -0000 1.141 ++++ util.c 27 Apr 2004 20:05:04 -0000 +@@ -29,6 +29,7 @@ + + extern int verbose; + extern struct exclude_list_struct server_exclude_list; ++extern int do_fsync; + + int sanitize_paths = 0; + +@@ -296,6 +297,12 @@ int copy_file(char *source, char *dest, + + if (close(ofd) < 0) { + rprintf(FERROR, "close failed on %s: %s\n", ++ full_fname(dest), strerror(errno)); ++ return -1; ++ } ++ ++ if (do_fsync && fsync(ofd) < 0) { ++ rprintf(FERROR, "fsync failed on %s: %s\n", + full_fname(dest), strerror(errno)); + return -1; + } diff -urN rsync-2.6.1/patches/inplace.diff rsync-2.6.2/patches/inplace.diff --- rsync-2.6.1/patches/inplace.diff 1969-12-31 16:00:00.000000000 -0800 +++ rsync-2.6.2/patches/inplace.diff 2004-04-27 16:40:17.000000000 -0700 @@ -0,0 +1,241 @@ +Patch from Mark Curtis to implement the --inplace option. + +--- match.c 3 Jan 2004 19:28:03 -0000 1.60 ++++ match.c 27 Apr 2004 23:26:09 -0000 +@@ -22,6 +22,7 @@ + extern int verbose; + extern int am_server; + extern int do_progress; ++extern int inplace; + + typedef unsigned short tag; + +@@ -197,6 +198,10 @@ static void hash_search(int f,struct sum + /* also make sure the two blocks are the same length */ + l = MIN((OFF_T)s->blength, len-offset); + if (l != s->sums[i].len) ++ continue; ++ ++ /* if inplace, make sure the offset is greater than where we are */ ++ if (inplace && offset > s->sums[i].offset) + continue; + + if (verbose > 3) +--- options.c 17 Apr 2004 17:07:23 -0000 1.147 ++++ options.c 27 Apr 2004 23:26:10 -0000 +@@ -91,6 +91,7 @@ int ignore_errors = 0; + int modify_window = 0; + int blocking_io = -1; + int checksum_seed = 0; ++int inplace = 0; + unsigned int block_size = 0; + + +@@ -231,6 +232,7 @@ void usage(enum logcode F) + rprintf(F," --backup-dir make backups into this directory\n"); + rprintf(F," --suffix=SUFFIX backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX); + rprintf(F," -u, --update update only (don't overwrite newer files)\n"); ++ rprintf(F," --inplace update the destination file inplace *SEE MAN PAGE*\n"); + rprintf(F," -l, --links copy symlinks as symlinks\n"); + rprintf(F," -L, --copy-links copy the referent of all symlinks\n"); + rprintf(F," --copy-unsafe-links copy the referent of \"unsafe\" symlinks\n"); +@@ -321,6 +323,7 @@ static struct poptOption long_options[] + {"delete", 0, POPT_ARG_NONE, &delete_mode, 0, 0, 0 }, + {"existing", 0, POPT_ARG_NONE, &only_existing, 0, 0, 0 }, + {"ignore-existing", 0, POPT_ARG_NONE, &opt_ignore_existing, 0, 0, 0 }, ++ {"inplace", 0, POPT_ARG_NONE, &inplace, 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 }, +@@ -723,6 +726,9 @@ int parse_arguments(int *argc, const cha + if (do_progress && !verbose) + verbose = 1; + ++ if (inplace && keep_partial) ++ keep_partial = 0; ++ + if (files_from) { + char *colon; + if (*argc != 2 && !(am_server && am_sender && *argc == 1)) { +@@ -938,6 +944,9 @@ void server_options(char **args,int *arg + + if (opt_ignore_existing && am_sender) + args[ac++] = "--ignore-existing"; ++ ++ if (inplace) ++ args[ac++] = "--inplace"; + + if (tmpdir) { + args[ac++] = "--temp-dir"; +--- receiver.c 27 Apr 2004 19:51:33 -0000 1.76 ++++ receiver.c 27 Apr 2004 23:26:10 -0000 +@@ -45,6 +45,7 @@ extern int cleanup_got_literal; + extern int module_id; + extern int ignore_errors; + extern int orig_umask; ++extern int inplace; + + static void delete_one(char *fn, int is_dir) + { +@@ -249,16 +250,28 @@ static int receive_data(int f_in,struct + sum_update(map,len); + } + +- if (fd != -1 && write_file(fd,map,len) != (int) len) { +- rprintf(FERROR, "write failed on %s: %s\n", +- full_fname(fname), strerror(errno)); +- exit_cleanup(RERR_FILEIO); ++ if (!inplace || offset != offset2) { ++ if (fd != -1 && write_file(fd,map,len) != (int) len) { ++ rprintf(FERROR, "write failed on %s: %s\n", ++ full_fname(fname), strerror(errno)); ++ exit_cleanup(RERR_FILEIO); ++ } ++ } else { ++ flush_write_file(fd); ++ if (do_lseek(fd,(OFF_T)len,SEEK_CUR) != offset+len) { ++ rprintf(FERROR, "lseek failed on %s: %s, %lli, %lli, %i\n", ++ full_fname(fname), strerror(errno), do_lseek(fd,0,SEEK_CUR), (offset+len), i); ++ exit_cleanup(RERR_FILEIO); ++ } + } + offset += len; + } + + flush_write_file(fd); + ++ if (inplace) ++ ftruncate(fd, offset); ++ + if (do_progress) + end_progress(total_size); + +@@ -410,37 +423,50 @@ int recv_files(int f_in,struct file_list + } else + mapbuf = NULL; + +- if (!get_tmpname(fnametmp,fname)) { +- if (mapbuf) unmap_file(mapbuf); +- if (fd1 != -1) close(fd1); +- continue; +- } ++ /* We now check to see if we are writing file "inplace" */ ++ if (inplace) { ++ fd2 = do_open(fnamecmp, O_WRONLY|O_CREAT, 0); ++ if (fd2 == -1) { ++ rprintf(FERROR, "open %s failed: %s\n", ++ full_fname(fnametmp), strerror(errno)); ++ receive_data(f_in,mapbuf,-1,NULL,file->length); ++ if (mapbuf) unmap_file(mapbuf); ++ if (fd1 != -1) close(fd1); ++ continue; ++ } ++ } else { ++ if (!get_tmpname(fnametmp,fname)) { ++ if (mapbuf) unmap_file(mapbuf); ++ if (fd1 != -1) close(fd1); ++ continue; ++ } + +- strlcpy(template, fnametmp, sizeof template); ++ strlcpy(template, fnametmp, sizeof template); + +- /* we initially set the perms without the +- * setuid/setgid bits to ensure that there is no race +- * condition. They are then correctly updated after +- * the lchown. Thanks to snabb@epipe.fi for pointing +- * this out. We also set it initially without group +- * access because of a similar race condition. */ +- fd2 = do_mkstemp(fnametmp, file->mode & INITACCESSPERMS); +- +- /* in most cases parent directories will already exist +- * because their information should have been previously +- * transferred, but that may not be the case with -R */ +- if (fd2 == -1 && relative_paths && errno == ENOENT && +- create_directory_path(fnametmp, orig_umask) == 0) { +- strlcpy(fnametmp, template, sizeof fnametmp); ++ /* we initially set the perms without the ++ * setuid/setgid bits to ensure that there is no race ++ * condition. They are then correctly updated after ++ * the lchown. Thanks to snabb@epipe.fi for pointing ++ * this out. We also set it initially without group ++ * access because of a similar race condition. */ + fd2 = do_mkstemp(fnametmp, file->mode & INITACCESSPERMS); +- } +- if (fd2 == -1) { +- rprintf(FERROR, "mkstemp %s failed: %s\n", +- full_fname(fnametmp), strerror(errno)); +- receive_data(f_in,mapbuf,-1,NULL,file->length); +- if (mapbuf) unmap_file(mapbuf); +- if (fd1 != -1) close(fd1); +- continue; ++ ++ /* in most cases parent directories will already exist ++ * because their information should have been previously ++ * transferred, but that may not be the case with -R */ ++ if (fd2 == -1 && relative_paths && errno == ENOENT ++ && create_directory_path(fnametmp, orig_umask) == 0) { ++ strlcpy(fnametmp, template, sizeof fnametmp); ++ fd2 = do_mkstemp(fnametmp, file->mode & INITACCESSPERMS); ++ } ++ if (fd2 == -1) { ++ rprintf(FERROR, "mkstemp %s failed: %s\n", ++ full_fname(fnametmp), strerror(errno)); ++ receive_data(f_in,mapbuf,-1,NULL,file->length); ++ if (mapbuf) unmap_file(mapbuf); ++ if (fd1 != -1) close(fd1); ++ continue; ++ } + } + + cleanup_set(fnametmp, fname, file, mapbuf, fd1, fd2); +--- rsync.c 23 Mar 2004 16:16:15 -0000 1.135 ++++ rsync.c 27 Apr 2004 23:26:11 -0000 +@@ -33,6 +33,7 @@ extern int preserve_uid; + extern int preserve_gid; + extern int preserve_perms; + extern int make_backups; ++extern int inplace; + + + /* +@@ -234,6 +235,11 @@ void finish_transfer(char *fname, char * + + if (make_backups && !make_backup(fname)) + return; ++ ++ if (inplace) { ++ set_perms(fname,file,NULL,0); ++ return; ++ } + + /* move tmp file over real file */ + ret = robust_rename(fnametmp, fname, file->mode & INITACCESSPERMS); +--- rsync.yo 27 Apr 2004 03:55:37 -0000 1.165 ++++ rsync.yo 27 Apr 2004 23:26:12 -0000 +@@ -289,6 +289,7 @@ verb( + --backup-dir make backups into this directory + --suffix=SUFFIX backup suffix (default ~ w/o --backup-dir) + -u, --update update only (don't overwrite newer files) ++ --inplace update the destination file inplace + -l, --links copy symlinks as symlinks + -L, --copy-links copy the referent of all symlinks + --copy-unsafe-links copy the referent of "unsafe" symlinks +@@ -475,6 +476,17 @@ is on the objects. In other words, if t + symlink where the destination has a file, the transfer would occur + regardless of the timestamps. This might change in the future (feel + free to comment on this on the mailing list if you have an opinion). ++ ++dit(bf(--inplace)) This causes rsync not to create a new copy of the file ++and then move it into place. Instead rsync will overwrite the existing ++file, meaning that the rsync algorithm can't extract the full ammount of ++network reduction it might otherwise. ++ ++This option is useful for transfer of large files with block based changes ++and also on systems that are disk bound not network bound. ++ ++WARNING: If the transfer is interrupted, you will have an inconsistent file ++and the transfer should be run again. + + dit(bf(-l, --links)) When symlinks are encountered, recreate the + symlink on the destination. diff -urN rsync-2.6.1/popt/system.h rsync-2.6.2/popt/system.h --- rsync-2.6.1/popt/system.h 2004-04-26 18:36:00.000000000 -0700 +++ rsync-2.6.2/popt/system.h 2004-04-28 10:35:08.000000000 -0700 @@ -19,6 +19,14 @@ #include #endif +#if !defined(__GNUC__) || defined(APPLE) +/* Apparently the OS X port of gcc gags on __attribute__. + * + * */ +#define __attribute__(x) + +#endif + #ifdef __NeXT /* access macros are not declared in non posix mode in unistd.h - don't try to use posix on NeXTstep 3.3 ! */ diff -urN rsync-2.6.1/receiver.c rsync-2.6.2/receiver.c --- rsync-2.6.1/receiver.c 2004-03-23 08:50:40.000000000 -0800 +++ rsync-2.6.2/receiver.c 2004-04-27 12:51:33.000000000 -0700 @@ -458,7 +458,11 @@ if (fd1 != -1) { close(fd1); } - close(fd2); + if (close(fd2) < 0) { + rprintf(FERROR, "close failed on %s: %s\n", + full_fname(fnametmp), strerror(errno)); + exit_cleanup(RERR_FILEIO); + } if (verbose > 2) rprintf(FINFO,"renaming %s to %s\n",fnametmp,fname); diff -urN rsync-2.6.1/rsync.1 rsync-2.6.2/rsync.1 --- rsync-2.6.1/rsync.1 2004-04-26 20:54:11.000000000 -0700 +++ rsync-2.6.2/rsync.1 2004-04-30 11:02:48.000000000 -0700 @@ -1,4 +1,4 @@ -.TH "rsync" "1" "26 Apr 2004" "" "" +.TH "rsync" "1" "30 Apr 2004" "" "" .SH "NAME" rsync \- faster, flexible replacement for rcp .SH "SYNOPSIS" @@ -1200,7 +1200,7 @@ so rsync never visits any of the files in the "some" or "some/path" directories\&. One solution is to ask for all directories in the hierarchy to be included by using a single rule: --include=\&'*/\&' (put it somewhere -before the --excludde=\&'*\&' rule)\&. Another solution is to add specific +before the --exclude=\&'*\&' rule)\&. Another solution is to add specific include rules for all the parent dirs that need to be visited\&. For instance, this set of rules works fine: .PP @@ -1243,7 +1243,7 @@ .SH "BATCH MODE" .PP \fBNote:\fP Batch mode should be considered experimental in this version -of rsync\&. The interface or behaviour may change before it stabilizes\&. +of rsync\&. The interface or behavior may change before it stabilizes\&. .PP Batch mode can be used to apply the same set of updates to many identical systems\&. Suppose one has a tree which is replicated on a @@ -1333,7 +1333,7 @@ .PP .SH "SYMBOLIC LINKS" .PP -Three basic behaviours are possible when rsync encounters a symbolic +Three basic behaviors are possible when rsync encounters a symbolic link in the source directory\&. .PP By default, symbolic links are not transferred at all\&. A message @@ -1404,7 +1404,7 @@ .IP "\fB4\fP" Requested action not supported: an attempt was made to manipulate 64-bit files on a platform that cannot support -them; or an option was specifed that is supported by the client and +them; or an option was specified that is supported by the client and not by the server\&. .IP "\fB5\fP" Error starting client-server protocol @@ -1479,7 +1479,7 @@ .PP times are transferred as unix time_t values .PP -When transferring to FAT filesystems rsync may resync +When transferring to FAT filesystems rsync may re-sync unmodified files\&. See the comments on the --modify-window option\&. .PP diff -urN rsync-2.6.1/rsync.yo rsync-2.6.2/rsync.yo --- rsync-2.6.1/rsync.yo 2004-04-26 20:54:05.000000000 -0700 +++ rsync-2.6.2/rsync.yo 2004-04-30 11:02:43.000000000 -0700 @@ -1,5 +1,5 @@ mailto(rsync-bugs@samba.org) -manpage(rsync)(1)(26 Apr 2004)()() +manpage(rsync)(1)(30 Apr 2004)()() manpagename(rsync)(faster, flexible replacement for rcp) manpagesynopsis() @@ -1035,7 +1035,7 @@ so rsync never visits any of the files in the "some" or "some/path" directories. One solution is to ask for all directories in the hierarchy to be included by using a single rule: --include='*/' (put it somewhere -before the --excludde='*' rule). Another solution is to add specific +before the --exclude='*' rule). Another solution is to add specific include rules for all the parent dirs that need to be visited. For instance, this set of rules works fine: @@ -1067,7 +1067,7 @@ manpagesection(BATCH MODE) bf(Note:) Batch mode should be considered experimental in this version -of rsync. The interface or behaviour may change before it stabilizes. +of rsync. The interface or behavior may change before it stabilizes. Batch mode can be used to apply the same set of updates to many identical systems. Suppose one has a tree which is replicated on a @@ -1149,7 +1149,7 @@ manpagesection(SYMBOLIC LINKS) -Three basic behaviours are possible when rsync encounters a symbolic +Three basic behaviors are possible when rsync encounters a symbolic link in the source directory. By default, symbolic links are not transferred at all. A message @@ -1210,7 +1210,7 @@ dit(bf(3)) Errors selecting input/output files, dirs dit(bf(4)) Requested action not supported: an attempt was made to manipulate 64-bit files on a platform that cannot support -them; or an option was specifed that is supported by the client and +them; or an option was specified that is supported by the client and not by the server. dit(bf(5)) Error starting client-server protocol dit(bf(10)) Error in socket I/O @@ -1270,7 +1270,7 @@ times are transferred as unix time_t values -When transferring to FAT filesystems rsync may resync +When transferring to FAT filesystems rsync may re-sync unmodified files. See the comments on the --modify-window option. diff -urN rsync-2.6.1/rsyncd.conf.5 rsync-2.6.2/rsyncd.conf.5 --- rsync-2.6.1/rsyncd.conf.5 2004-04-26 20:54:14.000000000 -0700 +++ rsync-2.6.2/rsyncd.conf.5 2004-04-30 11:02:50.000000000 -0700 @@ -1,4 +1,4 @@ -.TH "rsyncd\&.conf" "5" "26 Apr 2004" "" "" +.TH "rsyncd\&.conf" "5" "30 Apr 2004" "" "" .SH "NAME" rsyncd\&.conf \- configuration file for rsync server .SH "SYNOPSIS" diff -urN rsync-2.6.1/rsyncd.conf.yo rsync-2.6.2/rsyncd.conf.yo --- rsync-2.6.1/rsyncd.conf.yo 2004-04-26 20:54:05.000000000 -0700 +++ rsync-2.6.2/rsyncd.conf.yo 2004-04-30 11:02:43.000000000 -0700 @@ -1,5 +1,5 @@ mailto(rsync-bugs@samba.org) -manpage(rsyncd.conf)(5)(26 Apr 2004)()() +manpage(rsyncd.conf)(5)(30 Apr 2004)()() manpagename(rsyncd.conf)(configuration file for rsync server) manpagesynopsis() diff -urN rsync-2.6.1/testsuite/merge.test rsync-2.6.2/testsuite/merge.test --- rsync-2.6.1/testsuite/merge.test 2004-02-04 10:24:41.000000000 -0800 +++ rsync-2.6.2/testsuite/merge.test 2004-04-30 10:24:49.000000000 -0700 @@ -43,9 +43,9 @@ cp -p "$from3dir"/sub2/subby "$chkdir"/sub2 # Get rid of any directory-time differences -touch "$fromdir"? "$chkdir" "$fromdir"?/sub? "$chkdir"/sub? +$RSYNC -av --existing --include='*/' --exclude='*' "$from1dir/" "$from2dir/" "$from3dir/" "$chkdir/" -checkit "$RSYNC -aHvv \"$fromdir\"?/ \"$todir/\"" "$chkdir" "$todir" +checkit "$RSYNC -aHvv \"$from1dir/\" \"$from2dir/\" \"$from3dir/\" \"$todir/\"" "$chkdir" "$todir" # The script would have aborted on error, so getting here means we've won. exit 0 diff -urN rsync-2.6.1/uidlist.c rsync-2.6.2/uidlist.c --- rsync-2.6.1/uidlist.c 2004-02-20 09:09:30.000000000 -0800 +++ rsync-2.6.2/uidlist.c 2004-04-28 10:31:31.000000000 -0700 @@ -81,7 +81,7 @@ static int map_uid(int id, char *name) { uid_t uid; - if (uid != 0 && name_to_uid(name, &uid)) + if (id != 0 && name_to_uid(name, &uid)) return uid; return id; } @@ -89,7 +89,7 @@ static int map_gid(int id, char *name) { gid_t gid; - if (gid != 0 && name_to_gid(name, &gid)) + if (id != 0 && name_to_gid(name, &gid)) return gid; return id; } @@ -161,7 +161,7 @@ int id2 = name ? map_uid(id, name) : id; struct idlist *node; - node = add_to_list(&uidlist, id, name, map_uid(id, name)); + node = add_to_list(&uidlist, id, name, id2); if (verbose > 3) { rprintf(FINFO, "uid %d(%s) maps to %d\n", diff -urN rsync-2.6.1/util.c rsync-2.6.2/util.c --- rsync-2.6.1/util.c 2004-04-27 09:43:40.000000000 -0700 +++ rsync-2.6.2/util.c 2004-04-27 12:59:37.000000000 -0700 @@ -253,20 +253,20 @@ ifd = do_open(source, O_RDONLY, 0); if (ifd == -1) { rprintf(FERROR,"open %s: %s\n", - source,strerror(errno)); + full_fname(source), strerror(errno)); return -1; } if (robust_unlink(dest) && errno != ENOENT) { rprintf(FERROR,"unlink %s: %s\n", - dest,strerror(errno)); + full_fname(dest), strerror(errno)); return -1; } ofd = do_open(dest, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, mode); if (ofd == -1) { rprintf(FERROR,"open %s: %s\n", - dest,strerror(errno)); + full_fname(dest), strerror(errno)); close(ifd); return -1; } @@ -274,19 +274,29 @@ while ((len = safe_read(ifd, buf, sizeof buf)) > 0) { if (full_write(ofd, buf, len) < 0) { rprintf(FERROR,"write %s: %s\n", - dest,strerror(errno)); + full_fname(dest), strerror(errno)); close(ifd); close(ofd); return -1; } } - close(ifd); - close(ofd); - if (len < 0) { - rprintf(FERROR,"read %s: %s\n", - source,strerror(errno)); + rprintf(FERROR, "read %s: %s\n", + full_fname(source), strerror(errno)); + close(ifd); + close(ofd); + return -1; + } + + if (close(ifd) < 0) { + rprintf(FINFO, "close failed on %s: %s\n", + full_fname(source), strerror(errno)); + } + + if (close(ofd) < 0) { + rprintf(FERROR, "close failed on %s: %s\n", + full_fname(dest), strerror(errno)); return -1; }