diff options
author | wpaul <wpaul@FreeBSD.org> | 1995-06-17 04:00:02 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1995-06-17 04:00:02 +0000 |
commit | 3e0e2d1182845f613a9a258bb2e2c581ed9a60c9 (patch) | |
tree | b61ef3815657e5a783576ff89eeb4ea5529df35b /lib | |
parent | 364241ddc5b098699fe19eb2f3fc711e32a1d5b7 (diff) | |
download | FreeBSD-src-3e0e2d1182845f613a9a258bb2e2c581ed9a60c9.zip FreeBSD-src-3e0e2d1182845f613a9a258bb2e2c581ed9a60c9.tar.gz |
Make _havemaster() use yp_first() (again) instead of yp_order() to
ward off possible NIS+ evil. (I might be overly paranoid with this,
but it doesn't hurt, so...)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/gen/getpwent.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index 8b17ca2..7d1fb83 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -574,11 +574,15 @@ static char *_pw_yp_domain; static int _havemaster(char *_pw_yp_domain) { - int order; + int keylen, resultlen; + char *key, *result; - if (yp_order(_pw_yp_domain, "master.passwd.byname", (int *)&order)) { + if (yp_first(_pw_yp_domain, "master.passwd.byname", + &key, &keylen, &result, &resultlen)) { + free(result); return 0; } + free(result); return 1; } |