bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mkdir() and group id


From: Paul Jarc
Subject: Re: mkdir() and group id
Date: Fri, 26 Apr 2002 13:12:53 -0400
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i686-pc-linux-gnu)

tb@becket.net (Thomas Bushnell, BSG) wrote:
> A given project might be group "foobie", and all the people working on
> that project are in the group.  They use a umask of 002.  Everything
> works Just Great!  Because when they create files or directories
> inside the project, they automatically have the *group* set to
> "foobie", even though the primary egid of the user might be
> "user-category-6" or something like that.

This works with the SysV (aka Linux) behavior as well: if a directory
is setgid, any files created within it inherit the group id, and any
directories created within it inherit both the group id and the setgid
bit.

OTOH, because of this, assuming SysV behavior doesn't actually
simplify any code.  Portable software that wants the SysV behavior
must explicitly chown the files.  (Removing the setgid bit would be
enough on SysV-style systems, but testing for that would just be extra
code for the same result.)  Portable software that wants the BSD
behavior must explicitly chown the files or add the setgid bit.  (And
of course, the software should never modify the setgid bit on a
directory it didn't create.)


paul



reply via email to

[Prev in Thread] Current Thread [Next in Thread]