summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--UPDATING7
-rw-r--r--etc/netconfig2
-rw-r--r--lib/libc/rpc/getnetconfig.c12
-rw-r--r--lib/libc/rpc/rpc_generic.c19
-rw-r--r--lib/libypclnt/ypclnt_passwd.c4
-rw-r--r--usr.bin/rpcinfo/rpcinfo.c2
-rw-r--r--usr.sbin/rpcbind/rpcbind.c17
-rw-r--r--usr.sbin/rpcbind/security.c2
8 files changed, 51 insertions, 14 deletions
diff --git a/UPDATING b/UPDATING
index 35cbfb7..e606137 100644
--- a/UPDATING
+++ b/UPDATING
@@ -17,6 +17,13 @@ NOTE TO PEOPLE WHO THINK THAT 5.0-CURRENT IS SLOW:
developers choose to disable these features on build machines
to maximize performance.
+20021216:
+ A name change in /etc/netconfig has been reverted to stay
+ compatible with with suns TIRPC and also with NetBSD. You need
+ to run mergemaster after make world. A new libc does still work
+ with a outdated /etc/netconfig for some time, but you'll get
+ a warning. This warning will be removed in 20030301.
+
20021202:
The recent binutils upgrade marks a kernel flag day on
sparc64: modules built with the old binutils will not work
diff --git a/etc/netconfig b/etc/netconfig
index 6e6abd0..109f2e3 100644
--- a/etc/netconfig
+++ b/etc/netconfig
@@ -16,4 +16,4 @@ tcp6 tpi_cots_ord v inet6 tcp - -
udp tpi_clts v inet udp - -
tcp tpi_cots_ord v inet tcp - -
rawip tpi_raw - inet - - -
-unix tpi_cots_ord - loopback - - -
+local tpi_cots_ord - loopback - - -
diff --git a/lib/libc/rpc/getnetconfig.c b/lib/libc/rpc/getnetconfig.c
index d959687..3700850 100644
--- a/lib/libc/rpc/getnetconfig.c
+++ b/lib/libc/rpc/getnetconfig.c
@@ -418,6 +418,18 @@ getnetconfigent(netid)
return (NULL);
}
+ if (strcmp(netid, "unix") == 0) {
+ fprintf(stderr, "The local transport is called \"unix\" ");
+ fprintf(stderr, "in /etc/netconfig.\n");
+ fprintf(stderr, "Please change this to \"local\" manually ");
+ fprintf(stderr, "or run mergemaster(8).\n");
+ fprintf(stderr, "See UPDATING entry 20021216 for details.\n");
+ fprintf(stderr, "Continuing in 10 seconds\n\n");
+ fprintf(stderr, "This warning will be removed 20030301\n");
+ sleep(10);
+
+ }
+
/*
* Look up table if the entries have already been read and parsed in
* getnetconfig(), then copy this entry into a buffer and return it.
diff --git a/lib/libc/rpc/rpc_generic.c b/lib/libc/rpc/rpc_generic.c
index 3223997..1813920 100644
--- a/lib/libc/rpc/rpc_generic.c
+++ b/lib/libc/rpc/rpc_generic.c
@@ -98,7 +98,7 @@ static const struct netid_af na_cvt[] = {
{ "udp6", AF_INET6, IPPROTO_UDP },
{ "tcp6", AF_INET6, IPPROTO_TCP },
#endif
- { "unix", AF_LOCAL, 0 }
+ { "local", AF_LOCAL, 0 }
};
#if 0
@@ -524,7 +524,9 @@ __rpc_nconf2sockinfo(const struct netconfig *nconf, struct __rpc_sockinfo *sip)
int i;
for (i = 0; i < (sizeof na_cvt) / (sizeof (struct netid_af)); i++)
- if (!strcmp(na_cvt[i].netid, nconf->nc_netid)) {
+ if (strcmp(na_cvt[i].netid, nconf->nc_netid) == 0 || (
+ strcmp(nconf->nc_netid, "unix") == 0 &&
+ strcmp(na_cvt[i].netid, "local") == 0)) {
sip->si_af = na_cvt[i].af;
sip->si_proto = na_cvt[i].protocol;
sip->si_socktype =
@@ -554,13 +556,20 @@ __rpc_sockinfo2netid(struct __rpc_sockinfo *sip, const char **netid)
{
int i;
- for (i = 0; i < (sizeof na_cvt) / (sizeof (struct netid_af)); i++)
+ for (i = 0; i < (sizeof na_cvt) / (sizeof (struct netid_af)); i++) {
if (na_cvt[i].af == sip->si_af &&
na_cvt[i].protocol == sip->si_proto) {
- if (netid)
- *netid = na_cvt[i].netid;
+ if (strcmp(na_cvt[i].netid, "local") == 0 &&
+ getnetconfigent("local") == NULL) {
+ if (netid)
+ *netid = "unix";
+ } else {
+ if (netid)
+ *netid = na_cvt[i].netid;
+ }
return 1;
}
+ }
return 0;
}
diff --git a/lib/libypclnt/ypclnt_passwd.c b/lib/libypclnt/ypclnt_passwd.c
index 0dd6569..076408f 100644
--- a/lib/libypclnt/ypclnt_passwd.c
+++ b/lib/libypclnt/ypclnt_passwd.c
@@ -154,7 +154,9 @@ yppasswd_local(ypclnt_t *ypclnt, const struct passwd *pwd, const char *passwd)
}
/* connect to rpc.yppasswdd */
- nc = getnetconfigent("unix");
+ nc = getnetconfigent("local");
+ if (nc == NULL)
+ nc = getnetconfigent("unix");
clnt = clnt_tp_create(ypclnt->server, YPPASSWDPROG, YPPASSWDVERS, nc);
if (clnt == NULL) {
ypclnt_error(ypclnt, __func__,
diff --git a/usr.bin/rpcinfo/rpcinfo.c b/usr.bin/rpcinfo/rpcinfo.c
index bbe6a17..b8f6c1c 100644
--- a/usr.bin/rpcinfo/rpcinfo.c
+++ b/usr.bin/rpcinfo/rpcinfo.c
@@ -545,7 +545,7 @@ pmapdump(int argc, char **argv)
else if (head->pml_map.pm_prot == IPPROTO_TCP)
printf("%6s", "tcp");
else if (head->pml_map.pm_prot == IPPROTO_ST)
- printf("%6s", "unix");
+ printf("%6s", "local");
else
printf("%6ld", head->pml_map.pm_prot);
printf("%7ld", head->pml_map.pm_port);
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