summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2002-02-05 19:26:04 +0000
committeralfred <alfred@FreeBSD.org>2002-02-05 19:26:04 +0000
commit4b6dfb0371e69053a084f9be4527d00c21ff21b2 (patch)
treed0bfae22d41f9e22feb21e5677a4049209d6314a /lib/libc/rpc
parent903f014bc1c0d907f00f5ee5cd8d683b823d9081 (diff)
downloadFreeBSD-src-4b6dfb0371e69053a084f9be4527d00c21ff21b2.zip
FreeBSD-src-4b6dfb0371e69053a084f9be4527d00c21ff21b2.tar.gz
The clnt_create(KEYSERVSOCK, CRYPT_PROG, CRYPT_VERS, "unix") hacks
were removed and replaced them with clnt_tp_create, now the af_local support is fixed. I also removed the hack how rpcinfo contacted rpcbind, now we can relay on clnt_tp_create create the client-handle for us. Only rpcbind itself needs a hardcoded socket-path. Submitted by: mbr Also add $FreeBSD
Diffstat (limited to 'lib/libc/rpc')
-rw-r--r--lib/libc/rpc/crypt_client.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/libc/rpc/crypt_client.c b/lib/libc/rpc/crypt_client.c
index a62cad2..614cd374 100644
--- a/lib/libc/rpc/crypt_client.c
+++ b/lib/libc/rpc/crypt_client.c
@@ -42,10 +42,6 @@
static const char rcsid[] = "$FreeBSD$";
#endif
-#ifndef KEYSERVSOCK
-#define KEYSERVSOCK "/var/run/keyservsock"
-#endif
-
int
_des_crypt_call(buf, len, dparms)
char *buf;
@@ -55,12 +51,27 @@ _des_crypt_call(buf, len, dparms)
CLIENT *clnt;
desresp *result_1;
desargs des_crypt_1_arg;
- int stat;
+ struct netconfig *nconf;
+ void *localhandle;
+ int stat;
- clnt = clnt_create(KEYSERVSOCK, CRYPT_PROG, CRYPT_VERS, "unix");
+ nconf = NULL;
+ localhandle = setnetconfig();
+ while ((nconf = getnetconfig(localhandle)) != NULL) {
+ if (nconf->nc_protofmly != NULL &&
+ strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0)
+ break;
+ }
+ if (nconf == NULL) {
+ warnx("getnetconfig: %s", nc_sperror());
+ return(DESERR_HWERROR);
+ }
+ clnt = clnt_tp_create(NULL, CRYPT_PROG, CRYPT_VERS, nconf);
if (clnt == (CLIENT *) NULL) {
+ endnetconfig(localhandle);
return(DESERR_HWERROR);
}
+ endnetconfig(localhandle);
des_crypt_1_arg.desbuf.desbuf_len = len;
des_crypt_1_arg.desbuf.desbuf_val = buf;
OpenPOWER on IntegriCloud