setattr_should_drop_suidgid(9)
π 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_SUIDgets returned π₯ - if the setgid bit needs to be removed,
ATTR_KILL_SGIDgets 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 π
- Kernel file
./fs/attr.c setattr_should_drop_sgid(9)chown_ok(9)chgrp_ok(9)setattr_prepare(9)inode_newsize_ok(9)setattr_copy_mgtime(9)setattr_copy(9)notify_change(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms