packages: rpcbind/rpcbind.spec, rpcbind/rpcbind-SO_REUSEADDR.patch (NEW), r...

baggins baggins at pld-linux.org
Fri Sep 17 14:14:11 CEST 2010


Author: baggins                      Date: Fri Sep 17 12:14:11 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- rel 2
- bugfixes from upstream

---- Files affected:
packages/rpcbind:
   rpcbind.spec (1.17 -> 1.18) , rpcbind-SO_REUSEADDR.patch (NONE -> 1.1)  (NEW), rpcbind-nofork.patch (NONE -> 1.1)  (NEW), rpcbind-usage.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/rpcbind/rpcbind.spec
diff -u packages/rpcbind/rpcbind.spec:1.17 packages/rpcbind/rpcbind.spec:1.18
--- packages/rpcbind/rpcbind.spec:1.17	Wed Apr 21 15:04:10 2010
+++ packages/rpcbind/rpcbind.spec	Fri Sep 17 14:14:06 2010
@@ -3,7 +3,7 @@
 Summary(pl.UTF-8):	Demon odwzorowujący adresy uniwersalne na numery programów RPC
 Name:		rpcbind
 Version:	0.2.0
-Release:	1
+Release:	2
 License:	GPL
 Group:		Daemons
 Source0:	http://dl.sourceforge.net/rpcbind/%{name}-%{version}.tar.bz2
@@ -13,6 +13,9 @@
 Patch0:		%{name}-libwrap.patch
 Patch1:		%{name}-syslog.patch
 Patch2:		%{name}-sunrpc.patch
+Patch3:		%{name}-usage.patch
+Patch4:		%{name}-SO_REUSEADDR.patch
+Patch5:		%{name}-nofork.patch
 # http://nfsv4.bullopensource.org/doc/tirpc_rpcbind.php
 URL:		http://sourceforge.net/projects/rpcbind/
 BuildRequires:	autoconf
@@ -48,6 +51,9 @@
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
 
 %build
 %{__libtoolize}
@@ -112,6 +118,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.18  2010/09/17 12:14:06  baggins
+- rel 2
+- bugfixes from upstream
+
 Revision 1.17  2010/04/21 13:04:10  baggins
 - 0.2.0
 

