kuid_root_in_ns(9)
π kuid_root_in_ns(9) β aka the "are you root in this namespace bestie" check
okay so real quick β this page lives in the Kernel API Manual, and it's a tiny lil function that's genuinely carrying the whole "am I the root of this universe or just a visitor" vibe check. yes it's short. no that doesn't make it boring. stay with me π«Ά
β¨ SYNOPSIS β¨
bool kuid_root_in_ns (kuid_t kuid , struct user_namespace *ns );
like, that's it. two args, one bool back. iconic minimalism honestly π
π ARGUMENTS π
kuidβ thekuidwe're testing, bestie. this is the little guy we're putting under the microscope π¬nsβ the user namespace we're testing against. like, the specific universe we're asking about π
πΈ DESCRIPTION πΈ
Returns true if kuid represents the root user in ns, and false otherwise.
that's the whole thing. literally. it's giving "short but essential". no cap, this is the function you call when you need to know if a given kuid has main character root energy inside that particular namespace β not globally, not in some other ns, in that one. vibe check complete β
no side effects mentioned, no caveats, no gotchas β the page says what it says and says nothing more. don't go inventing behaviour that isn't written down, bestie π
π¦ SEE ALSO π¦
the whole cap crew, plus friends, all hanging out in the kernel file ./security/commoncap.c:
cap_capable_helper(9)cap_capable(9)cap_settime(9)cap_ptrace_access_check(9)cap_ptrace_traceme(9)cap_capget(9)cap_capset(9)cap_inode_need_killpriv(9)cap_inode_killpriv(9)rootid_from_xattr(9)cap_convert_nscap(9)get_vfs_caps_from_disk(9)cap_bprm_creds_from_file(9)cap_inode_setxattr(9)cap_inode_removexattr(9)cap_task_fix_setuid(9)cap_task_setscheduler(9)cap_task_setioprio(9)cap_task_setnice(9)cap_task_prctl(9)cap_vm_enough_memory(9)cap_mmap_addr(9)
go read them all, they're a whole squad fr fr π«‘
k bye ily, this page is brought to you by the ./security source, dated October 2026, in the Kernel API Manual β¨π¦ don't forget to hydrate and don't forget your namespaces π
π¦ 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