in_group_or_capable(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… in_group_or_capable(9) β€” like, the Kernel API Manual edition πŸŽ€

okay bestie, sit down, because today we're learning about in_group_or_capable β€” yes it's a mouthful, yes it slays, and yes it's literally just asking "are you allowed to keep that setgid bit or not" πŸ¦‹


✨ NAME ✨

in_group_or_capable β€” check whether the caller is CAP_FSETID privileged πŸ’«


🌸 SYNOPSIS 🌸

bool in_group_or_capable (struct mnt_idmap *idmap , const struct inode
       *inode , vfsgid_t vfsgid );

πŸŽ€ ARGUMENTS πŸŽ€

  • idmap β€” the idmap of the mount the inode was found from. the receipts, basically 🧾
  • inode β€” the inode we're checking. the main character fr πŸ‘‘
  • vfsgid β€” the new/current vfsgid of the inode. the gid in question πŸ’œ

⭐ DESCRIPTION ⭐

so here's the vibe check: check whether vfsgid is in the caller's group list or whether the caller is privileged with CAP_FSETID over inode. that's it, that's the whole function 🫢

why do we care? because this is how you figure out whether the setgid bit can be kept or must be dropped β€” like, highkey important decision energy πŸ”₯


🌈 RETURN 🌈

  • true β€” if the caller is sufficiently privileged πŸ’–
  • false β€” if not πŸ™ˆ

no in-between, no "it depends", just a clean boolean slay ✨


πŸ¦‹ SEE ALSO πŸ¦‹

the whole inode friend group, and honestly they're all icons:

and the source of truth itself: the kernel file ./fs/inode.c πŸ“


ngl bestie, if you got this far you're officially a filesystem girlie now πŸ’…πŸ§š

okay that's the whole page!! this little gem lives in ./fs in the kernel tree, it's the October 2026 version, and it's filed under in_group_or_capable(9) in the Kernel API Manual. mwah, go check your setgid bits responsibly πŸ˜­πŸ’–πŸŽ€

πŸ“¦ where this page comes from