ns_capable(9)
β¨ ns_capable(9) β¨
okay bestie, welcome to the Kernel API Manual β todayβs main character is ns_capable(9), and weβre gonna get you comfy with it π
π NAME π
ns_capableβ determine if the current task has a superior capability in effect β¨
πΈ SYNOPSIS πΈ
bool ns_capable (struct user_namespace *ns , int cap );
π ARGUMENTS π
nsβ the usernamespace where we want the capability to be in effect π«Άcapβ the capability weβre testing for π
π¦ DESCRIPTION π¦
So hereβs the tea: this returns true if the current task has the given superior capability currently available for use, and false if not. No cap, thatβs the whole vibe check π
It also sets PF_SUPERPRIV on the task if the capability is available β and it does that on the assumption that itβs about to be used. So yeah, itβs not just peeking at the capability, itβs also flagging the task like βbestie is about to use thisβ π
π SEE ALSO π
Kernel file: ./kernel/capability.c β and these iconic little references too π
sys_capget(9)sys_capset(9)has_ns_capability(9)has_ns_capability_noaudit(9)has_capability_noaudit(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)
signing off from ./kernel, stamped October 2026, and this was the ns_capable(9) page β slay and goodbye ππ¦
π¦ 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