CAPNG_GET_ROOTID(3)

πŸ’– CAPNG_GET_ROOTID(3) πŸ’–

okay bestie, welcome to the libcap-ng API corner of the man pages, where we're talking about capng_get_rootid(3) and honestly? it's giving "short but important". pull up a chair 🫢


✨ NAME ✨

capng_get_rootid β€” get namespace root id 🌱


🌸 SYNOPSIS 🌸

#include <cap-ng.h>

uid_t capng_get_rootid(void);

no arguments, no drama, it just hands you a uid_t. we love a low-maintenance function πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so like, capng_get_rootid gets you the rootid that's used for file capabilities operations. that's the whole vibe.

the value it gives back is a host-endian user ID, and it lives in the caller's user namespace. host-endian!! user namespace!! iykyk, don't get it twisted πŸ”₯


πŸ‘‘ RETURN VALUE πŸ‘‘

here's the tea, and it's a two-branch situation:

  • if V3 file capabilities have not been selected, or the kernel just doesn't support them, you get CAPNG_UNSET_ROOTID back. not a slay, but it's honest πŸ’€
  • otherwise? you get the namespace root user ID. periodt ✨

🌈 SEE ALSO 🌈

go read those too, bestie, they're the supporting cast πŸŽ€


πŸŽ€ AUTHOR πŸŽ€

Steve Grubb β€” the icon who wrote this, no cap πŸ‘‘


and that's the whole page, my love!! this beauty ships as part of the libcap-ng API, brought to you by Red Hat, dated Sept 2020, and it goes by CAPNG_GET_ROOTID(3) when it's out in the wild. mwah, go forth and get those namespace root ids πŸ’–βœ¨πŸ¦‹