chgrp_ok(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ chgrp_ok β€” like, the kernel API manual bestie ✨

okay so this is a page from the Kernel API Manual (chgrp_ok(9)) and it's literally about how the kernel double-checks that you're actually allowed to chgrp an inode πŸ’… buckle up, it's short and iconic.


πŸŽ€ NAME πŸŽ€

chgrp_ok β€” verify permissions to chgrp inode

like, it's the vibe check that says "bestie, are you sure you're allowed to change this inode's group?" 🫢


🌸 SYNOPSIS 🌸

bool chgrp_ok (struct mnt_idmap *idmap , const struct inode *inode ,
vfsgid_t ia_vfsgid );

it gives you back a bool, bestie β€” yes or no, slay or nay πŸ’–


πŸ¦‹ ARGUMENTS πŸ¦‹

  • idmap β€” the idmap of the mount that the inode was found from. like, where did this inode come from, what's its whole mapping situation πŸ‘€
  • inode β€” the inode we're checking permissions on. the main character, fr fr ✨
  • ia_vfsgid β€” the gid we want to chown the inode to. the group we're aiming for 🎯

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea πŸ“ β€” if the inode got found through an idmapped mount, then you must pass the idmap of the vfsmount through idmap. no cap, that part matters.

once you do that, this function takes care of mapping the inode according to idmap before it does any permission checking. like, it handles the translation for you, which is lowkey so considerate 🧚

now, on non-idmapped mounts β€” or if you wanna do the permission checking on the raw inode instead β€” just simply pass nop_mnt_idmap. that's it, that's the whole thing πŸŽ€

ngl this is the kind of function that looks tiny but is doing real work under the hood. respect πŸ‘‘

πŸ”₯ SEE ALSO πŸ”₯

go read those too, iykyk πŸ“šβœ¨


mwah πŸ’‹ that's the page β€” brought to you by the fine folks over in ./fs, from October 2026, and yes the whole thing lives under the chgrp_ok(9) header. periodt. 🌈⭐

πŸ“¦ where this page comes from