From owner-freebsd-hackers Mon Jul 17 09:29:00 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id JAA07588 for hackers-outgoing; Mon, 17 Jul 1995 09:29:00 -0700 Received: from iguana.reptiles.org (iguana.reptiles.org [142.57.253.130]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id JAA07575 for ; Mon, 17 Jul 1995 09:28:49 -0700 Received: by iguana.reptiles.org (/\==/\ Smail3.1.28.1 #28.8) id ; Mon, 17 Jul 95 12:28 EDT Message-Id: From: jim@reptiles.org (Jim Mercer) Subject: getpwent() YP/NIS bug To: hackers@freebsd.org Date: Mon, 17 Jul 1995 12:27:40 -0400 (EDT) Cc: taob@io.oef X-Mailer: ELM [version 2.4 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Length: 1582 Sender: hackers-owner@freebsd.org Precedence: bulk [ i'm not on the hackers list, so include me in the cc if you want me to see it. ] i run a couple freebsd boxes along with my suns. my machine babybop was 1.1.5.1 up until this weekend when i installed 2.0.5 off the CD. in 1.1.5.1 i had babybop set up as a NIS client off of one of my sunos 4.1.1_u1 machines. worked fine. when i upgraded to 2.0.5, i noticed that passwords were not making it to the login program properly. the getpwent() call was returning a password of "*", which was the password in the "+:*:0:0:0" /etc/passwd entry. i applied the following patch to lib/libc/gen/getpwent.c and got what i think is the correct thing. babybop# diff getpwent.c getpwent.c.2.0.5 501d500 < int is_yp; 510,511d508 < is_yp = (pw->pw_name[0] == '+'); < 513c510 < if(!(pw->pw_fields & _PWF_NAME) || is_yp) { --- > if(!(pw->pw_fields & _PWF_NAME) || (pw->pw_name[0] == '+')) { 519c516 < if(!(pw->pw_fields & _PWF_PASSWD) || is_yp) { --- > if(!(pw->pw_fields & _PWF_PASSWD)) { this allows the code in the second "if" to put the yp passwd field into the appropriate place. i key'd the decision on the same token used for the pw_name field. -- [ Jim Mercer jim@reptiles.org +1 416 506-0654 ] [ Reptilian Research -- Longer Life through Colder Blood ] [ If you can read this, you are probably standing on the tracks. ] [ A train will be along momentarily to crush you. ] [ - fine print of an ad in a Toronto subway tunnel ]