Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Aug 2002 08:26:59 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Thomas Vaughan <tomva@isilon.com>
Cc:        questions@FreeBSD.ORG
Subject:   Re: Group owner of new files?
Message-ID:  <20020830072659.GA37771@happy-idiot-talk.infracaninophi>
In-Reply-To: <200208300112.g7U1CeUb088509@isilon.com>
References:  <44k7m9n4lo.fsf@be-well.ilk.org> <3.0.5.32.20020829200154.020e3b90@mail.sage-one.net> <200208300112.g7U1CeUb088509@isilon.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020830072659.GA37771>