CAPNG_NAME_TO_CAPABILITY(3)
β¨ CAPNG_NAME_TO_CAPABILITY(3) β¨
okay bestie, pull up a chair, we're talking about capng_name_to_capability from the Libcap-ng API β yes that's the whole manual name, we're fancy now π
πΈ NAME πΈ
capng_name_to_capability β turn capability text into an integer, no cap π
π SYNOPSIS π
#include <cap-ng.h>
int capng_name_to_capability(const char *name);
π¦ DESCRIPTION π¦
so here's the vibe: capng_name_to_capability takes the string you hand it and goes looking it up to see what its integer value would be. that's it. that's the whole job. iconic.
the string you feed in is the same name as the define in linux/capability.h, except you snip off the CAP_ prefix. bye bye prefix π
and listen β the string case does not matter. uppercase, lowercase, whatever, she's not judging. π«Ά
the integer that comes out the other side is the same as the define would be from linux/capability.h. periodt.
why do you care tho? because this is lowkey the glow-up move for taking raw string input and converting it into something you can actually use with capng_update. string in, usable value out. main character energy fr fr β¨
π RETURN VALUE π
she returns a negative number on failure, and the correct define otherwise. so like, if the number's negative, that's a no. sad. π otherwise you got what you asked for π
π SEE ALSO π
capng_capability_to_name(3)β the reverse girly, she does the opposite π¦capabilities(7)β go read it, iykyk π
π AUTHOR π
Steve Grubb β king behavior, thank you for your service π
Red Hat Β· June 2009 Β· and that's a wrap on the Libcap-ng API page for capng_name_to_capability(3) β mwah, take care of her π
ππ
π¦ 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 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