head 1.5; access; symbols pkgsrc-2013Q2:1.5.0.50 pkgsrc-2013Q2-base:1.5 pkgsrc-2012Q4:1.5.0.48 pkgsrc-2012Q4-base:1.5 pkgsrc-2011Q4:1.5.0.46 pkgsrc-2011Q4-base:1.5 pkgsrc-2011Q2:1.5.0.44 pkgsrc-2011Q2-base:1.5 pkgsrc-2009Q4:1.5.0.42 pkgsrc-2009Q4-base:1.5 pkgsrc-2008Q4:1.5.0.40 pkgsrc-2008Q4-base:1.5 pkgsrc-2008Q3:1.5.0.38 pkgsrc-2008Q3-base:1.5 cube-native-xorg:1.5.0.36 cube-native-xorg-base:1.5 pkgsrc-2008Q2:1.5.0.34 pkgsrc-2008Q2-base:1.5 pkgsrc-2008Q1:1.5.0.32 pkgsrc-2008Q1-base:1.5 pkgsrc-2007Q4:1.5.0.30 pkgsrc-2007Q4-base:1.5 pkgsrc-2007Q3:1.5.0.28 pkgsrc-2007Q3-base:1.5 pkgsrc-2007Q2:1.5.0.26 pkgsrc-2007Q2-base:1.5 pkgsrc-2007Q1:1.5.0.24 pkgsrc-2007Q1-base:1.5 pkgsrc-2006Q4:1.5.0.22 pkgsrc-2006Q4-base:1.5 pkgsrc-2006Q3:1.5.0.20 pkgsrc-2006Q3-base:1.5 pkgsrc-2006Q2:1.5.0.18 pkgsrc-2006Q2-base:1.5 pkgsrc-2006Q1:1.5.0.16 pkgsrc-2006Q1-base:1.5 pkgsrc-2005Q4:1.5.0.14 pkgsrc-2005Q4-base:1.5 pkgsrc-2005Q3:1.5.0.12 pkgsrc-2005Q3-base:1.5 pkgsrc-2005Q2:1.5.0.10 pkgsrc-2005Q2-base:1.5 pkgsrc-2005Q1:1.5.0.8 pkgsrc-2005Q1-base:1.5 pkgsrc-2004Q4:1.5.0.6 pkgsrc-2004Q4-base:1.5 pkgsrc-2004Q3:1.5.0.4 pkgsrc-2004Q3-base:1.5 pkgsrc-2004Q2:1.5.0.2 pkgsrc-2004Q2-base:1.5 pkgsrc-2004Q1:1.4.0.2 pkgsrc-2004Q1-base:1.4 pkgsrc-2003Q4:1.3.0.2 pkgsrc-2003Q4-base:1.3 buildlink2-base:1.2; locks; strict; comment @# @; 1.5 date 2004.05.04.11.36.19; author tron; state dead; branches; next 1.4; 1.4 date 2004.01.20.05.16.42; author grant; state Exp; branches 1.4.2.1; next 1.3; 1.3 date 2003.04.11.03.56.06; author salo; state Exp; branches; next 1.2; 1.2 date 98.11.05.01.42.44; author mycroft; state dead; branches; next 1.1; 1.1 date 98.11.05.00.24.38; author mycroft; state Exp; branches; next ; 1.4.2.1 date 2004.05.10.08.54.30; author agc; state dead; branches; next ; desc @@ 1.5 log @Update "rsync" package to version 2.6.2. Changes since version 2.6.0: - 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. - Paths sent to an rsync daemon are more thoroughly sanitized when chroot is not used. If you're running a non-read-only rsync daemon with chroot disabled, *please upgrade*, ESPECIALLY if the user privs you run rsync under is anything above "nobody". - Lower memory use, more optimal transfer of data over the socket, and lower CPU usage (see the INTERNAL section for details). - The RSYNC_PROXY environment variable can now contain a "USER:PASS@@" prefix before the "HOST:PORT" information. (Bardur Arantsson) - The --progress output now mentions how far along in the transfer we are, including both a count of files transferred and a percentage of the total file-count that we've processed. It also shows better current-rate-of-transfer and remaining-transfer-time values. - The configure script now accepts --with-rsyncd-conf=PATH to override the default value of the /etc/rsyncd.conf file. - Added a couple extra diffs in the "patches" dir, removed the ones that got applied, and rebuilt the rest. - Documentation changes now attempt to describe some often mis- understood features more clearly. - When -x (--one-file-system) is combined with -L (--copy-links) or --copy-unsafe-links, no symlinked files are skipped, even if the referent file is on a different filesystem. - The --link-dest code now works properly for a non-root user when (1) the UIDs of the source and destination differ and -o was specified, or (2) when the group of the source can't be used on the destination and -g was specified. - Fixed a bug in the handling of -H (hard-links) that might cause the expanded PATH/NAME value of the current item to get overwritten (due to an expanded-name caching bug). - We now reset the "new data has been sent" flag at the start of each file we send. This makes sure that an interrupted transfer with the --partial option set doesn't keep a shorter temp file than the current basis file when no new data has been transfered over the wire for that file. - Fixed a byte-order problem in --batch-mode on big-endian machines. (Jay Fenlason) - Fixed configure bug when running "./configure --disable-ipv6". - Fixed "make test" bug when build dir is not the source dir. - When using --cvs-exclude, the exclude items we get from a per-directory's .cvsignore file once again only affect that one directory (not all following directories too). The items are also now properly word-split and parsed without any +/- prefix parsing. - When specifying the USER@@HOST: prefix for a file, the USER part can now contain an '@@', if needed (i.e. the last '@@' is used to find the HOST, not the first). - Fixed some bugs in the handling of group IDs for non-root users: (1) It properly handles a group that the sender didn't have a name for (it would previously skip changing the group on any files in that group). (2) If --numeric-ids is used, rsync no longer attempts to set groups that the user doesn't have the permission to set. - Fixed the "refuse options" setting in the rsyncd.conf file. - Improved the -x (--one-file-system) flag's handling of any mount- point directories we encounter. It is both more optimal (in that it no longer does a useless scan of the contents of the mount- point dirs) and also fixes a bug where a remapped mount of the original filesystem could get discovered in a subdir we should be ignoring. - Rsync no longer discards a double-slash at the start of a filename when trying to open the file. It also no longer constructs names that start with a double slash (unless the user supplied them). - Path-specifying options to a daemon should now work the same with or without chroot turned on. Previously, such a option (such as --link-dest) would get its absolute path munged into a relative one if chroot was not on, making that setting fairly useless. Rsync now transforms the path into one that is based on the module's base dir when chroot is not enabled. - Fixed compilation problem on Tru64 Unix (having to do with sockaddr.sa_len and sockaddr.sin_len). - Fixed a compatibility problem interacting with older rsync versions that might send us an empty --suffix value without telling us that --backup-dir was specified. - The "hosts allow" option for a daemon-over-remote-shell process now has improved support for IPv6 addresses and a fix for systems that have a length field in their socket structs. - Fixed the ability to request an empty backup --suffix when sending files to an rsync daemon. @ text @$NetBSD: patch-af,v 1.4 2004/01/20 05:16:42 grant Exp $ --- socket.c.orig 2003-08-22 00:04:13.000000000 -0500 +++ socket.c @@@@ -292,59 +292,30 @@@@ int open_socket_out_wrapped (char *host, * @@param bind_address Local address to bind, or NULL to allow it to * default. **/ -static int open_socket_in(int type, int port, const char *bind_address, - int af_hint) +static int open_socket_in(struct addrinfo *resp) { int one=1; int s; - struct addrinfo hints, *all_ai, *resp; - char portbuf[10]; - int error; - - memset(&hints, 0, sizeof(hints)); - hints.ai_family = af_hint; - hints.ai_socktype = type; - hints.ai_flags = AI_PASSIVE; - snprintf(portbuf, sizeof(portbuf), "%d", port); - error = getaddrinfo(bind_address, portbuf, &hints, &all_ai); - if (error) { - rprintf(FERROR, RSYNC_NAME ": getaddrinfo: bind address %s: %s\n", - bind_address, gai_strerror(error)); - return -1; - } /* We may not be able to create the socket, if for example the * machine knows about IPv6 in the C library, but not in the * kernel. */ - for (resp = all_ai; resp; resp = resp->ai_next) { - s = socket(resp->ai_family, resp->ai_socktype, - resp->ai_protocol); - - if (s == -1) - /* See if there's another address that will work... */ - continue; - - setsockopt(s, SOL_SOCKET, SO_REUSEADDR, - (char *)&one, sizeof one); - - /* now we've got a socket - we need to bind it */ - if (bind(s, all_ai->ai_addr, all_ai->ai_addrlen) < 0) { - /* Nope, try another */ - close(s); - continue; - } + s = socket(resp->ai_family, resp->ai_socktype, + resp->ai_protocol); - freeaddrinfo(all_ai); - return s; + if (s == -1) + return -1; + + setsockopt(s, SOL_SOCKET, SO_REUSEADDR, + (char *)&one, sizeof one); + + /* now we've got a socket - we need to bind it */ + if (bind(s, resp->ai_addr, resp->ai_addrlen) < 0) { + close(s); + return -1; } - rprintf(FERROR, RSYNC_NAME ": open inbound socket on port %d failed: " - "%s\n", - port, - strerror(errno)); - - freeaddrinfo(all_ai); - return -1; + return s; } @@@@ -382,24 +353,52 @@@@ static RETSIGTYPE sigchld_handler(UNUSED #endif } +#define MAXSOCK 20 void start_accept_loop(int port, int (*fn)(int, int)) { - int s; + int s[MAXSOCK]; + int nsock = 0; + int maxsock = -1; extern char *bind_address; extern int default_af_hint; + struct addrinfo hints, *res, *res0; + char portstr[NI_MAXSERV]; + int i; - /* open an incoming socket */ - s = open_socket_in(SOCK_STREAM, port, bind_address, default_af_hint); - if (s == -1) + memset(&hints, 0, sizeof(hints)); + hints.ai_family = default_af_hint; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_PASSIVE; + snprintf(portstr, sizeof(portstr), "%d", port); + if (getaddrinfo(bind_address, portstr, &hints, &res0) != 0) exit_cleanup(RERR_SOCKETIO); - /* ready to listen */ - if (listen(s, 5) == -1) { - close(s); - exit_cleanup(RERR_SOCKETIO); + /* open an incoming socket */ + for (res = res0; res; res = res->ai_next) { + if (nsock >= sizeof(s) / sizeof(s[0])) + break; + s[nsock] = open_socket_in(res); + if (s[nsock] == -1) + continue; + if (s[nsock] >= FD_SETSIZE) { + close(s[nsock]); + continue; + } + + /* ready to listen */ + if (listen(s[nsock], 5) == -1) { + close(s[nsock]); + continue; + } + + if (s[nsock] > maxsock) + maxsock = s[nsock]; + nsock++; } + if (nsock == 0) + exit_cleanup(RERR_SOCKETIO); /* now accept incoming connections - forking a new process for each incoming connection */ @@@@ -416,42 +415,47 @@@@ void start_accept_loop(int port, int (*f log_close(); FD_ZERO(&fds); - FD_SET(s, &fds); + for (i = 0; i < nsock; i++) + FD_SET(s[i], &fds); - if (select(s+1, &fds, NULL, NULL, NULL) != 1) { + if (select(maxsock + 1, &fds, NULL, NULL, NULL) < 0) continue; - } - - if(!FD_ISSET(s, &fds)) continue; - fd = accept(s,(struct sockaddr *)&addr,&addrlen); - - if (fd == -1) continue; - - signal(SIGCHLD, sigchld_handler); - - if ((pid = fork()) == 0) { - int ret; - close(s); - /* open log file in child before possibly giving - up privileges */ - log_open(); - ret = fn(fd, fd); - close_all(); - _exit(ret); - } else if (pid < 0) { - rprintf(FERROR, - RSYNC_NAME - ": could not create child server process: %s\n", - strerror(errno)); - close(fd); - /* This might have happened because we're - * overloaded. Sleep briefly before trying to - * accept again. */ - sleep(2); - } else { - /* Parent doesn't need this fd anymore. */ - close(fd); + for (i = 0; i < nsock; i++) { + if (!FD_ISSET(s[i], &fds)) + continue; + + fd = accept(s[i], (struct sockaddr *)&addr, &addrlen); + + if (fd == -1) + continue; + + signal(SIGCHLD, sigchld_handler); + + if ((pid = fork()) == 0) { + int ret; + for (i = 0; i < nsock; i++) + close(s[i]); + /* open log file in child before possibly giving + up privileges */ + log_open(); + ret = fn(fd, fd); + close_all(); + _exit(ret); + } else if (pid < 0) { + rprintf(FERROR, + RSYNC_NAME + ": could not create child server process: %s\n", + strerror(errno)); + close(fd); + /* This might have happened because we're + * overloaded. Sleep briefly before trying to + * accept again. */ + sleep(2); + } else { + /* Parent doesn't need this fd anymore. */ + close(fd); + } } } } @ 1.4 log @Updated rsync to 2.6.0. Major changes since 2.5.7: * "ssh" is now the default remote shell for rsync. If you want to change this, configure like this: "./configure --with-rsh=rsh". * Added --files-from, --no-relative, --no-implied-dirs, and --from0. Note that --from0 affects the line-ending character for all the files read by the --*-from options. (Wayne Davison) * Length of csum2 is now per-file starting with protocol version 27. (J.W. Schultz) * Per-file dynamic block size is now sqrt(file length). The per-file checksum size is determined according to an algorithm provided by Donovan Baarda which reduces the probability of rsync algorithm corrupting data and falling back using the whole md4 checksums. (J.W. Schultz, Donovan Baarda) * The --stats option no longer includes the (debug) malloc summary unless the verbose option was specified at least twice. * Added a new error/warning code for when files vanish from the sending side. Made vanished source files not interfere with the file-deletion pass when --delete-after was specified. * Various trailing-info sections are now preceded by a newline. * Many bug-fixes. Update provided by Min Sik Kim in PR pkg/24146. @ text @d1 1 a1 1 $NetBSD$ @ 1.4.2.1 log @Pullup update of rsync to 2.6.2 to the pkgsrc-2004Q1 branch to fix a security problem (reported as CAN-2004-0426 (cve.mitre.org)). Requested by taca in ticket pkgsrc/27. Module Name: pkgsrc Committed By: tron Date: Tue May 4 11:36:19 UTC 2004 Modified Files: pkgsrc/net/rsync: Makefile distinfo Removed Files: pkgsrc/net/rsync/patches: patch-af Log Message: Update "rsync" package to version 2.6.2. Changes since version 2.6.0: - 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. - Paths sent to an rsync daemon are more thoroughly sanitized when chroot is not used. If you're running a non-read-only rsync daemon with chroot disabled, *please upgrade*, ESPECIALLY if the user privs you run rsync under is anything above "nobody". - Lower memory use, more optimal transfer of data over the socket, and lower CPU usage (see the INTERNAL section for details). - The RSYNC_PROXY environment variable can now contain a "USER:PASS@@" prefix before the "HOST:PORT" information. (Bardur Arantsson) - The --progress output now mentions how far along in the transfer we are, including both a count of files transferred and a percentage of the total file-count that we've processed. It also shows better current-rate-of-transfer and remaining-transfer-time values. - The configure script now accepts --with-rsyncd-conf=PATH to override the default value of the /etc/rsyncd.conf file. - Added a couple extra diffs in the "patches" dir, removed the ones that got applied, and rebuilt the rest. - Documentation changes now attempt to describe some often mis- understood features more clearly. - When -x (--one-file-system) is combined with -L (--copy-links) or --copy-unsafe-links, no symlinked files are skipped, even if the referent file is on a different filesystem. - The --link-dest code now works properly for a non-root user when (1) the UIDs of the source and destination differ and -o was specified, or (2) when the group of the source can't be used on the destination and -g was specified. - Fixed a bug in the handling of -H (hard-links) that might cause the expanded PATH/NAME value of the current item to get overwritten (due to an expanded-name caching bug). - We now reset the "new data has been sent" flag at the start of each file we send. This makes sure that an interrupted transfer with the --partial option set doesn't keep a shorter temp file than the current basis file when no new data has been transfered over the wire for that file. - Fixed a byte-order problem in --batch-mode on big-endian machines. (Jay Fenlason) - Fixed configure bug when running "./configure --disable-ipv6". - Fixed "make test" bug when build dir is not the source dir. - When using --cvs-exclude, the exclude items we get from a per-directory's .cvsignore file once again only affect that one directory (not all following directories too). The items are also now properly word-split and parsed without any +/- prefix parsing. - When specifying the USER@@HOST: prefix for a file, the USER part can now contain an '@@', if needed (i.e. the last '@@' is used to find the HOST, not the first). - Fixed some bugs in the handling of group IDs for non-root users: (1) It properly handles a group that the sender didn't have a name for (it would previously skip changing the group on any files in that group). (2) If --numeric-ids is used, rsync no longer attempts to set groups that the user doesn't have the permission to set. - Fixed the "refuse options" setting in the rsyncd.conf file. - Improved the -x (--one-file-system) flag's handling of any mount- point directories we encounter. It is both more optimal (in that it no longer does a useless scan of the contents of the mount- point dirs) and also fixes a bug where a remapped mount of the original filesystem could get discovered in a subdir we should be ignoring. - Rsync no longer discards a double-slash at the start of a filename when trying to open the file. It also no longer constructs names that start with a double slash (unless the user supplied them). - Path-specifying options to a daemon should now work the same with or without chroot turned on. Previously, such a option (such as --link-dest) would get its absolute path munged into a relative one if chroot was not on, making that setting fairly useless. Rsync now transforms the path into one that is based on the module's base dir when chroot is not enabled. - Fixed compilation problem on Tru64 Unix (having to do with sockaddr.sa_len and sockaddr.sin_len). - Fixed a compatibility problem interacting with older rsync versions that might send us an empty --suffix value without telling us that --backup-dir was specified. - The "hosts allow" option for a daemon-over-remote-shell process now has improved support for IPv6 addresses and a fix for systems that have a length field in their socket structs. - Fixed the ability to request an empty backup --suffix when sending files to an rsync daemon. @ text @d1 1 a1 1 $NetBSD: patch-af,v 1.4 2004/01/20 05:16:42 grant Exp $ @ 1.3 log @Bump PKGREVISION: Fix binding in --daemon mode. Addresses PR pkg/18134. Patch by itojun. @ text @d3 3 a5 3 --- socket.c.orig 2003-01-27 04:35:09.000000000 +0100 +++ socket.c 2003-04-11 05:07:48.000000000 +0200 @@@@ -292,59 +292,30 @@@@ d37 1 a37 3 + s = socket(resp->ai_family, resp->ai_socktype, + resp->ai_protocol); d51 3 a53 1 - d79 2 a80 2 @@@@ -373,24 +344,52 @@@@ return(getsockopt(fd, SOL_SOCKET, SO_TYPE, (char *)&v, &l) == 0); d140 1 a140 1 @@@@ -407,49 +406,54 @@@@ d152 1 a152 1 a153 3 + for (i = 0; i < nsock; i++) { + if (!FD_ISSET(s[i], &fds)) + continue; d156 1 a156 2 + fd = accept(s[i], (struct sockaddr *)&addr, &addrlen); d158 3 a160 17 + if (fd == -1) + continue; - signal(SIGCHLD, SIG_IGN); + signal(SIGCHLD, SIG_IGN); - /* we shouldn't have any children left hanging around - but I have had reports that on Digital Unix zombies - are produced, so this ensures that they are reaped */ + /* we shouldn't have any children left hanging around + but I have had reports that on Digital Unix zombies + are produced, so this ensures that they are reaped */ #ifdef WNOHANG - while (waitpid(-1, NULL, WNOHANG) > 0); + while (waitpid(-1, NULL, WNOHANG) > 0); #endif d183 11 d205 1 a205 1 + rprintf(FERROR, @ 1.2 log @Per discussion with the author, these changes were a bad idea. @ text @d1 1 a1 1 $NetBSD: patch-af,v 1.1 1998/11/05 00:24:38 mycroft Exp $ d3 225 a227 14 --- proto.h.orig Tue Nov 3 17:00:46 1998 +++ proto.h Wed Nov 4 19:07:49 1998 @@@@ -138,7 +138,11 @@@@ int do_chmod(const char *path, mode_t mode); int do_rename(char *fname1, char *fname2); int do_mkdir(char *fname, mode_t mode); +#ifdef HAVE_MKSTEMP +int do_mkstemp(char *template); +#else char *do_mktemp(char *template); +#endif int do_stat(const char *fname, STRUCT_STAT *st); int do_lstat(const char *fname, STRUCT_STAT *st); int do_fstat(int fd, STRUCT_STAT *st); @ 1.1 log @2.2.0 @ text @d1 1 a1 1 $NetBSD$ @