Skip to content

Instantly share code, notes, and snippets.

@sargun
Created August 27, 2021 03:20
Show Gist options
  • Save sargun/9577c9f333e51ce66b0b68772ff66bb5 to your computer and use it in GitHub Desktop.
Save sargun/9577c9f333e51ce66b0b68772ff66bb5 to your computer and use it in GitHub Desktop.
/**
* capable - Determine if the current task has a superior capability in effect
* @cap: The capability to be tested for
*
* Return true if the current task has the given superior capability currently
* available for use, false if not.
*
* This sets PF_SUPERPRIV on the task if the capability is available on the
* assumption that it's about to be used.
*/
bool capable(int cap)
{
return ns_capable(&init_user_ns, cap);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment