Re: Finger and getpwent

[ Available lists | Index of freebsd-stable | Month of Jul 1998 | Week of 10 Jul 1998 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Stefan Eggers <seggers@semyam.dinoco.de>
Date
10 Jul 1998 13:46:32
Subject
Re: Finger and getpwent
Message-ID
199807102027.WAA27602@semyam.dinoco.de

In reply to
Replies

[ Hide this part ]
> > 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
> /etc/master.passwd

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.
--
Stefan Eggers Lu4 yao2 zhi1 ma3 li4,
Max-Slevogt-Str. 1 ri4 jiu3 jian4 ren2 xin1.
51109 Koeln
Federal Republic of Germany

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message


Elapsed time: 0.087 seconds