MODE_STRIP_SGID(9) | The Linux VFS | MODE_STRIP_SGID(9) |
NAME¶
mode_strip_sgid - handle the sgid bit for non-directories
SYNOPSIS¶
umode_t mode_strip_sgid(const struct inode * dir, umode_t mode);
ARGUMENTS¶
dir
parent directory inode
mode
mode of the file to be created in dir
DESCRIPTION¶
If the mode of the new file has both the S_ISGID and S_IXGRP bit raised and dir has the S_ISGID bit raised ensure that the caller is either in the group of the parent directory or they have CAP_FSETID in their user namespace and are privileged over the parent directory. In all other cases, strip the S_ISGID bit from mode.
RETURN¶
the new mode to use for the file
COPYRIGHT¶
June 2024 | Kernel Hackers Manual 3.10 |