You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The owner of newly created files is guaranteed to the be process effective UID on Linux. It is not documented on BSDs but generally also expected to be the process effective UID.
476
479
#expect(current_uid == ownership.owner)
477
-
#expect(current_gid == ownership.group)
480
+
481
+
// Considering the following man page documentation for open(2):
482
+
// [Darwin/BSD] When a new file is created it is given the group of the directory which contains it.
483
+
// [Linux] 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 bsdgroups and sysvgroups mount options described in mount(8).
484
+
// ...and the following man page documentation for mkdir(2):
485
+
// [Darwin/BSD] The directory's group ID is set to that of the parent directory in which it is created.
486
+
// [Linux] If the directory containing the file has the set-group-ID bit set, or if the filesystem is mounted with BSD group semantics (mount -o bsdgroups or, synonymously mount -o grpid), the new directory will inherit the group ownership from its parent; otherwise it will be owned by the effective group ID of the process.
0 commit comments