From owner-freebsd-questions Fri Aug 30 0:27:11 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 79B4B37B400 for ; Fri, 30 Aug 2002 00:27:08 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4660643E77 for ; Fri, 30 Aug 2002 00:27:07 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk ([IPv6:::1]) by smtp.infracaninophile.co.uk (8.12.5/8.12.5) with ESMTP id g7U7R5mg038064; Fri, 30 Aug 2002 08:27:05 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost) by happy-idiot-talk.infracaninophile.co.uk (8.12.5/8.12.5/Submit) id g7U7Qxki038063; Fri, 30 Aug 2002 08:26:59 +0100 (BST) Date: Fri, 30 Aug 2002 08:26:59 +0100 From: Matthew Seaman To: Thomas Vaughan Cc: questions@FreeBSD.ORG Subject: Re: Group owner of new files? Message-ID: <20020830072659.GA37771@happy-idiot-talk.infracaninophi> References: <44k7m9n4lo.fsf@be-well.ilk.org> <3.0.5.32.20020829200154.020e3b90@mail.sage-one.net> <200208300112.g7U1CeUb088509@isilon.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200208300112.g7U1CeUb088509@isilon.com> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Aug 29, 2002 at 06:12:01PM -0700, Thomas Vaughan wrote: > Suppose I have a directory /pub with ownership > root + wheel, world-writeable. > > If I log in as user foobar, group foobar, and > touch a file in /pub, I see (FreeBSD 5) > > hostname$ ls -l > total 0 > -rw-r--r-- 1 foobar wheel 0 Aug 29 14:51 foo > > But under Solaris and Linux I see > > hostname$ ls -l > total 0 > -rw-r--r-- 1 foobar foobar 0 Aug 29 14:51 foo > > So who is "correct"? It appears that in FreeBSD, > group ownership is determined by the directory, rather > than the user that created the file. Is that expected > behavior? Each is correct, according to their own ideas. What you've demonstrated is one of the well known differences between BSD and SysV flavours of Unix. You can make the SysV machine behave in the BSD way by setting the setgid flag on the directory: chmod g+s dir Under Solaris at least, that setgid flag is inherited by any subdirectories subsequently created under there. I don't know of any way to force a *BSD box to behave in the SysV style. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message