CAPNG_HAVE_CAPABILITY(3)
π 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 callingcapng_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_EFFECTIVECAPNG_PERMITTEDCAPNG_INHERITABLECAPNG_BOUNDING_SETCAPNG_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:
1if yes π0otherwise π
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
- alpine 3.22: libcap-ng-doc 0.8.5-r0 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- alpine 3.23: libcap-ng-doc 0.8.5-r0 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- alpine 3.24: libcap-ng-doc 0.8.5-r2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- arch rolling: libcap-ng 0.9.6-1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- centos-stream 10: libcap-ng-devel 0.9.3-2.el10 Β· LGPL-2.0-or-later
- debian bookworm: libcap-ng-dev 0.8.3-1+b3 Β· LGPL-2.1-or-later
- debian trixie: libcap-ng-dev 0.8.5-4+b1 Β· LGPL-2.1-or-later
- fedora 43: libcap-ng-devel 0.8.5-8.fc43 Β· LGPL-2.0-or-later
- fedora 43: libcap-ng-devel 0.8.5-8.fc43 Β· LGPL-2.0-or-later
- fedora 43: libcap-ng-devel 0.9.6-1.fc43 Β· LGPL-2.0-or-later
- fedora 43: libcap-ng-devel 0.9.6-1.fc43 Β· LGPL-2.0-or-later
- fedora 44: libcap-ng-devel 0.9.2-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: libcap-ng-devel 0.9.2-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: libcap-ng-devel 0.9.6-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: libcap-ng-devel 0.9.6-1.fc44 Β· LGPL-2.0-or-later
- nixos 26.05: libcap-ng 0.9.3
- nixpkgs unstable: libcap-ng 0.9.6
- opensuse-leap 16.0: libcap-ng-devel 0.8.5-160000.3.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libcap-ng-devel 0.8.5-160000.3.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libcap-ng-devel 0.8.5-160000.3.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libcap-ng-devel 0.8.5-160000.3.2 Β· LGPL-2.1-or-later
- ubuntu noble: libcap-ng-dev 0.8.4-2build2 Β· LGPL-2.1-or-later
- ubuntu questing: libcap-ng-dev 0.8.5-4build2
- ubuntu resolute: libcap-ng-dev 0.8.5-4build5 Β· LGPL-2.1-or-later
- ubuntu stonking: libcap-ng-dev 0.9.6-1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms