posix_acl_update_mode(9)
β¨ 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 withchmodβ it clears the setgid bit if the caller is not in the owning group or not capable ofCAP_FSETID(seeinode_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 π
- Kernel file
./fs/posix_acl.c posix_acl_chmod(9)posix_acl_from_xattr(9)vfs_posix_acl_to_xattr(9)vfs_set_acl(9)vfs_get_acl(9)vfs_remove_acl(9)
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
- 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