Subject: Re: YP & chpass/chfn/chsh question
To: Stephen M. Jones <>
From: Manuel Bouyer <>
List: tech-net
Date: 03/28/2003 15:02:28
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Mar 27, 2003 at 04:03:22PM -0600, Stephen M. Jones wrote:
> Manuel writes:
> > No you don't have to run yppasswdd on the clients. The problem is something
> > else ...
> > What aurguments are passwd to yppasswdd on the server ?
> BTW, I'm using 1.6
> yppasswdd is started on the server without arguments.  I assume you
> were looking for -noshell or -nogecos and such .. right?  
> Here is what I see on the clients:
> # passwd -y test99
> Changing YP password for test99.
> Old password:
> New password:
> New password:
> Retype new password:
> The YP password has been changed ...
> # chfn -y test99
> chfn: unknown user: test99

I tested and have the same problem

> In the system source for the 'chpass' suite, there is a variable USE_YP
> which is checked for not being set to no, if it does this, it will also
> build 'pw_yp.c' which I assume has all the hooks for interfacing with 
> the yppasswdd.  It looks like it builds that and links it .. :
> usage: chpass [-a list] [-s shell] [-l] [-y] [user]
> Yet it still appears to be looking in the local passwd file (which is
> essentially empty)

I suspect it is because of this at the end of the Makefile:
getpwent.o: getpwent.c
        ${COMPILE.c} -UYP ${.IMPSRC}

In fact when YP is used, a custom getpwent.o isn't needed, we can use the one
from libc. I can't see why we want a custon getpwent.o anyway; if we build
a system without yp support, libc's getpwent.o won't have YP support either.
Can you try the attached patch ? It solve the problem for me.

Manuel Bouyer, LIP6, Universite Paris VI. 
     NetBSD: 24 ans d'experience feront toujours la difference

Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

Index: Makefile
RCS file: /cvsroot/src/usr.bin/chpass/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- Makefile	2002/03/22 18:10:22	1.11
+++ Makefile	2003/03/28 14:02:07
@@ -4,7 +4,7 @@
 .include <>
 PROG=	chpass
-SRCS=	chpass.c edit.c field.c table.c util.c getpwent.c
+SRCS=	chpass.c edit.c field.c table.c util.c
 BINOWN=	root
 .PATH:	${.CURDIR}/../../lib/libc/gen
@@ -18,6 +18,8 @@
 LDADD+=	-lrpcsvc
+SRCS+= getpwent.c