From owner-freebsd-hackers Sat Aug 8 03:18:51 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA27254 for freebsd-hackers-outgoing; Sat, 8 Aug 1998 03:18:51 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from caladan.tdx.co.uk (caladan.tdx.co.uk [195.188.177.4]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA27249 for ; Sat, 8 Aug 1998 03:18:47 -0700 (PDT) (envelope-from kpielorz@tdx.co.uk) Received: from tdx.co.uk (lorca-tx.tdx.co.uk [195.188.177.242]) by caladan.tdx.co.uk (8.9.1/8.9.1) with ESMTP id LAA23825; Sat, 8 Aug 1998 11:18:18 +0100 (BST) Message-ID: <35CC2618.3F8AE5@tdx.co.uk> Date: Sat, 08 Aug 1998 11:19:04 +0100 From: Karl Pielorz Organization: TDX X-Mailer: Mozilla 4.5b1 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: Vince Vielhaber CC: hackers@FreeBSD.ORG Subject: Re: getpwuid - after chroot? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Vince Vielhaber wrote: > I just tried compiling it on HPUX 9.0. It won't compile due to not > having setpassent. I compiled it on linux 2.0.24 and running as root > I get this: > > second getpwuid(0) didn't work Apparently the code does work on NetBSD, OpenBSD and BSDI - but not FreeBSD... The first call to 'setpassent(1)' is meant to go to the start of the password database, and keep the file open... On the other BSD's (verified by the program author, not myself) it works, This is because once you've chroot'd you can still use calls to getpwent etc. - as you opened the file (and got the descriptor) before you chroot'd. On FreeBSD this doesn't happen... I'm not saying their behaviour is right, and ours is wrong - I'm just wondering which is better (i.e. to make FreeBSD do the same as the others - or to adjust the offending program accordingly (i.e. a workaround etc.))? Regards, Karl To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message