CAPNG_HAVE_CAPABILITIES(3)
π CAPNG_HAVE_CAPABILITIES π
okay bestie, so this one is from the Libcap-ng API and it's literally just two little functions that peek at your capabilities and tell you what's up π no cap, that's the whole vibe.
β¨ NAME β¨
capng_have_capabilities, capng_have_permitted_capabilities β check for capabilities π΅οΈβοΈ
πΈ SYNOPSIS πΈ
#include <cap-ng.h>
capng_results_t capng_have_capabilities(capng_select_t set);
capng_results_t capng_have_permitted_capabilities(void);
π¦ DESCRIPTION π¦
So capng_have_capabilities looks at the internal capability sets you picked and reports back what the status is, periodt. Quick warning though: those sets have to be set up before you call this β like, you gotta run capng_get_caps_process, or capng_get_caps_fd, or set them up some other way first. It's giving "you can't vibe check a set that doesn't exist yet" π
When you call it, you pass in which set you wanna check:
CAPNG_SELECT_CAPSβ the traditional capabilities, the OGsCAPNG_SELECT_BOUNDSβ the bounding setCAPNG_SELECT_BOTHβ if you want both of the above, bestieCAPNG_SELECT_AMBIENTβ if you're only checking the ambient capabilitiesCAPNG_SELECT_ALLβ if you wanna test all the sets, main character energy
And here's the tea π΅: when it checks capabilities, it only looks at the effective capabilities. That's it. That's the whole check.
BUT. If the source of your capabilities comes from a file, then you might also need to check the permitted capabilities. That's literally why capng_have_permitted_capabilities exists β it was created for exactly this situation. It takes no arguments because it's unbothered, it simply checks the permitted set. Iconic behaviour honestly π«Ά
β RETURN VALUE β
This function returns one of these four values, and they're all self explanatory fr fr:
CAPNG_FAILCAPNG_NONECAPNG_PARTIALCAPNG_FULL
π SEE ALSO π
π AUTHOR π
Steve Grubb β¨
Red Hat π Sept 2020 π¦ Libcap-ng API β okay that's the whole page bestie, go forth and check those capabilities, you ate π πβ¨
π¦ 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