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
This commit is contained in:
@@ -17,6 +17,13 @@ NOTE TO PEOPLE WHO THINK THAT 5.0-CURRENT IS SLOW:
|
|||||||
developers choose to disable these features on build machines
|
developers choose to disable these features on build machines
|
||||||
to maximize performance.
|
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:
|
20021202:
|
||||||
The recent binutils upgrade marks a kernel flag day on
|
The recent binutils upgrade marks a kernel flag day on
|
||||||
sparc64: modules built with the old binutils will not work
|
sparc64: modules built with the old binutils will not work
|
||||||
|
|||||||
+1
-1
@@ -16,4 +16,4 @@ tcp6 tpi_cots_ord v inet6 tcp - -
|
|||||||
udp tpi_clts v inet udp - -
|
udp tpi_clts v inet udp - -
|
||||||
tcp tpi_cots_ord v inet tcp - -
|
tcp tpi_cots_ord v inet tcp - -
|
||||||
rawip tpi_raw - inet - - -
|
rawip tpi_raw - inet - - -
|
||||||
unix tpi_cots_ord - loopback - - -
|
local tpi_cots_ord - loopback - - -
|
||||||
|
|||||||
@@ -418,6 +418,18 @@ getnetconfigent(netid)
|
|||||||
return (NULL);
|
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
|
* Look up table if the entries have already been read and parsed in
|
||||||
* getnetconfig(), then copy this entry into a buffer and return it.
|
* getnetconfig(), then copy this entry into a buffer and return it.
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ static const struct netid_af na_cvt[] = {
|
|||||||
{ "udp6", AF_INET6, IPPROTO_UDP },
|
{ "udp6", AF_INET6, IPPROTO_UDP },
|
||||||
{ "tcp6", AF_INET6, IPPROTO_TCP },
|
{ "tcp6", AF_INET6, IPPROTO_TCP },
|
||||||
#endif
|
#endif
|
||||||
{ "unix", AF_LOCAL, 0 }
|
{ "local", AF_LOCAL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
@@ -524,7 +524,9 @@ __rpc_nconf2sockinfo(const struct netconfig *nconf, struct __rpc_sockinfo *sip)
|
|||||||
int i;
|
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 (!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_af = na_cvt[i].af;
|
||||||
sip->si_proto = na_cvt[i].protocol;
|
sip->si_proto = na_cvt[i].protocol;
|
||||||
sip->si_socktype =
|
sip->si_socktype =
|
||||||
@@ -554,13 +556,20 @@ __rpc_sockinfo2netid(struct __rpc_sockinfo *sip, const char **netid)
|
|||||||
{
|
{
|
||||||
int i;
|
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 &&
|
if (na_cvt[i].af == sip->si_af &&
|
||||||
na_cvt[i].protocol == sip->si_proto) {
|
na_cvt[i].protocol == sip->si_proto) {
|
||||||
|
if (strcmp(na_cvt[i].netid, "local") == 0 &&
|
||||||
|
getnetconfigent("local") == NULL) {
|
||||||
|
if (netid)
|
||||||
|
*netid = "unix";
|
||||||
|
} else {
|
||||||
if (netid)
|
if (netid)
|
||||||
*netid = na_cvt[i].netid;
|
*netid = na_cvt[i].netid;
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,6 +154,8 @@ yppasswd_local(ypclnt_t *ypclnt, const struct passwd *pwd, const char *passwd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* connect to rpc.yppasswdd */
|
/* connect to rpc.yppasswdd */
|
||||||
|
nc = getnetconfigent("local");
|
||||||
|
if (nc == NULL)
|
||||||
nc = getnetconfigent("unix");
|
nc = getnetconfigent("unix");
|
||||||
clnt = clnt_tp_create(ypclnt->server, YPPASSWDPROG, YPPASSWDVERS, nc);
|
clnt = clnt_tp_create(ypclnt->server, YPPASSWDPROG, YPPASSWDVERS, nc);
|
||||||
if (clnt == NULL) {
|
if (clnt == NULL) {
|
||||||
|
|||||||
@@ -545,7 +545,7 @@ pmapdump(int argc, char **argv)
|
|||||||
else if (head->pml_map.pm_prot == IPPROTO_TCP)
|
else if (head->pml_map.pm_prot == IPPROTO_TCP)
|
||||||
printf("%6s", "tcp");
|
printf("%6s", "tcp");
|
||||||
else if (head->pml_map.pm_prot == IPPROTO_ST)
|
else if (head->pml_map.pm_prot == IPPROTO_ST)
|
||||||
printf("%6s", "unix");
|
printf("%6s", "local");
|
||||||
else
|
else
|
||||||
printf("%6ld", head->pml_map.pm_prot);
|
printf("%6ld", head->pml_map.pm_prot);
|
||||||
printf("%7ld", head->pml_map.pm_port);
|
printf("%7ld", head->pml_map.pm_port);
|
||||||
|
|||||||
@@ -158,6 +158,8 @@ main(int argc, char *argv[])
|
|||||||
tcptrans = "";
|
tcptrans = "";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
nconf = getnetconfigent("local");
|
||||||
|
if (nconf == NULL)
|
||||||
nconf = getnetconfigent("unix");
|
nconf = getnetconfigent("unix");
|
||||||
if (nconf == NULL) {
|
if (nconf == NULL) {
|
||||||
syslog(LOG_ERR, "%s: can't find local transport\n", argv[0]);
|
syslog(LOG_ERR, "%s: can't find local transport\n", argv[0]);
|
||||||
@@ -279,7 +281,8 @@ init_transport(struct netconfig *nconf)
|
|||||||
return (1);
|
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);
|
memset(&sun, 0, sizeof sun);
|
||||||
sun.sun_family = AF_LOCAL;
|
sun.sun_family = AF_LOCAL;
|
||||||
unlink(_PATH_RPCBINDSOCK);
|
unlink(_PATH_RPCBINDSOCK);
|
||||||
@@ -438,7 +441,8 @@ init_transport(struct netconfig *nconf)
|
|||||||
if (!checkbind)
|
if (!checkbind)
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} 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))
|
if ((aicode = getaddrinfo(NULL, servname, &hints, &res))
|
||||||
!= 0) {
|
!= 0) {
|
||||||
syslog(LOG_ERR,
|
syslog(LOG_ERR,
|
||||||
@@ -502,7 +506,8 @@ init_transport(struct netconfig *nconf)
|
|||||||
if ((strcmp(nconf->nc_protofmly, NC_INET) == 0 &&
|
if ((strcmp(nconf->nc_protofmly, NC_INET) == 0 &&
|
||||||
(strcmp(nconf->nc_proto, NC_TCP) == 0 ||
|
(strcmp(nconf->nc_proto, NC_TCP) == 0 ||
|
||||||
strcmp(nconf->nc_proto, NC_UDP) == 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;
|
struct pmaplist *pml;
|
||||||
|
|
||||||
if (!svc_register(my_xprt, PMAPPROG, PMAPVERS,
|
if (!svc_register(my_xprt, PMAPPROG, PMAPVERS,
|
||||||
@@ -543,7 +548,9 @@ init_transport(struct netconfig *nconf)
|
|||||||
/* Let's snarf the universal address */
|
/* Let's snarf the universal address */
|
||||||
/* "h1.h2.h3.h4.p1.p2" */
|
/* "h1.h2.h3.h4.p1.p2" */
|
||||||
udp_uaddr = taddr2uaddr(nconf, &taddr.addr);
|
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_map.pm_prot = IPPROTO_ST;
|
||||||
pml->pml_next = list_pml;
|
pml->pml_next = list_pml;
|
||||||
list_pml = pml;
|
list_pml = pml;
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ logit(int severity, struct sockaddr *addr, rpcproc_t procnum, rpcprog_t prognum,
|
|||||||
/* Write syslog record. */
|
/* Write syslog record. */
|
||||||
|
|
||||||
if (addr->sa_family == AF_LOCAL)
|
if (addr->sa_family == AF_LOCAL)
|
||||||
strcpy(fromname, "unix");
|
strcpy(fromname, "local");
|
||||||
else
|
else
|
||||||
getnameinfo(addr, addr->sa_len, fromname,
|
getnameinfo(addr, addr->sa_len, fromname,
|
||||||
sizeof fromname, NULL, 0, NI_NUMERICHOST);
|
sizeof fromname, NULL, 0, NI_NUMERICHOST);
|
||||||
|
|||||||
Reference in New Issue
Block a user