Re: file permissions

Thorben Thuermer <[email protected]>
Newsgroups gmane.network.mathopd
Message-ID <[email protected]>
Michiel Boland wrote:
> On BSD, group ownership of a file is inherited from the parent directory.
> So if you have a directory that is owned by 'wheel', any file you create
> in there will have owner 'wheel' too, regardless of any groups the creator
> is in.

on BSD? on any unix, IF the SGID bit is set for the directory.

# mkdir test
# chown :users test
# touch test/foo
# ls -l test/foo
-rw-r--r--    1 root     root            0 Mar 29 17:24 test/foo
# chmod g+s test
# ls -ld test
drwxr-sr-x    2 root     users        1024 Mar 29 17:24 test
# touch test/foo2
# ls -l test/foo2
-rw-r--r--    1 root     users           0 Mar 29 17:24 test/foo2
# uname -s -r
Linux 2.4.19-pre4

> [...]
> 
> Cheers
> Michiel

Thorben
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.