================================================================
Index: packages/rpcbind/rpcbind-SO_REUSEADDR.patch
diff -u /dev/null packages/rpcbind/rpcbind-SO_REUSEADDR.patch:1.1
--- /dev/null	Fri Sep 17 14:14:11 2010
+++ packages/rpcbind/rpcbind-SO_REUSEADDR.patch	Fri Sep 17 14:14:05 2010
@@ -0,0 +1,47 @@
+commit 68556dc512493868960b367406e04d7169c003a8
+Author: Jeff Layton <jlayton at redhat.com>
+Date:   Tue Jun 22 17:33:14 2010 -0400
+
+    nd: set SO_REUSEADDR on NC_TPI_COTS listening sockets
+    
+    I previously sent this patch to the libtirpc-devel list but got no
+    response. Resending with wider distribution...
+    
+    If we don't set SO_REUSEADDR, then if there are any sockets on this port
+    in TIME_WAIT state when rpcbind is restarted then that will prevent the
+    bind() call from succeeding.
+    
+    Details of the problem are here:
+    
+        https://bugzilla.redhat.com/show_bug.cgi?id=597356
+    
+    Signed-off-by: Jeff Layton <jlayton at redhat.com>
+    Signed-off-by: Steve Dickson <steved at redhat.com>
+
+diff --git a/src/rpcbind.c b/src/rpcbind.c
+index ddf2cfc..c8f0d9f 100644
+--- a/src/rpcbind.c
++++ b/src/rpcbind.c
+@@ -276,6 +276,7 @@ init_transport(struct netconfig *nconf)
+ 	int addrlen = 0;
+ 	int nhostsbak;
+ 	int checkbind;
++	int on = 1;
+ 	struct sockaddr *sa = NULL;
+ 	u_int32_t host_addr[4];  /* IPv4 or IPv6 */
+ 	struct sockaddr_un sun;
+@@ -493,6 +494,14 @@ init_transport(struct netconfig *nconf)
+ 		}
+ 		oldmask = umask(S_IXUSR|S_IXGRP|S_IXOTH);
+ 		__rpc_fd2sockinfo(fd, &si);
++		if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on,
++				sizeof(on)) != 0) {
++			syslog(LOG_ERR, "cannot set SO_REUSEADDR on %s",
++				nconf->nc_netid);
++			if (res != NULL)
++				freeaddrinfo(res);
++			return 1;
++		}
+ 		if (bind(fd, sa, addrlen) < 0) {
+ 			syslog(LOG_ERR, "cannot bind %s: %m", nconf->nc_netid);
+ 			if (res != NULL)

================================================================
Index: packages/rpcbind/rpcbind-nofork.patch
diff -u /dev/null packages/rpcbind/rpcbind-nofork.patch:1.1
--- /dev/null	Fri Sep 17 14:14:11 2010
+++ packages/rpcbind/rpcbind-nofork.patch	Fri Sep 17 14:14:06 2010
@@ -0,0 +1,72 @@
+commit eb36cf198795b09c1ba796044fc99fa40c5a2b33
+Author: Steve Dickson <steved at redhat.com>
+Date:   Tue Jul 13 15:52:18 2010 -0400
+
+    rpcbind: add no-fork mode
+    
+    Signed-off-by: Lennart Poettering <lennart at poettering.net>
+    Signed-off-by: Steve Dickson <steved at redhat.com>
+
+diff --git a/man/rpcbind.8 b/man/rpcbind.8
+index 32806d4..c5b8fb7 100644
+--- a/man/rpcbind.8
++++ b/man/rpcbind.8
+@@ -82,6 +82,8 @@ during operation, and will abort on certain errors if
+ is also specified.
+ With this option, the name-to-address translation consistency
+ checks are shown in detail.
++.It Fl f
++Do not fork and become a background process.
+ .It Fl h
+ Specify specific IP addresses to bind to for UDP requests.
+ This option
+diff --git a/src/rpcbind.c b/src/rpcbind.c
+index c8f0d9f..63023e1 100644
+--- a/src/rpcbind.c
++++ b/src/rpcbind.c
+@@ -77,6 +77,7 @@
+ 
+ int debugging = 0;	/* Tell me what's going on */
+ int doabort = 0;	/* When debugging, do an abort on errors */
++int dofork = 1;		/* fork? */
+ 
+ rpcblist_ptr list_rbl;	/* A list of version 3/4 rpcbind services */
+ 
+@@ -213,8 +214,8 @@ main(int argc, char *argv[])
+ 			printf("\n");
+ 		}
+ #endif
+-	} else {
+-		if (daemon(0, 0)) 
++	} else if (dofork) {
++		if (daemon(0, 0))
+         		err(1, "fork failed");
+ 	}
+ 
+@@ -740,7 +741,7 @@ parseargs(int argc, char *argv[])
+ {
+ 	int c;
+ 	oldstyle_local = 1;
+-	while ((c = getopt(argc, argv, "adh:ilsw")) != -1) {
++	while ((c = getopt(argc, argv, "adh:ilswf")) != -1) {
+ 		switch (c) {
+ 		case 'a':
+ 			doabort = 1;	/* when debugging, do an abort on */
+@@ -767,13 +768,16 @@ parseargs(int argc, char *argv[])
+ 		case 's':
+ 			runasdaemon = 1;
+ 			break;
++		case 'f':
++			dofork = 0;
++			break;
+ #ifdef WARMSTART
+ 		case 'w':
+ 			warmstart = 1;
+ 			break;
+ #endif
+ 		default:	/* error */
+-			fprintf(stderr,	"usage: rpcbind [-adhilsw]\n");
++			fprintf(stderr,	"usage: rpcbind [-adhilswf]\n");
+ 			exit (1);
+ 		}
+ 	}

================================================================
Index: packages/rpcbind/rpcbind-usage.patch
diff -u /dev/null packages/rpcbind/rpcbind-usage.patch:1.1
--- /dev/null	Fri Sep 17 14:14:11 2010
+++ packages/rpcbind/rpcbind-usage.patch	Fri Sep 17 14:14:06 2010
@@ -0,0 +1,31 @@
+commit c5e04d3ef1b4d9a24741dc865aaa55b07fe3c89f
+Author: Steve Dickson <steved at redhat.com>
+Date:   Thu Jun 25 08:41:29 2009 -0400
+
+    Corrected the usage info to match what the rpcbind man
+    page says.
+    
+    Signed-off-by: Steve Dickson <steved at redhat.com>
+
+diff --git a/src/rpcbind.c b/src/rpcbind.c
+index 525ffba..ddf2cfc 100644
+--- a/src/rpcbind.c
++++ b/src/rpcbind.c
+@@ -731,7 +731,7 @@ parseargs(int argc, char *argv[])
+ {
+ 	int c;
+ 	oldstyle_local = 1;
+-	while ((c = getopt(argc, argv, "dwah:ils")) != -1) {
++	while ((c = getopt(argc, argv, "adh:ilsw")) != -1) {
+ 		switch (c) {
+ 		case 'a':
+ 			doabort = 1;	/* when debugging, do an abort on */
+@@ -764,7 +764,7 @@ parseargs(int argc, char *argv[])
+ 			break;
+ #endif
+ 		default:	/* error */
+-			fprintf(stderr,	"usage: rpcbind [-Idwils]\n");
++			fprintf(stderr,	"usage: rpcbind [-adhilsw]\n");
+ 			exit (1);
+ 		}
+ 	}
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/rpcbind/rpcbind.spec?r1=1.17&r2=1.18&f=u



More information about the pld-cvs-commit mailing list