has_ns_capability(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ 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 about
  • cap β€” 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:


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