has_ns_capability(9)
π has_ns_capability(9) π
okay so bestie, welcome to the Kernel API Manual entry for has_ns_capability β yes, the (9) is doing its little kernel-doc thing. This is literally the vibe check for whether a task has a capability in a specific user namespace. Let's get into it. π
β¨ NAME β¨
has_ns_capability β Does a task have a capability in a specific user ns
πΈ SYNOPSIS πΈ
bool has_ns_capability (struct task_struct *t , struct user_namespace
*ns , int cap );
π¦ ARGUMENTS π¦
tβ the task in question, like the main-character task you're checking on πnsβ target user namespace, literally the namespace we're asking aboutcapβ the capability to be tested for, aka the specific cap on trial π₯
π DESCRIPTION π
It returns true if the specified task has the given superior capability currently in effect to the specified user namespace, and false if not. That's the whole vibe: task + namespace + capability, does it have it, yes or no.
β οΈ Important little note, bestie: this does not set PF_SUPERPRIV on the task. Nope. Not even a little. So don't expect that flag to get cute and appear. π
π SEE ALSO π
Kernel file ./kernel/capability.c β plus the whole friend group:
sys_capget(9)sys_capset(9)has_ns_capability_noaudit(9)has_capability_noaudit(9)ns_capable(9)ns_capable_noaudit(9)ns_capable_setid(9)capable(9)capable_noaudit(9)file_ns_capable(9)privileged_wrt_inode_uidgid(9)capable_wrt_inode_uidgid(9)ptracer_capable(9)
mwah π that's the whole page, bestie. This little icon comes from source/version ./kernel, dated October 2026, and it's literally has_ns_capability(9) β periodt. π«Άπ
π¦ 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