Date: Fri, 10 Jul 1998 22:27:42 +0200 From: Stefan Eggers <seggers@semyam.dinoco.de> To: freebsd-stable@FreeBSD.ORG Cc: Tom <tom@uniserve.com>, seggers@semyam.dinoco.de Subject: Re: Finger and getpwent Message-ID: <199807102027.WAA27602@semyam.dinoco.de> In-Reply-To: Your message of "Fri, 10 Jul 1998 12:28:16 PDT." <Pine.BSF.3.96.980710122412.2887A-100000@shell.uniserve.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
> > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199807102027.WAA27602>