From owner-freebsd-stable Fri Jul 10 14:47:42 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA22677 for freebsd-stable-outgoing; Fri, 10 Jul 1998 14:47:42 -0700 (PDT) (envelope-from owner-freebsd-stable@FreeBSD.ORG) Received: from pop.uniserve.com (pop.uniserve.com [204.244.156.3]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id OAA22666 for ; Fri, 10 Jul 1998 14:47:39 -0700 (PDT) (envelope-from tom@uniserve.com) Received: from shell.uniserve.ca [204.244.186.218] by pop.uniserve.com with smtp (Exim 1.82 #4) id 0yul0K-000225-00; Fri, 10 Jul 1998 14:46:56 -0700 Date: Fri, 10 Jul 1998 14:46:53 -0700 (PDT) From: Tom X-Sender: tom@shell.uniserve.ca To: Stefan Eggers cc: freebsd-stable@FreeBSD.ORG Subject: Re: Finger and getpwent In-Reply-To: <199807102027.WAA27602@semyam.dinoco.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 10 Jul 1998, Stefan Eggers wrote: > > > 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. Non-suid programs use /etc/pwd.db, not /etc/passwd. You've answered your own question. /etc/passwd is USELESS. In fact, I don't even have a /etc/passwd on my systems. /etc/pwd.db is not a database version of /etc/passwd. Both /etc/pwd.db and /etc/spwd.db are generated from the raw infomration in /etc/master.passwd. pwd_mkdb likes to waste your time and spit out a text version too. > 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. ;-) /etc/passwd is generated by pwd_mkdb when called with the "-p" switch. If you don't use "-p" you will not get a /etc/passwd. > Stefan. > -- > Stefan Eggers Lu4 yao2 zhi1 ma3 li4, > Max-Slevogt-Str. 1 ri4 jiu3 jian4 ren2 xin1. > 51109 Koeln > Federal Republic of Germany Tom To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message