Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 May 2007 19:40:31 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Patrick Dung <patrick_dkt@yahoo.com.hk>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Question about the difference of with and without SGID on directory
Message-ID:  <465F169F.8090501@infracaninophile.co.uk>
In-Reply-To: <200241.77528.qm@web54307.mail.re2.yahoo.com>
References:  <200241.77528.qm@web54307.mail.re2.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Patrick Dung wrote:
> Hi
> 
> I found Free/Net/OpenBSD semantic is different from Linux/Solaris.
> 
> Suppose there is a directory called 'directory,
> With owner www, and group www and permission 0777.
> 
> Then I touch a file:
> $ touch file
> $ ls -la
> total 4
> drwxrwxrwx  2 www   www    512 May 31 17:14 .
> drwxrwxrwt  8 root  wheel  512 May 31 17:14 ..
> -rw-r--r--  1 patrick   www      0 May 31 17:14 file
>                         ^^^
> The file created will have a group owner of the owner of the directory
> not the creator.
> 
> So I have two questions here:
> 1. So is there a difference with SGID on directory?

No.  BSDish behaviour of a directory with either mode drwxr-xr-x
or drwxr-sr-x is essentially identical to SysV/Linux-ish behaviour
with a directory mode drwxr-sr-x

> 2. Any idea about why it is different from SYSV (Linux/Solaris)?

It's historic.  BSD has always worked that way and SysV has begged
to differ.

	Cheers,

	Matthew

- --
Dr Matthew J Seaman MA, D.Phil.                       Flat 3
                                                      7 Priory Courtyard
PGP: http://www.infracaninophile.co.uk/pgpkey         Ramsgate
                                                      Kent, CT11 9PW, UK
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.3 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGXxaf3jDkPpsZ+VYRA+RtAJ90NGhTKUxHIY79zGIMdyYq0mzJjgCgjLKf
4t1RvGp9AyaUWLohlA52Qxc=
=XJEv
-----END PGP SIGNATURE-----



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