Subject: passwd(1) vs YP
To: None <current-users@NetBSD.ORG>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: current-users
Date: 09/03/1997 15:30:09
I'm running NetBSD on a SPARC.  The tree I'm using is a couple of
months old, but the relevant files appear to be the same versions as in
-current.  I do have some patches to some of them, but I've looked; the
patches don't affect the code in question.

This machine is part of an existing YP setup.  master.passwd has
explicit entries for a handful of users - root among them - and at the
end has a line "+:::::::::" to pull in everything else from YP.

Today, I tried to change root's password.  "passwd root" told me
"passwd: unknown user root".  Of course, I investigated; this proved to
be because passwd.c ($NetBSD: passwd.c,v 1.11 1997/01/07 04:08:18 tls
Exp $) says, at the end of main,

#ifdef  YP
        if (use_yp)
                exit(yp_passwd(username));
#endif
        exit(local_passwd(username));

which means that if passwd decides YP is in use, it won't even consider
the possibility that the user is local (and reading yp_passwd, I find
the "unknown user" message in it when it finds the user isn't in the YP
map - which is the case here).

Once I found this, of course, "passwd -l" worked Just Fine.  But this
is a fairly serious deviation from YP as it is practiced in the
commercial vendor OS industry and definitely a violation of the
Principle of Least Surprise.

Is anyone working on this?  Should I just send-pr it and maybe try to
fix it?  Does anyone have trial patches I could test?

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B