diff -u -r --new-file --exclude=CVS rsync-2.0.16/checksum.c rsync-2.0.17/checksum.c --- rsync-2.0.16/checksum.c Thu May 14 17:07:51 1998 +++ rsync-2.0.17/checksum.c Thu Jun 18 20:30:21 1998 @@ -77,7 +77,7 @@ MDbegin(&MD); - bcopy(buf,buf1,len); + memcpy(buf1,buf,len); if (checksum_seed) { SIVAL(buf1,len,checksum_seed); len += 4; @@ -102,7 +102,7 @@ OFF_T len = size; char tmpchunk[CSUM_CHUNK]; - bzero(sum,csum_length); + memset(sum,0,csum_length); fd = open(fname,O_RDONLY); if (fd == -1) return; @@ -112,12 +112,12 @@ MDbegin(&MD); for(i = 0; i + CSUM_CHUNK <= len; i += CSUM_CHUNK) { - bcopy(map_ptr(buf,i,CSUM_CHUNK),tmpchunk,CSUM_CHUNK); + memcpy(tmpchunk, map_ptr(buf,i,CSUM_CHUNK), CSUM_CHUNK); MDupdate(&MD, tmpchunk, CSUM_CHUNK*8); } if (len - i > 0) { - bcopy(map_ptr(buf,i,len-i),tmpchunk,len-i); + memcpy(tmpchunk, map_ptr(buf,i,len-i), len-i); MDupdate(&MD, tmpchunk, (len-i)*8); } @@ -155,27 +155,27 @@ { int i; if (len + sumresidue < CSUM_CHUNK) { - bcopy(p,sumrbuf+sumresidue,len); + memcpy(sumrbuf+sumresidue, p, len); sumresidue += len; return; } if (sumresidue) { i = MIN(CSUM_CHUNK-sumresidue,len); - bcopy(p,sumrbuf+sumresidue,i); + memcpy(sumrbuf+sumresidue,p,i); MDupdate(&sumMD, sumrbuf, (i+sumresidue)*8); len -= i; p += i; } for(i = 0; i + CSUM_CHUNK <= len; i += CSUM_CHUNK) { - bcopy(p+i,sumrbuf,CSUM_CHUNK); + memcpy(sumrbuf,p+i,CSUM_CHUNK); MDupdate(&sumMD, sumrbuf, CSUM_CHUNK*8); } if (len - i > 0) { sumresidue = len-i; - bcopy(p+i,sumrbuf,sumresidue); + memcpy(sumrbuf,p+i,sumresidue); } else { sumresidue = 0; } diff -u -r --new-file --exclude=CVS rsync-2.0.16/config.h.in rsync-2.0.17/config.h.in --- rsync-2.0.16/config.h.in Wed May 27 23:54:31 1998 +++ rsync-2.0.17/config.h.in Thu Jun 18 20:30:21 1998 @@ -61,12 +61,6 @@ /* The number of bytes in a short. */ #undef SIZEOF_SHORT -/* Define if you have the bcopy function. */ -#undef HAVE_BCOPY - -/* Define if you have the bzero function. */ -#undef HAVE_BZERO - /* Define if you have the chmod function. */ #undef HAVE_CHMOD diff -u -r --new-file --exclude=CVS rsync-2.0.16/configure rsync-2.0.17/configure --- rsync-2.0.16/configure Wed May 27 23:54:31 1998 +++ rsync-2.0.17/configure Thu Jun 18 20:30:21 1998 @@ -1886,7 +1886,7 @@ fi done -for ac_func in fchmod fstat strchr bcopy bzero readlink link utime utimes +for ac_func in fchmod fstat strchr readlink link utime utimes do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:1893: checking for $ac_func" >&5 diff -u -r --new-file --exclude=CVS rsync-2.0.16/configure.in rsync-2.0.17/configure.in --- rsync-2.0.16/configure.in Wed May 27 23:54:31 1998 +++ rsync-2.0.17/configure.in Thu Jun 18 20:30:21 1998 @@ -40,7 +40,7 @@ AC_FUNC_MEMCMP AC_FUNC_UTIME_NULL AC_CHECK_FUNCS(mmap munmap waitpid getcwd strdup strerror chown chmod mknod) -AC_CHECK_FUNCS(fchmod fstat strchr bcopy bzero readlink link utime utimes) +AC_CHECK_FUNCS(fchmod fstat strchr readlink link utime utimes) AC_CHECK_FUNCS(memmove getopt_long lchown setlinebuf vsnprintf setsid glob strpbrk) echo $ac_n "checking for working fnmatch... $ac_c" diff -u -r --new-file --exclude=CVS rsync-2.0.16/cvs.log rsync-2.0.17/cvs.log --- rsync-2.0.16/cvs.log Mon Jun 1 23:49:20 1998 +++ rsync-2.0.17/cvs.log Thu Jun 18 20:30:56 1998 @@ -5418,3 +5418,265 @@ Log Message: preparing for release of 2.0.16 + +**************************************** +Date: Tuesday June 2, 1998 @ 22:46 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv26379 + +Modified Files: + main.c proto.h +Log Message: +added some fflush() calls to make sure the statistics lines are +printed when redirecting output to a file. + + + +**************************************** +Date: Tuesday June 2, 1998 @ 22:50 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv27914 + +Modified Files: + rsync.1 rsync.yo +Log Message: +added note to docs saying that --stats doesn't work unless -v is used + + + +**************************************** +Date: Wednesday June 3, 1998 @ 12:35 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv25470 + +Modified Files: + rsync.c +Log Message: +if the user passes a block size on the command line then don't adapt +the block size. + + + +**************************************** +Date: Wednesday June 3, 1998 @ 12:47 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv27478 + +Modified Files: + match.c +Log Message: +the tag table should be of type int* not tag*. + +This bug resulted in rsync being much less efficient that it could be +for files with more than 64k blocks. With the adaptive block size code +giving a maximum block size of 16k this means that files larger than +1GB were handled very inefficiently. The transfer was still accurate, +just slow. + + + + +**************************************** +Date: Thursday June 18, 1998 @ 19:30 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv26965 + +Modified Files: + rsync.1 rsync.yo rsyncd.conf.5 rsyncd.conf.yo +Log Message: +manpage updates, mostly suggested by Francois + + + +**************************************** +Date: Thursday June 18, 1998 @ 19:31 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv26791 + +Modified Files: + options.c +Log Message: +--help changes suggested by Francois + + + +**************************************** +Date: Thursday June 18, 1998 @ 19:32 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv408 + +Modified Files: + util.c +Log Message: +put set_nonblocking() code back in. + + + + +**************************************** +Date: Thursday June 18, 1998 @ 19:33 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv1367 + +Modified Files: + io.c +Log Message: +handle non-blocking file descriptors for both read and write. Add a +workaround for buggy systems that say there is space to write when +there isn't. + + + + + +**************************************** +Date: Thursday June 18, 1998 @ 19:34 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv1975 + +Modified Files: + main.c +Log Message: +set network file descriptors non-blocking before starting main rsync +algorithm. + + + +**************************************** +Date: Thursday June 18, 1998 @ 19:36 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv160 + +Modified Files: + rsync.c +Log Message: +change the order of chmod and chown calls so that setuid bits don't +get removed by chown calls. + + + +**************************************** +Date: Thursday June 18, 1998 @ 19:37 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv21187 + +Modified Files: + rsync.h +Log Message: +move include of compat.h after other includes. + + + +**************************************** +Date: Thursday June 18, 1998 @ 19:38 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv422 + +Modified Files: + proto.h +Log Message: +prototype updates + + + + +**************************************** +Date: Thursday June 18, 1998 @ 19:52 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv2365 + +Modified Files: + checksum.c config.h.in configure configure.in flist.c hlink.c + loadparm.c rsync.h socket.c +Log Message: +for consistency use memcpy/memset everywhere instead of bcopy/bzero + + + + + +**************************************** +Date: Thursday June 18, 1998 @ 19:52 +Author: tridge + +Update of /data/cvs/rsync/lib +In directory samba:/tmp/cvs-serv1396 + +Modified Files: + compat.c +Log Message: +for consistency use memcpy/memset everywhere instead of bcopy/bzero + + + + + +**************************************** +Date: Thursday June 18, 1998 @ 20:03 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv2539 + +Modified Files: + rsync.c +Log Message: +if as non-root we failed to update the group of a file then don't +print the file name. + + + + + + +**************************************** +Date: Thursday June 18, 1998 @ 20:30 +Author: rsync-bu + +Update of /data/cvs/rsync +In directory samba:/data/people/rsync-bugs/rsync + +Modified Files: + version.h +Log Message: +preparing for release of 2.0.17 + + +**************************************** +Date: Thursday June 18, 1998 @ 20:30 +Author: rsync-bu + +Update of /data/cvs/rsync/packaging/redhat/5.0 +In directory samba:/data/people/rsync-bugs/rsync/packaging/redhat/5.0 + +Modified Files: + rsync.spec +Log Message: +preparing for release of 2.0.17 + diff -u -r --new-file --exclude=CVS rsync-2.0.16/flist.c rsync-2.0.17/flist.c --- rsync-2.0.16/flist.c Mon Jun 1 23:47:37 1998 +++ rsync-2.0.17/flist.c Thu Jun 18 20:30:21 1998 @@ -211,7 +211,7 @@ file = (struct file_struct *)malloc(sizeof(*file)); if (!file) out_of_memory("receive_file_entry"); - bzero((char *)file,sizeof(*file)); + memset((char *)file, 0, sizeof(*file)); (*fptr) = file; if (l2 >= MAXPATHLEN-l1) overflow("receive_file_entry"); @@ -325,7 +325,7 @@ clean_fname(cleaned_name); fname = cleaned_name; - bzero(sum,SUM_LENGTH); + memset(sum,0,SUM_LENGTH); if (link_stat(fname,&st) != 0) { io_error = 1; @@ -352,7 +352,7 @@ file = (struct file_struct *)malloc(sizeof(*file)); if (!file) out_of_memory("make_file"); - bzero((char *)file,sizeof(*file)); + memset((char *)file,0,sizeof(*file)); if ((p = strrchr(fname,'/'))) { static char *lastdir; @@ -794,7 +794,7 @@ if (file->basename) free(file->basename); if (file->link) free(file->link); if (file->sum) free(file->sum); - bzero((char *)file, sizeof(*file)); + memset((char *)file, 0, sizeof(*file)); } @@ -808,9 +808,9 @@ free_file(flist->files[i]); free(flist->files[i]); } - bzero((char *)flist->files, sizeof(flist->files[0])*flist->count); + memset((char *)flist->files, 0, sizeof(flist->files[0])*flist->count); free(flist->files); - bzero((char *)flist, sizeof(*flist)); + memset((char *)flist, 0, sizeof(*flist)); free(flist); } diff -u -r --new-file --exclude=CVS rsync-2.0.16/hlink.c rsync-2.0.17/hlink.c --- rsync-2.0.16/hlink.c Thu May 14 17:07:51 1998 +++ rsync-2.0.17/hlink.c Thu Jun 18 20:30:21 1998 @@ -56,7 +56,7 @@ out_of_memory("init_hard_links"); for (i = 0; i < flist->count; i++) - bcopy(flist->files[i], &hlink_list[i], sizeof(hlink_list[0])); + memcpy(&hlink_list[i], flist->files[i], sizeof(hlink_list[0])); qsort(hlink_list,flist->count, sizeof(hlink_list[0]), diff -u -r --new-file --exclude=CVS rsync-2.0.16/io.c rsync-2.0.17/io.c --- rsync-2.0.16/io.c Mon Jun 1 23:47:37 1998 +++ rsync-2.0.17/io.c Thu Jun 18 20:30:21 1998 @@ -108,6 +108,15 @@ continue; } + if (n == -1 && + (errno == EAGAIN || errno == EWOULDBLOCK)) { + /* this shouldn't happen, if it does then + sleep for a short time to prevent us + chewing too much CPU */ + u_sleep(100); + continue; + } + if (n == 0) { if (eof_error) { rprintf(FERROR,"EOF in read_timeout\n"); @@ -344,6 +353,15 @@ int ret = write(fd,buf+total,len-total); if (ret == -1 && errno == EINTR) { + continue; + } + + if (ret == -1 && + (errno == EAGAIN || errno == EWOULDBLOCK)) { + /* this shouldn't happen, if it does then + sleep for a short time to prevent us + chewing too much CPU */ + u_sleep(100); continue; } diff -u -r --new-file --exclude=CVS rsync-2.0.16/lib/compat.c rsync-2.0.17/lib/compat.c --- rsync-2.0.16/lib/compat.c Wed May 27 23:54:35 1998 +++ rsync-2.0.17/lib/compat.c Thu Jun 18 20:30:23 1998 @@ -54,7 +54,7 @@ #ifndef HAVE_MEMMOVE void *memmove(void *dest, const void *src, size_t n) { - bcopy(src, dest, n); + memcpy(dest, src, n); return dest; } #endif diff -u -r --new-file --exclude=CVS rsync-2.0.16/loadparm.c rsync-2.0.17/loadparm.c --- rsync-2.0.16/loadparm.c Fri May 29 12:29:12 1998 +++ rsync-2.0.17/loadparm.c Thu Jun 18 20:30:21 1998 @@ -329,7 +329,7 @@ ***************************************************************************/ static void init_service(service *pservice) { - bzero((char *)pservice,sizeof(service)); + memset((char *)pservice,0,sizeof(service)); copy_service(pservice,&sDefault); } diff -u -r --new-file --exclude=CVS rsync-2.0.16/main.c rsync-2.0.17/main.c --- rsync-2.0.16/main.c Mon Jun 1 23:47:37 1998 +++ rsync-2.0.17/main.c Thu Jun 18 20:30:22 1998 @@ -88,6 +88,9 @@ printf("total size is %.0f speedup is %.2f\n", (double)stats.total_size, (1.0*stats.total_size)/(stats.total_written+stats.total_read)); + + fflush(stdout); + fflush(stderr); } @@ -247,6 +250,10 @@ exit_cleanup(0); } + set_nonblocking(f_out); + if (f_in != f_out) + set_nonblocking(f_in); + send_files(flist,f_out,f_in); report(f_out); io_flush(); @@ -275,6 +282,8 @@ close(recv_pipe[0]); if (f_in != f_out) close(f_out); + set_nonblocking(f_in); + recv_files(f_in,flist,local_name,recv_pipe[1]); report(f_in); @@ -288,6 +297,9 @@ close(recv_pipe[1]); io_close_input(f_in); if (f_in != f_out) close(f_in); + + set_nonblocking(f_out); + generate_files(f_out,flist,local_name,recv_pipe[0]); io_flush(); @@ -378,6 +390,11 @@ flist = send_file_list(f_out,argc,argv); if (verbose > 3) rprintf(FINFO,"file list sent\n"); + + set_nonblocking(f_out); + if (f_in != f_out) + set_nonblocking(f_in); + send_files(flist,f_out,f_in); if (pid != -1) { if (verbose > 3) @@ -412,13 +429,13 @@ } -int start_client(int argc, char *argv[]) +static int start_client(int argc, char *argv[]) { char *p; char *shell_machine = NULL; char *shell_path = NULL; char *shell_user = NULL; - int pid; + int pid, ret; int f_in,f_out; extern int local_server; extern int am_sender; @@ -499,7 +516,12 @@ setlinebuf(stderr); #endif - return client_run(f_in, f_out, pid, argc, argv); + ret = client_run(f_in, f_out, pid, argc, argv); + + fflush(stdout); + fflush(stderr); + + return ret; } diff -u -r --new-file --exclude=CVS rsync-2.0.16/match.c rsync-2.0.17/match.c --- rsync-2.0.16/match.c Mon Jun 1 23:47:38 1998 +++ rsync-2.0.17/match.c Thu Jun 18 20:30:22 1998 @@ -29,7 +29,7 @@ typedef unsigned short tag; #define TABLESIZE (1<<16) -#define NULL_TAG ((tag)-1) +#define NULL_TAG (-1) static int false_alarms; static int tag_hits; @@ -49,7 +49,7 @@ static struct target *targets; -static tag *tag_table; +static int *tag_table; #define gettag2(s1,s2) (((s1) + (s2)) & 0xFFFF) #define gettag(sum) gettag2((sum)&0xFFFF,(sum)>>16) @@ -65,7 +65,7 @@ int i; if (!tag_table) - tag_table = (tag *)malloc(sizeof(tag)*TABLESIZE); + tag_table = (int *)malloc(sizeof(tag_table[0])*TABLESIZE); targets = (struct target *)malloc(sizeof(targets[0])*s->count); if (!tag_table || !targets) diff -u -r --new-file --exclude=CVS rsync-2.0.16/options.c rsync-2.0.17/options.c --- rsync-2.0.16/options.c Mon Jun 1 23:47:38 1998 +++ rsync-2.0.17/options.c Thu Jun 18 20:30:22 1998 @@ -75,52 +75,56 @@ { rprintf(F,"rsync version %s Copyright Andrew Tridgell and Paul Mackerras\n\n", VERSION); - rprintf(F,"Usage:\t%s [options] src user@host:dest\n",RSYNC_NAME); - rprintf(F,"OR\t%s [options] user@host:src dest\n",RSYNC_NAME); - rprintf(F,"OR\t%s [options] src dest\n",RSYNC_NAME); - rprintf(F,"OR\t%s [options] user@host::src dest\n",RSYNC_NAME); - rprintf(F,"OR\t%s [options] src user@host::dest\n",RSYNC_NAME); - rprintf(F,"\nOptions:\n"); - rprintf(F,"-v, --verbose increase verbosity\n"); - rprintf(F,"-c, --checksum always checksum\n"); - rprintf(F,"-a, --archive archive mode\n"); - rprintf(F,"-r, --recursive recurse into directories\n"); - rprintf(F,"-R, --relative use relative path names\n"); - rprintf(F,"-b, --backup make backups (default ~ extension)\n"); - rprintf(F,"-u, --update update only (don't overwrite newer files)\n"); - rprintf(F,"-l, --links preserve soft links\n"); - rprintf(F,"-L, --copy-links treat soft links like regular files\n"); - rprintf(F,"-H, --hard-links preserve hard links\n"); - rprintf(F,"-p, --perms preserve permissions\n"); - rprintf(F,"-o, --owner preserve owner (root only)\n"); - 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"); - rprintf(F,"-x, --one-file-system don't cross filesystem boundaries\n"); - rprintf(F,"-B, --block-size SIZE checksum blocking size\n"); - rprintf(F,"-e, --rsh COMMAND specify rsh replacement\n"); - rprintf(F," --rsync-path PATH specify path to rsync on the remote machine\n"); - rprintf(F,"-C, --cvs-exclude auto ignore files in the same way CVS does\n"); - rprintf(F," --delete delete files that don't exist on the sending side\n"); - rprintf(F," --force force deletion of directories even if not empty\n"); - rprintf(F," --numeric-ids don't map uid/gid values by user/group name\n"); - rprintf(F," --timeout TIME set IO timeout in seconds\n"); - rprintf(F,"-I, --ignore-times don't exclude files that match length and time\n"); - rprintf(F,"-T --temp-dir DIR create temporary files in directory DIR\n"); - rprintf(F,"-z, --compress compress file data\n"); - rprintf(F," --exclude FILE exclude file FILE\n"); - rprintf(F," --exclude-from FILE exclude files listed in FILE\n"); - rprintf(F," --include FILE don't exclude file FILE\n"); - rprintf(F," --include-from FILE don't exclude files listed in FILE\n"); - rprintf(F," --suffix SUFFIX override backup suffix\n"); - rprintf(F," --version print version number\n"); - rprintf(F," --daemon run as a rsync daemon\n"); - rprintf(F," --config FILE specify alternate rsyncd.conf file\n"); - rprintf(F," --port PORT specify alternate rsyncd port number\n"); - rprintf(F," --stats give some file transfer stats\n"); + + rprintf(F,"rsync is a file transfer program capable of efficient remote update\nvia a fast differencing algorithm.\n\n"); + + rprintf(F,"Usage: rsync [OPTION]... SRC [USER@]HOST:DEST\n"); + rprintf(F," or rsync [OPTION]... [USER@]HOST:SRC DEST\n"); + rprintf(F," or rsync [OPTION]... SRC DEST\n"); + rprintf(F," or rsync [OPTION]... [USER@]HOST::SRC DEST\n"); + rprintf(F," or rsync [OPTION]... SRC [USER@]HOST::DEST\n"); + rprintf(F,"\nOptions\n"); + rprintf(F," -v, --verbose increase verbosity\n"); + rprintf(F," -c, --checksum always checksum\n"); + rprintf(F," -a, --archive archive mode\n"); + rprintf(F," -r, --recursive recurse into directories\n"); + rprintf(F," -R, --relative use relative path names\n"); + rprintf(F," -b, --backup make backups (default ~ extension)\n"); + rprintf(F," -u, --update update only (don't overwrite newer files)\n"); + rprintf(F," -l, --links preserve soft links\n"); + rprintf(F," -L, --copy-links treat soft links like regular files\n"); + rprintf(F," -H, --hard-links preserve hard links\n"); + rprintf(F," -p, --perms preserve permissions\n"); + rprintf(F," -o, --owner preserve owner (root only)\n"); + 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"); + rprintf(F," -x, --one-file-system don't cross filesystem boundaries\n"); + rprintf(F," -B, --block-size=SIZE checksum blocking size\n"); + rprintf(F," -e, --rsh=COMMAND specify rsh replacement\n"); + rprintf(F," --rsync-path=PATH specify path to rsync on the remote machine\n"); + rprintf(F," -C, --cvs-exclude auto ignore files in the same way CVS does\n"); + rprintf(F," --delete delete files that don't exist on the sending side\n"); + rprintf(F," --force force deletion of directories even if not empty\n"); + rprintf(F," --numeric-ids don't map uid/gid values by user/group name\n"); + rprintf(F," --timeout=TIME set IO timeout in seconds\n"); + rprintf(F," -I, --ignore-times don't exclude files that match length and time\n"); + rprintf(F," -T --temp-dir=DIR create temporary files in directory DIR\n"); + rprintf(F," -z, --compress compress file data\n"); + rprintf(F," --exclude=PATTERN exclude file FILE\n"); + rprintf(F," --exclude-from=PATTERN exclude files listed in FILE\n"); + rprintf(F," --include=PATTERN don't exclude file FILE\n"); + rprintf(F," --include-from=PATTERN don't exclude files listed in FILE\n"); + rprintf(F," --suffix=SUFFIX override backup suffix\n"); + rprintf(F," --version print version number\n"); + rprintf(F," --daemon run as a rsync daemon\n"); + rprintf(F," --config=FILE specify alternate rsyncd.conf file\n"); + rprintf(F," --port=PORT specify alternate rsyncd port number\n"); + rprintf(F," --stats give some file transfer stats\n"); + rprintf(F," -h, --help show this help screen\n"); rprintf(F,"\n"); rprintf(F,"the backup suffix defaults to %s\n",BACKUP_SUFFIX); @@ -194,8 +198,9 @@ switch (opt) { case OPT_VERSION: - printf("rsync version %s protocol version %d\n", + printf("rsync version %s protocol version %d\n\n", VERSION,PROTOCOL_VERSION); + printf("Written by Andrew Tridgell and Paul Mackerras\n"); exit_cleanup(0); case OPT_SUFFIX: diff -u -r --new-file --exclude=CVS rsync-2.0.16/packaging/redhat/5.0/rsync.spec rsync-2.0.17/packaging/redhat/5.0/rsync.spec --- rsync-2.0.16/packaging/redhat/5.0/rsync.spec Mon Jun 1 23:49:11 1998 +++ rsync-2.0.17/packaging/redhat/5.0/rsync.spec Thu Jun 18 20:30:46 1998 @@ -1,10 +1,10 @@ Summary: Program for efficient remote updates of files. Name: rsync -Version: 2.0.16 +Version: 2.0.17 Release: 1 Copyright: GPL Group: Applications/Networking -Source: ftp://samba.anu.edu.au/pub/rsync/rsync-2.0.16.tar.gz +Source: ftp://samba.anu.edu.au/pub/rsync/rsync-2.0.17.tar.gz URL: http://samba.anu.edu.au/rsync/ Packager: Andrew Tridgell BuildRoot: /tmp/rsync diff -u -r --new-file --exclude=CVS rsync-2.0.16/proto.h rsync-2.0.17/proto.h --- rsync-2.0.16/proto.h Mon Jun 1 23:47:38 1998 +++ rsync-2.0.17/proto.h Thu Jun 18 20:30:22 1998 @@ -90,7 +90,6 @@ void rflush(int fd); void start_server(int f_in, int f_out, int argc, char *argv[]); int client_run(int f_in, int f_out, int pid, int argc, char *argv[]); -int start_client(int argc, char *argv[]); int main(int argc,char *argv[]); void match_sums(int f,struct sum_struct *s,struct map_struct *buf,OFF_T len); void match_report(void); @@ -139,14 +138,13 @@ void add_gid(gid_t gid); void send_uid_list(int f); void recv_uid_list(int f, struct file_list *flist); -int num_waiting(int fd); +int set_nonblocking(int fd); int piped_child(char **command,int *f_in,int *f_out); int local_child(int argc, char **argv,int *f_in,int *f_out); void out_of_memory(char *str); void overflow(char *str); int set_modtime(char *fname,time_t modtime); int create_directory_path(char *fname); -int full_write(int desc, char *ptr, int len); int safe_read(int desc, char *ptr, int len); int copy_file(char *source, char *dest, mode_t mode); void u_sleep(int usec); diff -u -r --new-file --exclude=CVS rsync-2.0.16/rsync.1 rsync-2.0.17/rsync.1 --- rsync-2.0.16/rsync.1 Mon Jun 1 23:47:38 1998 +++ rsync-2.0.17/rsync.1 Thu Jun 18 20:30:22 1998 @@ -457,7 +457,7 @@ rsync is a very strong 16 byte MD4 checksum\&. In most cases you will find that a truncated version of this checksum is quite efficient, and this will decrease the size of the checksum data sent over the link, -making things faster\&. +making things faster\&. .IP You can choose the number of bytes in the truncated checksum using the --csum-length option\&. Any value less than or equal to 16 is valid\&. @@ -467,6 +467,11 @@ microscopic and can be safely ignored (the universe will probably end before it fails) but with smaller values the risk is higher\&. .IP +Current versions of rsync actually use an adaptive algorithm for the +checksum length by default, using a 16 byte file checksum to determine +if a 2nd pass is required with a longer block checksum\&. Only use this +option if you have read the source code and know what you are doing\&. +.IP .IP "\fB-T, --temp-dir DIR\fP" This options instructs rsync to use DIR as a scratch directory when creating a temporary copies of the files @@ -497,10 +502,10 @@ If a user or group name does not exist on the destination system then the numeric id from the source system is used instead\&. .IP -.IP "\fB--timeout\fP" -This option allows you to set a maximum IO timeout in -seconds\&. If no data is transferred for the specified time then rsync -will exit\&. The default is 0, which means no timeout\&. +.IP "\fB--timeout=TIMEOUT\fP" +This option allows you to set a maximum IO +timeout in seconds\&. If no data is transferred for the specified time +then rsync will exit\&. The default is 0, which means no timeout\&. .IP .IP "\fB--daemon\fP" This tells rsync that it is to run as a rsync @@ -523,7 +528,8 @@ .IP "\fB--stats\fP" This tells rsync to print a verbose set of statistics on the file transfer, allowing you to tell how effective the rsync -algorithm is for your data\&. +algorithm is for your data\&. This option only works in conjunction with +the -v (verbose) option\&. .IP .PP .SH "EXCLUDE PATTERNS" @@ -573,6 +579,10 @@ if the pattern starts with "- " (a minus followed by a space) then it is always considered a exclude pattern, even if specified as part of an include option\&. The "- " part is discarded before matching\&. +.IP +.IP o +if the pattern is a single exclamation mark ! then the current +exclude list is reset, removing all previous exclude patterns\&. .PP The +/- rules are most useful in exclude lists, allowing you to have a single exclude list that contains both include and exclude options\&. @@ -588,6 +598,34 @@ .IP o --include "*/" --include "*\&.c" --exclude "*" would include all directories and C source files\&. +.PP +.SH "ENVIRONMENT VARIABLES" +.PP +.IP +.IP "\fBCVSIGNORE\fP" +The CVSIGNORE environment variable supplements any +ignore patterns in \&.cvsignore files\&. See the --cvs-exclude option for +more details\&. +.IP +.IP "\fBRSYNC_RSH\fP" +The RSYNC_RSH environment variable allows you to +override the default shell used as the transport for rsync\&. This can +be used instead of the -e option\&. +.IP +.IP "\fBRSYNC_PASSWORD\fP" +Setting RSYNC_PASSWORD to the required +password allows you to run authenticated rsync connections to a rsync +daemon without user intervention\&. Note that this does not supply a +password to a shell transport such as ssh\&. +.IP +.IP "\fBUSER\fP or \fBLOGNAME\fP" +The USER or LOGNAME environment variables +are used to determine the default username sent to a rsync server\&. +.IP +.IP "\fBHOME\fP" +The HOME environment variable is used to find the users +default \&.cvsignore file\&. +.IP .PP .SH "FILES" .PP diff -u -r --new-file --exclude=CVS rsync-2.0.16/rsync.c rsync-2.0.17/rsync.c --- rsync-2.0.16/rsync.c Mon Jun 1 23:47:38 1998 +++ rsync-2.0.17/rsync.c Thu Jun 18 20:30:22 1998 @@ -267,65 +267,67 @@ static int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st, int report) { - int updated = 0; - STRUCT_STAT st2; - extern int am_daemon; - - if (dry_run) return 0; - - if (!st) { - if (link_stat(fname,&st2) != 0) { - rprintf(FERROR,"stat %s : %s\n",fname,strerror(errno)); - return 0; - } - st = &st2; - } - - if (preserve_times && !S_ISLNK(st->st_mode) && - st->st_mtime != file->modtime) { - updated = 1; - if (set_modtime(fname,file->modtime) != 0) { - rprintf(FERROR,"failed to set times on %s : %s\n", - fname,strerror(errno)); - return 0; - } - } + int updated = 0; + STRUCT_STAT st2; + extern int am_daemon; + + if (dry_run) return 0; + + if (!st) { + if (link_stat(fname,&st2) != 0) { + rprintf(FERROR,"stat %s : %s\n",fname,strerror(errno)); + return 0; + } + st = &st2; + } + + if (preserve_times && !S_ISLNK(st->st_mode) && + st->st_mtime != file->modtime) { + updated = 1; + if (set_modtime(fname,file->modtime) != 0) { + rprintf(FERROR,"failed to set times on %s : %s\n", + fname,strerror(errno)); + return 0; + } + } + + if ((am_root || !am_daemon) && + ((am_root && preserve_uid && st->st_uid != file->uid) || + (preserve_gid && st->st_gid != file->gid))) { + if (do_lchown(fname, + (am_root&&preserve_uid)?file->uid:-1, + preserve_gid?file->gid:-1) != 0) { + if (preserve_uid && st->st_uid != file->uid) + updated = 1; + if (verbose>1 || preserve_uid) { + rprintf(FERROR,"chown %s : %s\n", + fname,strerror(errno)); + return 0; + } + } else { + updated = 1; + } + } #ifdef HAVE_CHMOD - if (preserve_perms && !S_ISLNK(st->st_mode) && - st->st_mode != file->mode) { - updated = 1; - if (do_chmod(fname,file->mode) != 0) { - rprintf(FERROR,"failed to set permissions on %s : %s\n", - fname,strerror(errno)); - return 0; - } - } + if (preserve_perms && !S_ISLNK(st->st_mode) && + st->st_mode != file->mode) { + updated = 1; + if (do_chmod(fname,file->mode) != 0) { + rprintf(FERROR,"failed to set permissions on %s : %s\n", + fname,strerror(errno)); + return 0; + } + } #endif - - if ((am_root || !am_daemon) && - ((am_root && preserve_uid && st->st_uid != file->uid) || - (preserve_gid && st->st_gid != file->gid))) { - if (do_lchown(fname, - (am_root&&preserve_uid)?file->uid:-1, - preserve_gid?file->gid:-1) != 0) { - if (preserve_uid && st->st_uid != file->uid) - updated = 1; - if (verbose>1 || preserve_uid) - rprintf(FERROR,"chown %s : %s\n", - fname,strerror(errno)); - return updated; - } - updated = 1; - } - if (verbose > 1 && report) { - if (updated) - rprintf(FINFO,"%s\n",fname); - else - rprintf(FINFO,"%s is uptodate\n",fname); - } - return updated; + if (verbose > 1 && report) { + if (updated) + rprintf(FINFO,"%s\n",fname); + else + rprintf(FINFO,"%s is uptodate\n",fname); + } + return updated; } @@ -356,7 +358,11 @@ /* use a larger block size for really big files */ int adapt_block_size(struct file_struct *file, int bsize) { - int ret = file->length / (10000); /* rough heuristic */ + int ret; + + if (bsize != BLOCK_SIZE) return bsize; + + ret = file->length / (10000); /* rough heuristic */ ret = ret & ~15; /* multiple of 16 */ if (ret < bsize) ret = bsize; if (ret > CHUNK_SIZE/2) ret = CHUNK_SIZE/2; diff -u -r --new-file --exclude=CVS rsync-2.0.16/rsync.h rsync-2.0.17/rsync.h --- rsync-2.0.16/rsync.h Mon Jun 1 23:47:38 1998 +++ rsync-2.0.17/rsync.h Thu Jun 18 20:30:22 1998 @@ -91,10 +91,6 @@ #include #endif -#ifdef HAVE_COMPAT_H -#include -#endif - #ifdef HAVE_MALLOC_H #include #endif @@ -187,6 +183,26 @@ #include #include +#if HAVE_DIRENT_H +# include +#else +# define dirent direct +# if HAVE_SYS_NDIR_H +# include +# endif +# if HAVE_SYS_DIR_H +# include +# endif +# if HAVE_NDIR_H +# include +# endif +#endif + +#ifdef HAVE_COMPAT_H +#include +#endif + + #ifndef S_IFLNK #define S_IFLNK 0120000 #endif @@ -338,21 +354,6 @@ return i; } -#if HAVE_DIRENT_H -# include -#else -# define dirent direct -# if HAVE_SYS_NDIR_H -# include -# endif -# if HAVE_SYS_DIR_H -# include -# endif -# if HAVE_NDIR_H -# include -# endif -#endif - #include "byteorder.h" #include "version.h" #include "proto.h" @@ -370,14 +371,6 @@ #ifndef HAVE_ERRNO_DECL extern int errno; -#endif - -#ifndef HAVE_BCOPY -#define bcopy(src,dest,n) memcpy(dest,src,n) -#endif - -#ifndef HAVE_BZERO -#define bzero(buf,n) memset(buf,0,n) #endif #define SUPPORT_LINKS HAVE_READLINK diff -u -r --new-file --exclude=CVS rsync-2.0.16/rsync.yo rsync-2.0.17/rsync.yo --- rsync-2.0.16/rsync.yo Mon Jun 1 23:47:38 1998 +++ rsync-2.0.17/rsync.yo Thu Jun 18 20:30:22 1998 @@ -388,7 +388,7 @@ rsync is a very strong 16 byte MD4 checksum. In most cases you will find that a truncated version of this checksum is quite efficient, and this will decrease the size of the checksum data sent over the link, -making things faster. +making things faster. You can choose the number of bytes in the truncated checksum using the --csum-length option. Any value less than or equal to 16 is valid. @@ -398,6 +398,11 @@ microscopic and can be safely ignored (the universe will probably end before it fails) but with smaller values the risk is higher. +Current versions of rsync actually use an adaptive algorithm for the +checksum length by default, using a 16 byte file checksum to determine +if a 2nd pass is required with a longer block checksum. Only use this +option if you have read the source code and know what you are doing. + dit(bf(-T, --temp-dir DIR)) This options instructs rsync to use DIR as a scratch directory when creating a temporary copies of the files transferred on the receiving side. The default behavior is to create @@ -425,9 +430,9 @@ If a user or group name does not exist on the destination system then the numeric id from the source system is used instead. -dit(bf(--timeout)) This option allows you to set a maximum IO timeout in -seconds. If no data is transferred for the specified time then rsync -will exit. The default is 0, which means no timeout. +dit(bf(--timeout=TIMEOUT)) This option allows you to set a maximum IO +timeout in seconds. If no data is transferred for the specified time +then rsync will exit. The default is 0, which means no timeout. dit(bf(--daemon)) This tells rsync that it is to run as a rsync daemon. If standard input is a socket then rsync will assume that it @@ -446,7 +451,8 @@ dit(bf(--stats)) This tells rsync to print a verbose set of statistics on the file transfer, allowing you to tell how effective the rsync -algorithm is for your data. +algorithm is for your data. This option only works in conjunction with +the -v (verbose) option. enddit() @@ -492,6 +498,9 @@ it() if the pattern starts with "- " (a minus followed by a space) then it is always considered a exclude pattern, even if specified as part of an include option. The "- " part is discarded before matching. + + it() if the pattern is a single exclamation mark ! then the current + exclude list is reset, removing all previous exclude patterns. ) The +/- rules are most useful in exclude lists, allowing you to have a @@ -506,6 +515,31 @@ it() --include "*/" --include "*.c" --exclude "*" would include all directories and C source files. ) + +manpagesection(ENVIRONMENT VARIABLES) + +startdit() + +dit(bf(CVSIGNORE)) The CVSIGNORE environment variable supplements any +ignore patterns in .cvsignore files. See the --cvs-exclude option for +more details. + +dit(bf(RSYNC_RSH)) The RSYNC_RSH environment variable allows you to +override the default shell used as the transport for rsync. This can +be used instead of the -e option. + +dit(bf(RSYNC_PASSWORD)) Setting RSYNC_PASSWORD to the required +password allows you to run authenticated rsync connections to a rsync +daemon without user intervention. Note that this does not supply a +password to a shell transport such as ssh. + +dit(bf(USER) or bf(LOGNAME)) The USER or LOGNAME environment variables +are used to determine the default username sent to a rsync server. + +dit(bf(HOME)) The HOME environment variable is used to find the users +default .cvsignore file. + +enddit() manpagefiles() diff -u -r --new-file --exclude=CVS rsync-2.0.16/rsyncd.conf.5 rsync-2.0.17/rsyncd.conf.5 --- rsync-2.0.16/rsyncd.conf.5 Sat May 16 00:10:48 1998 +++ rsync-2.0.17/rsyncd.conf.5 Thu Jun 18 20:30:22 1998 @@ -244,7 +244,7 @@ .IP The default is no "hosts allow" option, which means all hosts can connect\&. .IP -.IP "\fBhosts allow\fP" +.IP "\fBhosts deny\fP" The "hosts deny" option allows you to specify a list of patterns that are matched against a connecting clients hostname and IP address\&. If the pattern matches then the connection is diff -u -r --new-file --exclude=CVS rsync-2.0.16/rsyncd.conf.yo rsync-2.0.17/rsyncd.conf.yo --- rsync-2.0.16/rsyncd.conf.yo Sat May 16 00:10:48 1998 +++ rsync-2.0.17/rsyncd.conf.yo Thu Jun 18 20:30:22 1998 @@ -225,7 +225,7 @@ The default is no "hosts allow" option, which means all hosts can connect. -dit(bf(hosts allow)) The "hosts deny" option allows you to specify a +dit(bf(hosts deny)) The "hosts deny" option allows you to specify a list of patterns that are matched against a connecting clients hostname and IP address. If the pattern matches then the connection is rejected. See the "hosts allow" option for more information. diff -u -r --new-file --exclude=CVS rsync-2.0.16/socket.c rsync-2.0.17/socket.c --- rsync-2.0.16/socket.c Fri May 22 23:45:41 1998 +++ rsync-2.0.17/socket.c Thu Jun 18 20:30:22 1998 @@ -81,7 +81,7 @@ return -1; } - bzero((char *)&sock,sizeof(sock)); + memset((char *)&sock,0,sizeof(sock)); memcpy((char *)&sock.sin_addr,(char *)hp->h_addr, hp->h_length); sock.sin_port = htons(port); sock.sin_family = hp->h_addrtype; diff -u -r --new-file --exclude=CVS rsync-2.0.16/util.c rsync-2.0.17/util.c --- rsync-2.0.16/util.c Mon Jun 1 23:47:38 1998 +++ rsync-2.0.17/util.c Thu Jun 18 20:30:22 1998 @@ -24,15 +24,33 @@ */ #include "rsync.h" -int num_waiting(int fd) +/**************************************************************************** +Set a fd into nonblocking mode. Uses POSIX O_NONBLOCK if available, +else +if SYSV use O_NDELAY +if BSD use FNDELAY +****************************************************************************/ +int set_nonblocking(int fd) { - int len=0; - ioctl(fd,FIONREAD,&len); - return(len); + int val; +#ifdef O_NONBLOCK +#define FLAG_TO_SET O_NONBLOCK +#else +#ifdef SYSV +#define FLAG_TO_SET O_NDELAY +#else /* BSD */ +#define FLAG_TO_SET FNDELAY +#endif +#endif + + if((val = fcntl(fd, F_GETFL, 0)) == -1) + return -1; + val |= FLAG_TO_SET; + return fcntl( fd, F_SETFL, val); +#undef FLAG_TO_SET } - /* this is taken from CVS */ int piped_child(char **command,int *f_in,int *f_out) { @@ -206,7 +224,7 @@ derived from GNU C's cccp.c. */ -int full_write(int desc, char *ptr, int len) +static int full_write(int desc, char *ptr, int len) { int total_written; diff -u -r --new-file --exclude=CVS rsync-2.0.16/version.h rsync-2.0.17/version.h --- rsync-2.0.16/version.h Mon Jun 1 23:49:10 1998 +++ rsync-2.0.17/version.h Thu Jun 18 20:30:45 1998 @@ -1 +1 @@ -#define VERSION "2.0.16" +#define VERSION "2.0.17"