diff options
author | alfred <alfred@FreeBSD.org> | 2002-02-05 19:26:04 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2002-02-05 19:26:04 +0000 |
commit | 4b6dfb0371e69053a084f9be4527d00c21ff21b2 (patch) | |
tree | d0bfae22d41f9e22feb21e5677a4049209d6314a /lib | |
parent | 903f014bc1c0d907f00f5ee5cd8d683b823d9081 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | lib/libc/rpc/crypt_client.c | 23 |
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; |