diff options
author | mbr <mbr@FreeBSD.org> | 2002-12-16 22:24:26 +0000 |
---|---|---|
committer | mbr <mbr@FreeBSD.org> | 2002-12-16 22:24:26 +0000 |
commit | d975ae88c1d27ae949bace4ebe9916bc7be8afbf (patch) | |
tree | 1c9982dd57f64d9d27d246e74bbbce9267211200 /lib | |
parent | 08b76459f3f8f388a66abdc41491604856d7b9ef (diff) | |
download | FreeBSD-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 'lib')
-rw-r--r-- | lib/libc/rpc/getnetconfig.c | 12 | ||||
-rw-r--r-- | lib/libc/rpc/rpc_generic.c | 19 | ||||
-rw-r--r-- | lib/libypclnt/ypclnt_passwd.c | 4 |
3 files changed, 29 insertions, 6 deletions
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__, |