summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpcbind
diff options
context:
space:
mode:
authormbr <mbr@FreeBSD.org>2002-12-16 22:24:26 +0000
committermbr <mbr@FreeBSD.org>2002-12-16 22:24:26 +0000
commitd975ae88c1d27ae949bace4ebe9916bc7be8afbf (patch)
tree1c9982dd57f64d9d27d246e74bbbce9267211200 /usr.sbin/rpcbind
parent08b76459f3f8f388a66abdc41491604856d7b9ef (diff)
downloadFreeBSD-src-d975ae88c1d27ae949bace4ebe9916bc7be8afbf.zip
FreeBSD-src-d975ae88c1d27ae949bace4ebe9916bc7be8afbf.tar.gz
Change the name for the local unix-socket based protocol
from "unix" back to "local". Add some compat stuff so both ways work for some time. Reviewed by: phk Approved by: imp (UPDATING) Requested by: iedowse, lukem@netbsd.org
Diffstat (limited to 'usr.sbin/rpcbind')
-rw-r--r--usr.sbin/rpcbind/rpcbind.c17
-rw-r--r--usr.sbin/rpcbind/security.c2
2 files changed, 13 insertions, 6 deletions
diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.c
index b2ad5f1..9a12ac0 100644
--- a/usr.sbin/rpcbind/rpcbind.c
+++ b/usr.sbin/rpcbind/rpcbind.c
@@ -158,7 +158,9 @@ main(int argc, char *argv[])
tcptrans = "";
#endif
- nconf = getnetconfigent("unix");
+ nconf = getnetconfigent("local");
+ if (nconf == NULL)
+ nconf = getnetconfigent("unix");
if (nconf == NULL) {
syslog(LOG_ERR, "%s: can't find local transport\n", argv[0]);
exit(1);
@@ -279,7 +281,8 @@ init_transport(struct netconfig *nconf)
return (1);
}
- if (!strcmp(nconf->nc_netid, "unix")) {
+ if ((strcmp(nconf->nc_netid, "local") == 0) ||
+ (strcmp(nconf->nc_netid, "unix") == 0)) {
memset(&sun, 0, sizeof sun);
sun.sun_family = AF_LOCAL;
unlink(_PATH_RPCBINDSOCK);
@@ -438,7 +441,8 @@ init_transport(struct netconfig *nconf)
if (!checkbind)
return 1;
} else {
- if (strcmp(nconf->nc_netid, "unix") != 0) {
+ if ((strcmp(nconf->nc_netid, "local") != 0) &&
+ (strcmp(nconf->nc_netid, "unix") != 0)) {
if ((aicode = getaddrinfo(NULL, servname, &hints, &res))
!= 0) {
syslog(LOG_ERR,
@@ -502,7 +506,8 @@ init_transport(struct netconfig *nconf)
if ((strcmp(nconf->nc_protofmly, NC_INET) == 0 &&
(strcmp(nconf->nc_proto, NC_TCP) == 0 ||
strcmp(nconf->nc_proto, NC_UDP) == 0)) ||
- strcmp(nconf->nc_netid, "unix") == 0) {
+ (strcmp(nconf->nc_netid, "unix") == 0) ||
+ (strcmp(nconf->nc_netid, "local") == 0)) {
struct pmaplist *pml;
if (!svc_register(my_xprt, PMAPPROG, PMAPVERS,
@@ -543,7 +548,9 @@ init_transport(struct netconfig *nconf)
/* Let's snarf the universal address */
/* "h1.h2.h3.h4.p1.p2" */
udp_uaddr = taddr2uaddr(nconf, &taddr.addr);
- } else if (strcmp(nconf->nc_netid, "unix") == 0)
+ } else if (strcmp(nconf->nc_netid, "local") == 0)
+ pml->pml_map.pm_prot = IPPROTO_ST;
+ else if (strcmp(nconf->nc_netid, "unix") == 0)
pml->pml_map.pm_prot = IPPROTO_ST;
pml->pml_next = list_pml;
list_pml = pml;
diff --git a/usr.sbin/rpcbind/security.c b/usr.sbin/rpcbind/security.c
index 61cea5a..8657247 100644
--- a/usr.sbin/rpcbind/security.c
+++ b/usr.sbin/rpcbind/security.c
@@ -214,7 +214,7 @@ logit(int severity, struct sockaddr *addr, rpcproc_t procnum, rpcprog_t prognum,
/* Write syslog record. */
if (addr->sa_family == AF_LOCAL)
- strcpy(fromname, "unix");
+ strcpy(fromname, "local");
else
getnameinfo(addr, addr->sa_len, fromname,
sizeof fromname, NULL, 0, NI_NUMERICHOST);
OpenPOWER on IntegriCloud