diff -u -r --new-file --exclude=CVS rsync-2.0.11/clientserver.c rsync-2.0.12/clientserver.c --- rsync-2.0.11/clientserver.c Mon May 18 20:30:43 1998 +++ rsync-2.0.12/clientserver.c Wed May 27 00:43:42 1998 @@ -121,6 +121,7 @@ char *request=NULL; extern int am_sender; extern int remote_version; + extern int am_root; if (!allow_access(addr, host, lp_hosts_allow(i), lp_hosts_deny(i))) { rprintf(FERROR,"rsync denied on module %s from %s (%s)\n", @@ -203,6 +204,8 @@ io_printf(fd,"@ERROR: setuid failed\n"); return -1; } + + am_root = (getuid() == 0); io_printf(fd,"@RSYNCD: OK\n"); diff -u -r --new-file --exclude=CVS rsync-2.0.11/config.h.in rsync-2.0.12/config.h.in --- rsync-2.0.11/config.h.in Sat May 23 00:22:55 1998 +++ rsync-2.0.12/config.h.in Wed May 27 00:43:42 1998 @@ -103,6 +103,9 @@ /* Define if you have the mmap function. */ #undef HAVE_MMAP +/* Define if you have the munmap function. */ +#undef HAVE_MUNMAP + /* Define if you have the readlink function. */ #undef HAVE_READLINK diff -u -r --new-file --exclude=CVS rsync-2.0.11/configure rsync-2.0.12/configure --- rsync-2.0.11/configure Sat May 23 00:22:55 1998 +++ rsync-2.0.12/configure Wed May 27 00:43:42 1998 @@ -1831,7 +1831,7 @@ fi -for ac_func in mmap waitpid getcwd strdup strerror chown chmod mknod +for ac_func in mmap munmap waitpid getcwd strdup strerror chown chmod mknod do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:1838: checking for $ac_func" >&5 diff -u -r --new-file --exclude=CVS rsync-2.0.11/configure.in rsync-2.0.12/configure.in --- rsync-2.0.11/configure.in Sat May 23 00:22:55 1998 +++ rsync-2.0.12/configure.in Wed May 27 00:43:42 1998 @@ -39,7 +39,7 @@ AC_FUNC_MEMCMP AC_FUNC_UTIME_NULL -AC_CHECK_FUNCS(mmap waitpid getcwd strdup strerror chown chmod mknod) +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(memmove getopt_long lchown setlinebuf vsnprintf setsid glob) diff -u -r --new-file --exclude=CVS rsync-2.0.11/cvs.log rsync-2.0.12/cvs.log --- rsync-2.0.11/cvs.log Sat May 23 00:23:13 1998 +++ rsync-2.0.12/cvs.log Wed May 27 00:46:38 1998 @@ -4841,3 +4841,123 @@ need strchr check in configure.in + +**************************************** +Date: Saturday May 23, 1998 @ 13:13 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv25715 + +Modified Files: + flist.c +Log Message: +don't treat intermediate link directories as links in the relative +path code + + + +**************************************** +Date: Saturday May 23, 1998 @ 15:57 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv4273 + +Modified Files: + clientserver.c rsync.c +Log Message: +- don't allow chown for the group of a file if running as a daemon and + uid!=0 + +- reset am_root after startup as a daemon + + + + + +**************************************** +Date: Wednesday May 27, 1998 @ 0:16 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv18848 + +Modified Files: + flist.c +Log Message: +error formatting changes + + + +**************************************** +Date: Wednesday May 27, 1998 @ 0:17 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv28164 + +Modified Files: + main.c +Log Message: +formatting changes + + + +**************************************** +Date: Wednesday May 27, 1998 @ 0:19 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv22024 + +Modified Files: + config.h.in configure configure.in rsync.h syscall.c util.c +Log Message: +check for munmap as well as mmap. NextStep only has mmap in standard +libs + + + + +**************************************** +Date: Wednesday May 27, 1998 @ 0:39 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv2568 + +Modified Files: + flist.c +Log Message: +fixed a bug in the handling of very long filenames (longer than 255 +chars) where two neighboring filenames share more than 255 characters +at the start of their names. + + + +**************************************** +Date: Wednesday May 27, 1998 @ 0:45 +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.12 + + +**************************************** +Date: Wednesday May 27, 1998 @ 0:45 +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.12 + diff -u -r --new-file --exclude=CVS rsync-2.0.11/flist.c rsync-2.0.12/flist.c --- rsync-2.0.11/flist.c Tue May 19 00:30:20 1998 +++ rsync-2.0.12/flist.c Wed May 27 00:43:42 1998 @@ -163,7 +163,7 @@ if (file->gid == last_gid) flags |= SAME_GID; if (file->modtime == last_time) flags |= SAME_TIME; - for (l1=0;lastname[l1] && fname[l1] == lastname[l1];l1++) ; + for (l1=0;lastname[l1] && (fname[l1] == lastname[l1]) && (l1 < 255);l1++) ; l2 = strlen(fname) - l1; if (l1 > 0) flags |= SAME_NAME; @@ -513,7 +513,7 @@ d = opendir(dir); if (!d) { io_error = 1; - rprintf(FERROR,"%s: %s\n", + rprintf(FERROR,"opendir(%s): %s\n", dir,strerror(errno)); return; } @@ -625,8 +625,11 @@ strlcpy(lastpath, fname, sizeof(lastpath)-1); *p = '/'; for (p=fname+1; (p=strchr(p,'/')); p++) { + int copy_links_saved = copy_links; *p = 0; + copy_links = 0; send_file_name(f, flist, fname, 0, 0); + copy_links = copy_links_saved; *p = '/'; } } else { diff -u -r --new-file --exclude=CVS rsync-2.0.11/main.c rsync-2.0.12/main.c --- rsync-2.0.11/main.c Tue May 19 00:30:20 1998 +++ rsync-2.0.12/main.c Wed May 27 00:43:43 1998 @@ -148,40 +148,41 @@ STRUCT_STAT st; extern int orig_umask; - if (do_stat(name,&st) == 0) { - if (S_ISDIR(st.st_mode)) { - if (chdir(name) != 0) { - rprintf(FERROR,"chdir %s : %s (1)\n",name,strerror(errno)); - exit_cleanup(1); - } - return NULL; - } - if (flist->count > 1) { - rprintf(FERROR,"ERROR: destination must be a directory when copying more than 1 file\n"); - exit_cleanup(1); - } - return name; - } + if (do_stat(name,&st) == 0) { + if (S_ISDIR(st.st_mode)) { + if (chdir(name) != 0) { + rprintf(FERROR,"chdir %s : %s (1)\n", + name,strerror(errno)); + exit_cleanup(1); + } + return NULL; + } + if (flist->count > 1) { + rprintf(FERROR,"ERROR: destination must be a directory when copying more than 1 file\n"); + exit_cleanup(1); + } + return name; + } - if (flist->count == 1) - return name; + if (flist->count == 1) + return name; - if (!name) - return NULL; + if (!name) + return NULL; - if (do_mkdir(name,0777 & ~orig_umask) != 0) { - rprintf(FERROR,"mkdir %s : %s (1)\n",name,strerror(errno)); - exit_cleanup(1); - } else { - rprintf(FINFO,"created directory %s\n",name); - } + if (do_mkdir(name,0777 & ~orig_umask) != 0) { + rprintf(FERROR,"mkdir %s : %s (1)\n",name,strerror(errno)); + exit_cleanup(1); + } else { + rprintf(FINFO,"created directory %s\n",name); + } - if (chdir(name) != 0) { - rprintf(FERROR,"chdir %s : %s (2)\n",name,strerror(errno)); - exit_cleanup(1); - } + if (chdir(name) != 0) { + rprintf(FERROR,"chdir %s : %s (2)\n",name,strerror(errno)); + exit_cleanup(1); + } - return NULL; + return NULL; } diff -u -r --new-file --exclude=CVS rsync-2.0.11/packaging/redhat/5.0/rsync.spec rsync-2.0.12/packaging/redhat/5.0/rsync.spec --- rsync-2.0.11/packaging/redhat/5.0/rsync.spec Sat May 23 00:23:06 1998 +++ rsync-2.0.12/packaging/redhat/5.0/rsync.spec Wed May 27 00:46:18 1998 @@ -1,10 +1,10 @@ Summary: Program for efficient remote updates of files. Name: rsync -Version: 2.0.11 +Version: 2.0.12 Release: 1 Copyright: GPL Group: Applications/Networking -Source: ftp://samba.anu.edu.au/pub/rsync/rsync-2.0.11.tar.gz +Source: ftp://samba.anu.edu.au/pub/rsync/rsync-2.0.12.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.11/rsync.c rsync-2.0.12/rsync.c --- rsync-2.0.11/rsync.c Fri May 22 23:45:40 1998 +++ rsync-2.0.12/rsync.c Wed May 27 00:43:43 1998 @@ -267,6 +267,7 @@ { int updated = 0; STRUCT_STAT st2; + extern int am_daemon; if (dry_run) return 0; @@ -300,8 +301,9 @@ } #endif - if ((am_root && preserve_uid && st->st_uid != file->uid) || - (preserve_gid && st->st_gid != file->gid)) { + 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) { diff -u -r --new-file --exclude=CVS rsync-2.0.11/rsync.h rsync-2.0.12/rsync.h --- rsync-2.0.11/rsync.h Fri May 22 23:45:41 1998 +++ rsync-2.0.12/rsync.h Wed May 27 00:43:43 1998 @@ -142,8 +142,9 @@ #endif #include -#ifdef HAVE_MMAP +#if defined(HAVE_MMAP) && defined(HAVE_MUNMAP) #include +#define USE_MMAP 1 #endif #ifdef HAVE_UTIME_H diff -u -r --new-file --exclude=CVS rsync-2.0.11/syscall.c rsync-2.0.12/syscall.c --- rsync-2.0.11/syscall.c Fri May 22 23:45:41 1998 +++ rsync-2.0.12/syscall.c Wed May 27 00:43:43 1998 @@ -149,7 +149,7 @@ #endif } -#if HAVE_MMAP +#ifdef USE_MMAP void *do_mmap(void *start, int len, int prot, int flags, int fd, OFF_T offset) { #if HAVE_OFF64_T diff -u -r --new-file --exclude=CVS rsync-2.0.11/util.c rsync-2.0.12/util.c --- rsync-2.0.11/util.c Sat May 23 00:05:14 1998 +++ rsync-2.0.12/util.c Wed May 27 00:43:43 1998 @@ -46,7 +46,7 @@ ret->p_offset = 0; ret->p_len = 0; -#ifdef HAVE_MMAP +#ifdef USE_MMAP len = MIN(len, MAX_MAP_SIZE); ret->map = (char *)do_mmap(NULL,len,PROT_READ,MAP_SHARED,fd,0); if (ret->map == (char *)-1) { @@ -69,7 +69,7 @@ if (len > (map->size-offset)) len = map->size-offset; -#ifdef HAVE_MMAP +#ifdef USE_MMAP if (map->map) { if (offset >= map->p_offset && offset+len <= map->p_offset+map->p_len) { @@ -143,7 +143,7 @@ void unmap_file(struct map_struct *map) { -#ifdef HAVE_MMAP +#ifdef USE_MMAP if (map->map) { munmap(map->map,map->p_len); map->map = NULL; diff -u -r --new-file --exclude=CVS rsync-2.0.11/version.h rsync-2.0.12/version.h --- rsync-2.0.11/version.h Sat May 23 00:23:05 1998 +++ rsync-2.0.12/version.h Wed May 27 00:46:16 1998 @@ -1 +1 @@ -#define VERSION "2.0.11" +#define VERSION "2.0.12"