CAPNG_NAME_TO_CAPABILITY(3)

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

✨ 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 πŸ‘‘


🌈 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