From 85e8f5bee2a1aaa96bfd8091ebbeca2434b8b046 Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Sat, 17 Jun 1995 04:00:02 +0000 Subject: [PATCH] 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...) --- lib/libc/gen/getpwent.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index 8b17ca24a89..7d1fb83442d 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; }