setattr_should_drop_suidgid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… setattr_should_drop_suidgid ✨

okay bestie, so this one is from the Kernel API Manual β€” section 9, kernel API, we love that for us πŸŽ€


✨ NAME ✨

setattr_should_drop_suidgid β€” the vibe check that decides whether the set{g,u}id bit needs to be dropped πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

int setattr_should_drop_suidgid (struct mnt_idmap *idmap , struct inode
*inode );

literally the whole signature, no cap, copy it exactly πŸ’–


🌸 ARGUMENTS 🌸

  • idmap β€” the idmap of the mount that the inode was found from. yeah, that's the one 🫢
  • inode β€” the inode we're checking. main character energy, honestly ⭐

πŸ’œ DESCRIPTION πŸ’œ

so this function is the one that determines whether the set{g,u}id bits need to be removed. like, that's the whole job 🧚

  • if the setuid bit needs to be removed, ATTR_KILL_SUID gets returned πŸ”₯
  • if the setgid bit needs to be removed, ATTR_KILL_SGID gets returned 🌈
  • if both set{g,u}id bits need to be removed, you get the corresponding mask of both flags back 😭

it's giving "which flags do i need to kill" and honestly? iconic πŸ’…


⭐ RETURN ⭐

a mask of ATTR_KILL_S{G,U}ID indicating which β€” if any β€” setid bits to remove, and 0 otherwise πŸŽ€

lowkey important: the "if any" is doing real work there. sometimes the answer is just 0 and that's valid πŸ’€

πŸ“ SEE ALSO πŸ“

go read the whole friend group, fr fr 🫢


and that's the page, bestie ✨ this cutie lives in ./fs, and the version/date situation is October 2026 β€” so yeah, technically from the future πŸ‘‘ see you in the next one, mwah πŸŽ€πŸ’–

πŸ“¦ where this page comes from