CAPNG_UPDATEV(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_UPDATEV β€” ok bestie, let's talk about capng_updatev(3)

So this is a libcap-ng API page, and it's literally the glow-up version of capng_update. Sit down, hydrate, and let's get into it 🫢


✨ NAME ✨

capng_updatev β€” update the stored capabilities settings πŸ’–


🌸 SYNOPSIS 🌸

#include <cap-ng.h>

int capng_updatev(capng_act_t action, capng_type_t type,      unsigned
int capability, ...);

Yes, she takes varargs. She's that girl. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so capng_updatev updates the internal POSIX capabilities settings based on the options you hand it. Think of it like editing your vibe in the group chat, but the group chat is a capability set. 😌

The action should be either CAPNG_DROP β€” which sets the capability bit to 0 β€” or CAPNG_ADD, which sets that capability bit to 1. Choose your fighter. πŸ’…

The operation lands on the capability set you specify in the type parameter. The values are:

  • CAPNG_EFFECTIVE
  • CAPNG_PERMITTED
  • CAPNG_INHERITABLE
  • CAPNG_BOUNDING_SET
  • CAPNG_AMBIENT

and the tea is: you can or them together to do the same operation on multiple sets at once. Multi-tasking queen. ✨

The last parameter, capability, is the capability define as given in linux/capability.h. iykyk. πŸ“š

Not me about to explain why she's different β€” because she IS. This function differs from capng_update in that you may pass a list of capabilities. And bestie, listen: this list must be terminated with a -1 value. No -1, no closure. It's giving "please know when to stop." 🚨


πŸ’€ RETURN VALUE πŸ’€

She returns 0 on success and -1 on failure. That's it, that's the whole personality. 🌈


πŸŽ€ SEE ALSO πŸŽ€


πŸ‘‘ AUTHOR πŸ‘‘

Steve Grubb. Respect the icon, fr fr. 🫑


k bye bestie, go forth and update those capabilities responsibly πŸ’œ

this one came to you courtesy of Red Hat, and the page itself is dated June 2009 β€” vintage but still slaying. πŸŽ€βœ¨

πŸ“¦ where this page comes from