Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Jul 1995 12:27:40 -0400 (EDT)
From:      jim@reptiles.org (Jim Mercer)
To:        hackers@freebsd.org
Cc:        taob@io.oef
Subject:   getpwent() YP/NIS bug
Message-ID:  <m0sXt1B-00035iC@iguana.reptiles.org>

next in thread | raw e-mail | index | archive | help

[ 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                 ]



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?m0sXt1B-00035iC>