> > FBSD 2.2.2 to FBSD 2.2.6-stable something moved. In my /etc/passwd file
> > there are lots of coments "#" and getpwent() return 0 after read this
> > line. I have some scripts in perl that stops when getpwent() return 0.
> > In FBSD 2.2.2 when getpwent() returned 0 meant end of file /etc/passwd.
> I hope you realize that /etc/passwd isn't used for anything. All users
> should be listed in /etc/master.passwd. You should used vipw to edit
And how do you expect non-root/SUID-root programs to get at any
information on users if not via /etc/passwd and (the actually used
database version thereof) /etc/pwd.db? getpwent() uses it if one
isn't root. For accesses by root it uses the shadow password file's
database version. See the source to -stable.
Using vipw is a good idea, though as that will keep both in sync. Not
doing so might eventually lead to interesting problems like root
seeing something differing from what a user can see. Besides the
difference with the password, of course. ;-)
Stefan Eggers Lu4 yao2 zhi1 ma3 li4,
Max-Slevogt-Str. 1 ri4 jiu3 jian4 ren2 xin1.
Federal Republic of Germany
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message