diff options
| author | Martin Blapp <mbr@FreeBSD.org> | 2002-12-16 22:24:26 +0000 |
|---|---|---|
| committer | Martin Blapp <mbr@FreeBSD.org> | 2002-12-16 22:24:26 +0000 |
| commit | fb4c80619a9d305abdd8b73ec6436693d6052899 (patch) | |
| tree | 1c9982dd57f64d9d27d246e74bbbce9267211200 /usr.sbin/rpcbind | |
| parent | 6f8a5ea2005c75c8e84ab0df5d0efa655459e196 (diff) | |
Notes
Diffstat (limited to 'usr.sbin/rpcbind')
| -rw-r--r-- | usr.sbin/rpcbind/rpcbind.c | 17 | ||||
| -rw-r--r-- | usr.sbin/rpcbind/security.c | 2 |
2 files changed, 13 insertions, 6 deletions
diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.c index b2ad5f1de65f..9a12ac0ced00 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 61cea5ac01bd..8657247f60ac 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); |
