diff options
author | wpaul <wpaul@FreeBSD.org> | 1995-03-27 20:46:40 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1995-03-27 20:46:40 +0000 |
commit | 0c2bd45e40133eba84e13bf107c581e71e0793bc (patch) | |
tree | 2a86b3e8e2739b8a381211f0a685dd93937796a3 /lib/libc | |
parent | 90d65a3dd93828997084420d12b497c491a7751f (diff) | |
download | FreeBSD-src-0c2bd45e40133eba84e13bf107c581e71e0793bc.zip FreeBSD-src-0c2bd45e40133eba84e13bf107c581e71e0793bc.tar.gz |
Use yp_order() instead of yp_first() in _havemaster() to check for the
presence of the master.passwd.byname map, and remember to free the
returned order value before exiting.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/getpwent.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index c7a4539..1f9b4d6 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -555,14 +555,14 @@ static int _havemaster(const char *_pw_yp_domain) { char *result; - static char *key; - int resultlen; - static int keylen; - - if (yp_first(_pw_yp_domain, "master.passwd.byname", - &key, &keylen, &result, &resultlen)) + int *order; + + if (yp_order(_pw_yp_domain, "master.passwd.byname", &order)) { + free(order); return 0; - + } + + free(order); return 1; } |