diff options
| author | Alfred Perlstein <alfred@FreeBSD.org> | 2002-02-05 19:26:04 +0000 |
|---|---|---|
| committer | Alfred Perlstein <alfred@FreeBSD.org> | 2002-02-05 19:26:04 +0000 |
| commit | 8858373f832b84fcfa24dcb6b27cdde1afad12ae (patch) | |
| tree | d0bfae22d41f9e22feb21e5677a4049209d6314a /lib/libc/rpc/crypt_client.c | |
| parent | 26d0e65f6744280d0842a512398f4829c0261a40 (diff) | |
Notes
Diffstat (limited to 'lib/libc/rpc/crypt_client.c')
| -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 a62cad2227f2..614cd37449b5 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; |
