setattr_should_drop_sgid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… setattr_should_drop_sgid πŸ’…

okay bestie, welcome to this page from the Kernel API Manual β€” it's all about setattr_should_drop_sgid, and yes, the name is a mouthful but we move. πŸ’–


πŸŽ€ NAME πŸŽ€

setattr_should_drop_sgid β€” determine whether the setgid bit needs to be removed. iconic little helper behavior, honestly.


✨ SYNOPSIS ✨

int setattr_should_drop_sgid (struct mnt_idmap *idmap , const struct inode *inode );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • idmap β€” the idmap of the mount the inode was found from.
  • inode β€” the inode to check.

🌸 DESCRIPTION 🌸

so like, this function determines whether the setgid bit needs to be removed. that's the whole vibe check. πŸ’…

for backwards compatibility, we require the setgid bit to be removed unconditionally if S_IXGRP is set. no cap.

otherwise, we have the exact same requirements as setattr_prepare and setattr_copy. periodt.


πŸ”₯ RETURN πŸ”₯

returns ATTR_KILL_SGID if the setgid bit needs to be removed, and 0 otherwise. simple, cute, done. ✨


🫢 SEE ALSO 🫢

Kernel file ./fs/attr.c: setattr_should_drop_suidgid(9), chown_ok(9), chgrp_ok(9), setattr_prepare(9), inode_newsize_ok(9), setattr_copy_mgtime(9), setattr_copy(9), notify_change(9).


that's the whole page, bestie πŸ’– β€” brought to you by ./fs, October 2026, for setattr_should_drop_sgid(9). slay! πŸŽ€

πŸ“¦ where this page comes from