Subject: pkg/24146: net/rsync update to 2.6.0
To: None <gnats-bugs@gnats.NetBSD.org>
From: Min Sik Kim <minskim@bawi.org>
List: netbsd-bugs
Date: 01/18/2004 17:17:00
>Number:         24146
>Category:       pkg
>Synopsis:       net/rsync update to 2.6.0
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 18 23:18:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Min Sik Kim
>Release:        NetBSD 1.6ZH
>Organization:
>Environment:
System: NetBSD sulley.infnis.com 1.6ZH NetBSD 1.6ZH (SULLEY) #5: Sun Jan 18 00:17:12 CST 2004 root@sulley.infnis.com:/usr/obj/sys/arch/i386/compile/SULLEY i386
Architecture: i386
Machine: i386
>Description:
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.

>How-To-Repeat:
>Fix:

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/net/rsync/Makefile,v
retrieving revision 1.49
diff -u -r1.49 Makefile
--- Makefile	2003/12/04 10:57:42	1.49
+++ Makefile	2004/01/18 23:05:15
@@ -1,6 +1,6 @@
 # $NetBSD: Makefile,v 1.49 2003/12/04 10:57:42 tron Exp $
 
-DISTNAME=	rsync-2.5.7
+DISTNAME=	rsync-2.6.0
 CATEGORIES=	net
 MASTER_SITES=	http://rsync.samba.org/ftp/rsync/ \
 		ftp://rsync.samba.org/pub/rsync/ \
@@ -20,11 +20,11 @@
 
 PKG_SYSCONFSUBDIR=	rsync
 
-post-patch:
-	@cd ${WRKSRC} && \
-	for f in rsync.h rsync.1 rsyncd.conf.5 ; do \
-		${MV} $${f} $${f}.orig;			\
-		${SED} ${FILES_SUBST_SED} $${f}.orig > $${f};	\
-	done
+SUBST_CLASSES+=		paths
+SUBST_MESSAGE.paths=	"Fixing hardcoded paths."
+SUBST_STAGE.paths=	post-patch
+SUBST_FILES.paths=	rsync.h rsync.1 rsyncd.conf.5
+SUBST_SED.paths=	-e 's|/etc/rsyncd|${PKG_SYSCONFDIR}/rsyncd|g' \
+			-e 's|/usr/bin/rsync|${PREFIX}/bin/rsync|g'
 
 .include "../../mk/bsd.pkg.mk"
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/net/rsync/distinfo,v
retrieving revision 1.12
diff -u -r1.12 distinfo
--- distinfo	2003/12/04 10:57:43	1.12
+++ distinfo	2004/01/18 23:05:15
@@ -1,10 +1,7 @@
 $NetBSD: distinfo,v 1.12 2003/12/04 10:57:43 tron Exp $
 
-SHA1 (rsync-2.5.7.tar.gz) = a2b186cfa4da1f8634e896e3ed2914cbd3bcd1f4
-Size (rsync-2.5.7.tar.gz) = 444035 bytes
-SHA1 (patch-aa) = 27c2925b67d38132507a2e8e41ba7e406a9d9051
-SHA1 (patch-ab) = 3d0a64dd17c8f161c373b8b144991fcb26758c07
-SHA1 (patch-ac) = 6c0db05f23ed7794911f25d8fde6ef5a7b90bbea
-SHA1 (patch-ad) = a6b10af0fe443b97ab93bfe8006cdb5969609841
-SHA1 (patch-ae) = 48799b1737e5f9979ea57dedf284b8e1c4701029
-SHA1 (patch-af) = 07254e0f655779520ea71ee51f1f8d6749379c0f
+SHA1 (rsync-2.6.0.tar.gz) = b28a05c35fa4a3d886d0f65f3412f28fe14955cf
+Size (rsync-2.6.0.tar.gz) = 464920 bytes
+SHA1 (patch-aa) = ebf163297b20362cf1f9f6629490398a8a9a265b
+SHA1 (patch-ab) = bfd70127ce8946879c73b673dc983755abab83ad
+SHA1 (patch-af) = 360b0dae3b226044045b070cb2d70ed733d80e12
Index: patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/net/rsync/patches/patch-aa,v
retrieving revision 1.8
diff -u -r1.8 patch-aa
--- patches/patch-aa	2002/03/12 16:02:57	1.8
+++ patches/patch-aa	2004/01/18 23:05:15
@@ -1,13 +1,13 @@
-$NetBSD: patch-aa,v 1.8 2002/03/12 16:02:57 tron Exp $
+$NetBSD$
 
