Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Oct 2002 20:41:42 -0700
From:      Kris Kennaway <kris@obsecurity.org>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        Robert Watson <rwatson@FreeBSD.org>, current@FreeBSD.org, alfred@FreeBSD.org
Subject:   Re: rpcbind failure mode non-ideal if run more than once
Message-ID:  <20021003034142.GA88468@xor.obsecurity.org>
In-Reply-To: <20021003033851.GA88334@xor.obsecurity.org>
References:  <Pine.NEB.3.96L.1021002124819.46964D-100000@fledge.watson.org> <20021003033434.GA87595@xor.obsecurity.org> <20021003033851.GA88334@xor.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Oct 02, 2002 at 08:38:51PM -0700, Kris Kennaway wrote:
> On Wed, Oct 02, 2002 at 08:34:34PM -0700, Kris Kennaway wrote:
> 
> > +				    (hosts[nhostsbak] = NULL) ? hosts[nhostsbak] : "*",
> 
> Silly last-minute typo                                ==

Dammit.

Index: rpcbind.c
===================================================================
RCS file: /usr/home/ncvs/src/usr.sbin/rpcbind/rpcbind.c,v
retrieving revision 1.4
diff -u -r1.4 rpcbind.c
--- rpcbind.c	22 Jul 2002 15:22:53 -0000	1.4
+++ rpcbind.c	3 Oct 2002 03:39:40 -0000
@@ -359,17 +359,18 @@
 			    servname, &hints, &res)) != 0) {
 				syslog(LOG_ERR, "cannot get local address for %s: %s",
 				    nconf->nc_netid, gai_strerror(aicode));
-				continue;
+				goto error;
 			}
 			addrlen = res->ai_addrlen;
 			sa = (struct sockaddr *)res->ai_addr;
 			oldmask = umask(S_IXUSR|S_IXGRP|S_IXOTH);
 			if (bind(fd, sa, addrlen) != 0) {
 				syslog(LOG_ERR, "cannot bind %s on %s: %m",
-					hosts[nhostsbak], nconf->nc_netid);
+				    (hosts[nhostsbak] == NULL) ? "*" : hosts[nhostsbak],
+				    nconf->nc_netid);
 				if (res != NULL)
 					freeaddrinfo(res);
-				continue;
+				goto error;
 			} else
 				checkbind++;
 			(void) umask(oldmask);
@@ -382,7 +383,7 @@
 				    nconf->nc_netid);
 				if (res != NULL)
 					freeaddrinfo(res);
-				return 1;
+				goto error;
 			}
 			memcpy(taddr.addr.buf, sa, addrlen);
 #ifdef ND_DEBUG

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021003034142.GA88468>