posix_acl_update_mode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ posix_acl_update_mode ✨

ok so bestie, this is a page from the Kernel API Manual and it's literally about posix_acl_update_mode β€” the function that updates the mode when you're setting an ACL. yes, the mode in set_acl. iykyk πŸ’…


🌸 SYNOPSIS 🌸

int posix_acl_update_mode (struct mnt_idmap *idmap , struct inode *inode
, umode_t *mode_p , struct posix_acl **acl );

like, four things go in, an int comes out. no cap. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • idmap β€” the idmap of the mount that the inode was found from. yes, that mount. πŸ¦‹
  • inode β€” the target inode. the main character, honestly. πŸ‘‘
  • mode_p β€” a pointer to the mode, for the update. not the mode itself, bestie, a pointer. πŸ™ˆ
  • acl β€” the acl pointer. that's it. that's the whole description. πŸ’€

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: this thing updates the file mode when you're setting an ACL β€” it computes the new file permission bits based on the ACL. math but make it permissions. ✨

and there's a cute lil bonus: if the ACL is equivalent to the new file mode, it sets *acl to NULL to indicate that no ACL should be set. basically "you already ate, no need to order". πŸ“

also β€” same as with chmod β€” it clears the setgid bit if the caller is not in the owning group or not capable of CAP_FSETID (see inode_change_ok). so like, know your permissions before you come for that bit, fr fr. 😭

and now the important part, listen up: if the inode has been found through an idmapped mount, the idmap of the vfsmount must be passed through idmap. this function will then take care to map the inode according to idmap before checking permissions. on non-idmapped mounts, or if permission checking is to be performed on the raw inode, simply pass nop_mnt_idmap. iconic behaviour honestly. 🌈

it's called from set_acl inode operations. periodt. ⭐


πŸ’œ SEE ALSO πŸ’œ

go read them, bestie, they're all in their flop era without you. 🧚


okay that's the whole page!! this one came from the ./fs source, Kernel API Manual, dated October 2026 β€” mwah, love u, go update some modes responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from