---- match.c.orig	Sun Feb  3 02:38:39 2002
-+++ match.c	Tue Mar 12 16:55:19 2002
-@@ -247,7 +247,7 @@
+--- match.c.orig	2003-12-06 15:07:27.000000000 -0600
++++ match.c
+@@ -256,7 +256,7 @@ static void hash_search(int f,struct sum
  		   running match, the checksum update and the
  		   literal send. */
- 		if (offset > last_match &&
--		    offset-last_match >= CHUNK_SIZE+s->n && 
-+		    offset >= last_match+CHUNK_SIZE+s->n && 
- 		    (end-offset > CHUNK_SIZE)) {
- 			matched(f,s,buf,offset - s->n, -2);
+ 		if (offset > last_match
+-		 && offset-last_match >= CHUNK_SIZE+s->blength
++		 && offset >= last_match+CHUNK_SIZE+s->blength
+ 		 && end-offset > CHUNK_SIZE) {
+ 			matched(f,s,buf,offset - s->blength, -2);
  		}
Index: patches/patch-ab
===================================================================
RCS file: /cvsroot/pkgsrc/net/rsync/patches/patch-ab,v
retrieving revision 1.8
diff -u -r1.8 patch-ab
--- patches/patch-ab	2003/03/06 20:44:14	1.8
+++ patches/patch-ab	2004/01/18 23:05:15
@@ -1,8 +1,8 @@
-$NetBSD: patch-ab,v 1.8 2003/03/06 20:44:14 salo Exp $
+$NetBSD$
 
---- Makefile.in.orig	2003-01-20 19:26:14.000000000 +0100
-+++ Makefile.in	2003-03-06 20:50:23.000000000 +0100
-@@ -60,12 +60,11 @@
+--- Makefile.in.orig	2003-07-30 01:12:25.000000000 -0500
++++ Makefile.in
+@@ -61,12 +61,11 @@ all: rsync$(EXEEXT)
  man: rsync.1 rsyncd.conf.5
  
  install: all
Index: patches/patch-ac
===================================================================
RCS file: /cvsroot/pkgsrc/net/rsync/patches/patch-ac,v
retrieving revision 1.7
diff -u -r1.7 patch-ac
--- patches/patch-ac	2003/03/06 20:44:14	1.7
+++ patches/patch-ac	2004/01/18 23:05:15
@@ -1,13 +0,0 @@
-$NetBSD: patch-ac,v 1.7 2003/03/06 20:44:14 salo Exp $
-
---- rsync.h.orig	2003-01-26 21:11:16.000000000 +0100
-+++ rsync.h	2003-03-06 21:25:18.000000000 +0100
-@@ -26,7 +26,7 @@
- #define RSYNC_RSH_ENV "RSYNC_RSH"
- 
- #define RSYNC_NAME "rsync"
--#define RSYNCD_SYSCONF "/etc/rsyncd.conf"
-+#define RSYNCD_SYSCONF "@PKG_SYSCONFDIR@/rsyncd.conf"
- #define RSYNCD_USERCONF "rsyncd.conf"
- 
- #define DEFAULT_LOCK_FILE "/var/run/rsyncd.lock"
Index: patches/patch-ad
===================================================================
RCS file: /cvsroot/pkgsrc/net/rsync/patches/patch-ad,v
retrieving revision 1.4
diff -u -r1.4 patch-ad
--- patches/patch-ad	2003/03/06 20:44:14	1.4
+++ patches/patch-ad	2004/01/18 23:05:15
@@ -1,53 +0,0 @@
-$NetBSD: patch-ad,v 1.4 2003/03/06 20:44:14 salo Exp $
-
---- rsyncd.conf.5.orig	2003-01-27 04:07:18.000000000 +0100
-+++ rsyncd.conf.5	2003-03-06 20:31:52.000000000 +0100
-@@ -65,10 +65,10 @@
- and a single line something like this to /etc/inetd\&.conf:
- .PP 
- .RS 
--rsync   stream  tcp     nowait  root   /usr/bin/rsync rsyncd --daemon
-+rsync   stream  tcp     nowait  root   @PREFIX@/bin/rsync rsyncd --daemon
- .RE 
- .PP 
--Replace "/usr/bin/rsync" with the path to where you have rsync installed on
-+Replace "@PREFIX@/bin/rsync" with the path to where you have rsync installed on
- your system\&.  You will then need to send inetd a HUP signal to tell it to
- reread its config file\&.
- .PP 
-@@ -259,8 +259,8 @@
- you may find that passwords longer than 8 characters don\'t work\&. 
- .IP 
- There is no default for the "secrets file" option, you must choose a name
--(such as \f(CW/etc/rsyncd\&.secrets\fP)\&.  The file must normally not be readable
--by "other"; see "strict modes"\&.
-+(such as \f(CW@PKG_SYSCONFDIR@/rsyncd\&.secrets\fP)\&.  The file must normally
-+not be readable by "other"; see "strict modes"\&.
- .IP 
- .IP "\fBstrict modes\fP" 
- The "strict modes" option determines whether or not 
-@@ -504,13 +504,13 @@
-         path = /data/cvs
-         comment = CVS repository (requires authentication)
-         auth users = tridge, susan
--        secrets file = /etc/rsyncd\&.secrets
-+        secrets file = @PKG_SYSCONFDIR@/rsyncd\&.secrets
- 
- .fi 
-  
- 
- .PP 
--The /etc/rsyncd\&.secrets file would look something like this:
-+The @PKG_SYSCONFDIR@/rsyncd\&.secrets file would look something like this:
- .PP 
- tridge:mypass 
- .br 
-@@ -518,7 +518,7 @@
- .PP 
- .SH "FILES" 
- .PP 
--/etc/rsyncd\&.conf or rsyncd\&.conf
-+@PKG_SYSCONFDIR@/rsyncd\&.conf
- .PP 
- .SH "SEE ALSO" 
- .PP 
Index: patches/patch-ae
===================================================================
RCS file: /cvsroot/pkgsrc/net/rsync/patches/patch-ae,v
retrieving revision 1.5
diff -u -r1.5 patch-ae
--- patches/patch-ae	2003/03/06 20:44:15	1.5
+++ patches/patch-ae	2004/01/18 23:05:15
@@ -1,31 +0,0 @@
-$NetBSD: patch-ae,v 1.5 2003/03/06 20:44:15 salo Exp $
-
---- rsync.1.orig	2003-01-28 04:11:57.000000000 +0100
-+++ rsync.1	2003-03-06 21:00:02.000000000 +0100
-@@ -236,7 +236,7 @@
- .PP 
- An rsync server is configured using a config file\&.  Please see the 
- rsyncd\&.conf(5) man page for more information\&.  By default the configuration
--file is called /etc/rsyncd\&.conf, unless rsync is running over a remote
-+file is called @PKG_SYSCONFDIR@/rsyncd\&.conf, unless rsync is running over a remote
- shell program and is not running as root; in that case, the default name
- is rsyncd\&.conf in the current directory on the remote computer 
- (typically $HOME)\&.
-@@ -860,7 +860,7 @@
- .IP "\fB--config=FILE\fP" 
- This specifies an alternate config file than
- the default\&.  This is only relevant when --daemon is specified\&. 
--The default is /etc/rsyncd\&.conf unless the daemon is running over
-+The default is @PKG_SYSCONFDIR@/rsyncd\&.conf unless the daemon is running over
- a remote shell program and the remote user is not root; in that case
- the default is rsyncd\&.conf in the current directory (typically $HOME)\&.
- .IP 
-@@ -1258,7 +1258,7 @@
- .PP 
- .SH "FILES" 
- .PP 
--/etc/rsyncd\&.conf or rsyncd\&.conf
-+@PKG_SYSCONFDIR@/rsyncd\&.conf or rsyncd\&.conf
- .PP 
- .SH "SEE ALSO" 
- .PP 
Index: patches/patch-af
===================================================================
RCS file: /cvsroot/pkgsrc/net/rsync/patches/patch-af,v
retrieving revision 1.3
diff -u -r1.3 patch-af
--- patches/patch-af	2003/04/11 03:56:06	1.3
+++ patches/patch-af	2004/01/18 23:05:15
@@ -1,8 +1,8 @@
-$NetBSD: patch-af,v 1.3 2003/04/11 03:56:06 salo Exp $
+$NetBSD$
 
---- 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 @@
+--- 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.
   **/
@@ -34,9 +34,7 @@
 -	for (resp = all_ai; resp; resp = resp->ai_next) {
 -		s = socket(resp->ai_family, resp->ai_socktype,
 -			   resp->ai_protocol);
-+	s = socket(resp->ai_family, resp->ai_socktype,
-+		   resp->ai_protocol);
- 
+-
 -		if (s == -1) 
 -			/* See if there's another address that will work... */
 -			continue;
@@ -50,7 +48,9 @@
 -			close(s);
 -			continue;
 -		}
--
++	s = socket(resp->ai_family, resp->ai_socktype,
++		   resp->ai_protocol);
+ 
 -		freeaddrinfo(all_ai);
 -		return s;
 +	if (s == -1) 
@@ -76,8 +76,8 @@
  }
  
  
-@@ -373,24 +344,52 @@
- 	return(getsockopt(fd, SOL_SOCKET, SO_TYPE, (char *)&v, &l) == 0);
+@@ -382,24 +353,52 @@ static RETSIGTYPE sigchld_handler(UNUSED
+ #endif
  }
  
 +#define	MAXSOCK	20
@@ -137,7 +137,7 @@
  
  	/* now accept incoming connections - forking a new process
  	   for each incoming connection */
-@@ -407,49 +406,54 @@
+@@ -416,42 +415,47 @@ void start_accept_loop(int port, int (*f
  		log_close();
  
  		FD_ZERO(&fds);
@@ -149,33 +149,15 @@
 +		if (select(maxsock + 1, &fds, NULL, NULL, NULL) < 0)
  			continue;
 -		}
- 
+-
 -		if(!FD_ISSET(s, &fds)) continue;
-+		for (i = 0; i < nsock; i++) {
-+			if (!FD_ISSET(s[i], &fds))
-+				continue;
  
 -		fd = accept(s,(struct sockaddr *)&addr,&addrlen);
-+			fd = accept(s[i], (struct sockaddr *)&addr, &addrlen);
- 
+-
 -		if (fd == -1) continue;
-+			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
- 
+-
+-		signal(SIGCHLD, sigchld_handler);
+-
 -		if ((pid = fork()) == 0) {
 -			int ret;
 -			close(s);
@@ -198,6 +180,17 @@
 -		} 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++)
@@ -209,7 +202,7 @@
 +				close_all();
 +				_exit(ret);
 +			} else if (pid < 0) {
-+					rprintf(FERROR,
++				rprintf(FERROR,
 +					RSYNC_NAME
 +					": could not create child server process: %s\n",
 +					strerror(errno));
>Release-Note:
>Audit-Trail:
>Unformatted: