CAPNG_HAVE_CAPABILITY(3)

πŸ“¦
version 0.9.6 Β· 3 versions
  • 0.9.6 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.8.2 Β· centos-stream 9
  • 0.7.9 Β· ubuntu jammy
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… CAPNG_HAVE_CAPABILITY πŸ’…

okay bestie, so this is a page from the Libcap-ng API manual, section 3 (that's the "library functions" section, iykyk). It's all about capng_have_capability β€” the little guy that tells you whether one specific capability is chilling in a capability set or not. πŸ¦‹


✨ NAME ✨

capng_have_capability β€” check for specific capability πŸ”


🌸 SYNOPSIS 🌸

#include <cap-ng.h>

int capng_have_capability(capng_type_t which, unsigned int capability);

πŸŽ€ DESCRIPTION πŸŽ€

So like, capng_have_capability goes and peeks at the internal capabilities set you tell it about, and checks whether the capability you asked about is actually set in there. Simple as that, no cap. ✨

Heads up though β€” those capability sets have to be set up beforehand. You get them ready by calling capng_get_caps_process, capng_get_caps_fd, or literally in some other way that sets them up. It's not gonna magically know stuff you never loaded. πŸ’€

And the which argument? It has to be one of these icons only, no substitutions:

  • CAPNG_EFFECTIVE
  • CAPNG_PERMITTED
  • CAPNG_INHERITABLE
  • CAPNG_BOUNDING_SET
  • CAPNG_AMBIENT

Pick one of those five, that's the vibe check for which. 🫢


⭐ RETURN VALUE ⭐

This function is giving very binary energy, honestly. It returns:

  • 1 if yes πŸ’–
  • 0 otherwise πŸ™ˆ

That's it. That's the whole answer. periodt.


πŸ”₯ SEE ALSO πŸ”₯

Go read these next, bestie, they're all part of the same little family:


πŸ‘‘ AUTHOR πŸ‘‘

Steve Grubb β€” the icon who wrote this πŸ’…


and that's the whole page, fr fr. this lil masterpiece came from Red Hat and it's dated June 2009 β€” yeah, it's been serving us correctly since before most of us had phones, iconic behavior honestly. go off, capng_have_capability. πŸŽ€βœ¨πŸ’œ

πŸ“¦ where this page comes from