rpms/rpcbind/devel rpcbind-0.1.4-warmstarts-cleanup.patch, NONE, 1.1 rpcbind.init, 1.9, 1.10 rpcbind.spec, 1.25, 1.26

Steve Dickson (steved) fedora-extras-commits at redhat.com
Mon Feb 11 16:06:51 UTC 2008


Author: steved

Update of /cvs/pkgs/rpms/rpcbind/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv2830

Modified Files:
	rpcbind.init rpcbind.spec 
Added Files:
	rpcbind-0.1.4-warmstarts-cleanup.patch 
Log Message:
- Fixed a warning in pmap_svc.c
- Cleaned up warmstarts so uid are longer needed, also
  changed condrestarts to use warmstarts. (bz 428496)


rpcbind-0.1.4-warmstarts-cleanup.patch:

--- NEW FILE rpcbind-0.1.4-warmstarts-cleanup.patch ---
commit 40009ddc661a43883d0f7841f6bbd71e0c9b530a
Author: Steve Dickson <steved at redhat.com>
Date:   Fri Feb 8 14:27:57 2008 -0500

    Fixed a warning in pmap_svc.c
	Cleaned up read_struct().
		    
Signed-off-by: Steve Dickson <steved at redhat.com>
diff -up rpcbind-0.1.4/src/rpcbind.c.save rpcbind-0.1.4/src/rpcbind.c
--- rpcbind-0.1.4/src/rpcbind.c.save	2008-02-11 10:10:01.000000000 -0500
+++ rpcbind-0.1.4/src/rpcbind.c	2008-02-11 10:16:14.000000000 -0500
@@ -193,11 +193,7 @@ main(int argc, char *argv[])
 	(void) signal(SIGHUP, SIG_IGN);
 	(void) signal(SIGUSR1, SIG_IGN);
 	(void) signal(SIGUSR2, SIG_IGN);
-#ifdef WARMSTART
-	if (warmstart) {
-		read_warmstart();
-	}
-#endif
+
 	if (debugging) {
 #ifdef RPCBIND_DEBUG 
 		printf("rpcbind debugging enabled.");
@@ -226,6 +222,12 @@ main(int argc, char *argv[])
 		}
 	}
 
+#ifdef WARMSTART
+	if (warmstart) {
+		read_warmstart();
+	}
+#endif
+
 	network_init();
 
 	my_svc_run();
diff -up rpcbind-0.1.4/src/warmstart.c.save rpcbind-0.1.4/src/warmstart.c
--- rpcbind-0.1.4/src/warmstart.c.save	2008-02-11 10:10:01.000000000 -0500
+++ rpcbind-0.1.4/src/warmstart.c	2008-02-11 10:16:14.000000000 -0500
@@ -45,22 +45,19 @@
 #endif
 #include <syslog.h>
 #include <unistd.h>
+#include <errno.h>
 
 #include "config.h"
 #include "rpcbind.h"
 
-/*
- * XXX this code is unsafe and is not used. It should be made safe.
- */
-
 #ifndef RPCBIND_STATEDIR
 #define RPCBIND_STATEDIR "/tmp"
 #endif
 
 /* These files keep the pmap_list and rpcb_list in XDR format */
-#define	RPCBFILE	RPCBIND_STATEDIR "/rpcbind.file"
+#define	RPCBFILE	RPCBIND_STATEDIR "/rpcbind.xdr"
 #ifdef PORTMAP
-#define	PMAPFILE	RPCBIND_STATEDIR "/portmap.file"
+#define	PMAPFILE	RPCBIND_STATEDIR "/portmap.xdr"
 #endif
 
 static bool_t write_struct __P((char *, xdrproc_t, void *));
@@ -92,7 +89,7 @@ write_struct(char *filename, xdrproc_t s
 	xdrstdio_create(&xdrs, fp, XDR_ENCODE);
 
 	if (structproc(&xdrs, list) == FALSE) {
-		syslog(LOG_ERR, "rpcbind: xdr_%s: failed", filename);
+		syslog(LOG_ERR, "xdr_%s: failed", filename);
 		fclose(fp);
 		return (FALSE);
 	}
@@ -107,37 +104,39 @@ read_struct(char *filename, xdrproc_t st
 	FILE *fp;
 	XDR xdrs;
 	struct stat sbuf;
-
-	if (stat(filename, &sbuf) != 0) {
-		fprintf(stderr,
-		"rpcbind: cannot stat file = %s for reading\n", filename);
-		goto error;
-	}
-	if ((sbuf.st_uid != 0) || (sbuf.st_mode & S_IRWXG) ||
-	    (sbuf.st_mode & S_IRWXO)) {
-		fprintf(stderr,
-		"rpcbind: invalid permissions on file = %s for reading\n",
-			filename);
-		goto error;
-	}
-	fp = fopen(filename, "r");
-	if (fp == NULL) {
-		fprintf(stderr,
-		"rpcbind: cannot open file = %s for reading\n", filename);
+	 
+	if (debugging)
+		fprintf(stderr, "rpcbind: using '%s' startup file\n", filename);
+
+	if ((fp = fopen(filename, "r")) == NULL) {
+		syslog(LOG_ERR,
+			"Cannot open '%s' file for reading, errno %d (%s)", 
+			filename, errno, strerror(errno));
 		goto error;
 	}
-	xdrstdio_create(&xdrs, fp, XDR_DECODE);
 
+	xdrstdio_create(&xdrs, fp, XDR_DECODE);
 	if (structproc(&xdrs, list) == FALSE) {
 		fprintf(stderr, "rpcbind: xdr_%s: failed\n", filename);
 		fclose(fp);
 		goto error;
 	}
 	XDR_DESTROY(&xdrs);
+
 	fclose(fp);
+	if (unlink(filename) < 0) {
+		syslog(LOG_ERR, "Cannot unlink '%s', errno %d (%s)", 
+			filename, errno, strerror(errno));
+	}
 	return (TRUE);
 
-error:	fprintf(stderr, "rpcbind: will start from scratch\n");
+error:	
+	if (errno != ENOENT && unlink(filename) < 0) {
+		syslog(LOG_ERR, "Cannot unlink '%s', errno %d (%s)", 
+			filename, errno, strerror(errno));
+	}
+	if (debugging)
+		fprintf(stderr, "rpcbind: will start from scratch\n");
 	return (FALSE);
 }
 
@@ -145,9 +144,9 @@ void
 write_warmstart()
 {
 	(void) write_struct(RPCBFILE, (xdrproc_t)xdr_rpcblist_ptr, &list_rbl);
-	#ifdef PORTMAP
-		(void) write_struct(PMAPFILE, (xdrproc_t)xdr_pmaplist_ptr, &list_pml);
-	#endif
+#ifdef PORTMAP
+	(void) write_struct(PMAPFILE, (xdrproc_t)xdr_pmaplist_ptr, &list_pml);
+#endif
 
 }
 
@@ -158,22 +157,20 @@ read_warmstart()
 #ifdef PORTMAP
 	struct pmaplist *tmp_pmapl = NULL;
 #endif
-	int ok1, ok2 = TRUE;
+	int rc;
+
+	rc = read_struct(RPCBFILE, (xdrproc_t)xdr_rpcblist_ptr, &tmp_rpcbl);
+	if (rc == TRUE) {
+		xdr_free((xdrproc_t) xdr_rpcblist_ptr, (char *)&list_rbl);
+		list_rbl = tmp_rpcbl;
+	}
+#ifdef PORTMAP
+	rc = read_struct(PMAPFILE, (xdrproc_t)xdr_pmaplist_ptr, &tmp_pmapl);
+	if (rc == TRUE) {
+		xdr_free((xdrproc_t) xdr_pmaplist_ptr, (char *)&list_pml);
+		list_pml = tmp_pmapl;
+	}
+#endif
 
-	ok1 = read_struct(RPCBFILE, (xdrproc_t)xdr_rpcblist_ptr, &tmp_rpcbl);
-	if (ok1 == FALSE)
-		return;
-	#ifdef PORTMAP
-	ok2 = read_struct(PMAPFILE, (xdrproc_t)xdr_pmaplist_ptr, &tmp_pmapl);
-	#endif
-	if (ok2 == FALSE) {
-		xdr_free((xdrproc_t) xdr_rpcblist_ptr, (char *)&tmp_rpcbl);
-		return;
-	}
-	xdr_free((xdrproc_t) xdr_rpcblist_ptr, (char *)&list_rbl);
-	list_rbl = tmp_rpcbl;
-	#ifdef PORTMAP
-	xdr_free((xdrproc_t) xdr_pmaplist_ptr, (char *)&list_pml);
-	list_pml = tmp_pmapl;
-	#endif
+	return;
 }
diff -up rpcbind-0.1.4/src/pmap_svc.c.save rpcbind-0.1.4/src/pmap_svc.c
--- rpcbind-0.1.4/src/pmap_svc.c.save	2008-02-11 10:15:34.000000000 -0500
+++ rpcbind-0.1.4/src/pmap_svc.c	2008-02-11 10:16:14.000000000 -0500
@@ -314,7 +314,7 @@ pmapproc_getport(struct svc_req *rqstp /
 			if ((pt2 = strrchr(ua, '.')) != NULL) {
 				*pt2 = 0;
 				snprintf(serveuaddr, sizeof serveuaddr,
-			 		"%s.%d.%d", ua,
+			 		"%s.%ld.%ld", ua,
 					(fnd->pml_map.pm_port >> 8) & 0xff,
 			 		(fnd->pml_map.pm_port) & 0xff);
 				*pt2 = '.';


Index: rpcbind.init
===================================================================
RCS file: /cvs/pkgs/rpms/rpcbind/devel/rpcbind.init,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- rpcbind.init	17 Oct 2007 18:41:39 -0000	1.9
+++ rpcbind.init	11 Feb 2008 16:06:13 -0000	1.10
@@ -43,7 +43,7 @@
 	[ -f /sbin/$prog ] || exit 5
 
 	echo -n $"Starting $prog: "
-	daemon $prog $RPCBIND_ARGS
+	daemon $prog $RPCBIND_ARGS $1
 	RETVAL=$?
 	echo
 	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
@@ -81,7 +81,7 @@
   condrestart)
 	if [ -f /var/lock/subsys/$prog ]; then
 		$0 stop
-		$0 start
+		$0 start -w
 	fi
 	;;
   *)


Index: rpcbind.spec
===================================================================
RCS file: /cvs/pkgs/rpms/rpcbind/devel/rpcbind.spec,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- rpcbind.spec	24 Jan 2008 18:52:43 -0000	1.25
+++ rpcbind.spec	11 Feb 2008 16:06:13 -0000	1.26
@@ -2,7 +2,7 @@
 
 Name:           rpcbind
 Version:        0.1.4
-Release: 		13%{?dist}
+Release: 		14%{?dist}
 Summary:        Universal Addresses to RPC Program Number Mapper
 Group:          System Environment/Daemons
 License:        GPL
@@ -33,6 +33,7 @@
 Patch6: rpcbind-0.1.4-libwrap.patch
 Patch7: rpcbind-0.1.4-localaddr.patch
 Patch8: rpcbind-0.1.4-recvfrom-fix.patch
+Patch9: rpcbind-0.1.4-warmstarts-cleanup.patch
 
 %description
 The rpcbind utility is a server that converts RPC program numbers into
@@ -54,6 +55,8 @@
 %patch7 -p1
 # 244492: New rpcbind breaks connectivity with some NIS clients
 %patch8 -p1
+#428496: rpcbind-0.1.4-12.fc8.x86_64.rpm does not update properly
+%patch9 -p1
 
 %build
 %ifarch s390 s390x
@@ -133,6 +136,11 @@
 %dir %attr(700,rpc,rpc) /var/lib/rpcbind
 
 %changelog
+* Mon Feb 11 2008 Steve Dickson <steved at redhat.com> 0.1.4-14
+- Fixed a warning in pmap_svc.c
+- Cleaned up warmstarts so uid are longer needed, also
+  changed condrestarts to use warmstarts. (bz 428496)
+
 * Thu Jan 24 2008 Steve Dickson <steved at redhat.com> 0.1.4-13
 - Fixed connectivity with Mac OS clients by making sure handle_reply()
   sets the correct fromlen in its recvfrom() call (bz 244492)




More information about the fedora-extras-commits mailing list