mode_strip_sgid — handle the sgid bit for non-directories
umode_t mode_strip_sgid ( | const struct inode * dir, |
umode_t mode) ; |
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
.