CAPNG_UPDATE(3)

πŸ“¦
version 0.9.6 Β· 4 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_UPDATE(3) πŸ’–

okay bestie, welcome to the Libcap-ng API corner of the manual β€” this one's called capng_update and it's genuinely so useful, let me tell you everything 🫢


✨ NAME ✨

capng_update β€” update the stored capabilities settings πŸ’…


🌸 SYNOPSIS 🌸

#include <cap-ng.h>

int capng_update(capng_act_t action, capng_type_t type,unsigned int
capability);

(no cap, that's literally the whole signature, comma spacing and all, don't touch it πŸ™ˆ)


πŸ¦‹ DESCRIPTION πŸ¦‹

so like, capng_update goes in and updates the internal POSIX capabilities settings based on whatever options you hand it. it's giving very "i'm editing the vibe of my capability bits" energy ✨

the action is a whole choose-your-own-adventure, but there's only two choices and both are iconic:

  • CAPNG_DROP β€” sets the capability bit to 0 πŸ’€ (bye bit, you're gone)
  • CAPNG_ADD β€” sets the capability bit to 1 πŸ‘‘ (bit is back, she's thriving)

the operation lands on whichever capability set you named in the type parameter. the possible values are, in all their glory:

  • CAPNG_EFFECTIVE
  • CAPNG_PERMITTED
  • CAPNG_INHERITABLE
  • CAPNG_BOUNDING_SET
  • CAPNG_AMBIENT

and here's the slay part β€” those values can be or'ed together so you do the exact same operation on multiple sets at once. multitasking queen behavior fr fr πŸ”₯

last but never least, the capability parameter is the capability define, as given in linux/capability.h. that's it, that's the whole thing, periodt πŸ’œ


πŸŽ€ RETURN VALUE πŸŽ€

  • 0 β€” success, we ate πŸ“
  • -1 β€” failure, not the vibe 😭

🌈 SEE ALSO 🌈

iykyk πŸ‘‘


πŸ’œ AUTHOR πŸ’œ

Steve Grubb β€” thank you king, we appreciate you 🫢


okay that's the whole page bestie, sending you off with the deets: this one's from the Libcap-ng API fam, brought to you by Red Hat, dated June 2009 β€” yes she's an elder but she still serves πŸ’…βœ¨ bye now! πŸ§šπŸ’–

πŸ“¦ where this page comes from