open.2: Clarify the rules about how the group ID of a new file is determined

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2016-09-12 07:29:15 +01:00
parent 40169a93c1
commit ddf5e4ab24
1 changed files with 10 additions and 5 deletions

View File

@ -244,14 +244,19 @@ If the file does not exist, it will be created.
The owner (user ID) of the new file is set to the effective user ID
of the process.
The group ownership (group ID) is set either to
the effective group ID of the process or to the group ID of the
parent directory (depending on filesystem type and mount options,
and the mode of the parent directory; see the mount options
The group ownership (group ID) of the new file is set either to
the effective group ID of the process (System V semantics)
or to the group ID of the parent directory (BSD semantics).
On Linux, the behavior depends on whether the
set-group-ID mode bit is set on the parent directory:
if that bit is set, then BSD semantics apply;
otherwise, System V semantics apply.
For some filesystems, the behavior also depends on the
.I bsdgroups
and
.I sysvgroups
described in
mount options described in
.BR mount (8)).
.\" As at 2.6.25, bsdgroups is supported by ext2, ext3, ext4, and
.\" XFS (since 2.6.14).