CAPNG_SET_CAPS_FD(3)

πŸ“¦ version 0.7.9, in ubuntu jammy

πŸ’– CAPNG_SET_CAPS_FD(3) πŸ’–

okay bestie, welcome to the Libcap-ng API corner of the man pages, section 3, and this one is literally about writing file-based capabilities into extended attributes πŸ¦‹


✨ NAME ✨

capng_set_caps_fd β€” write file-based capabilities to extended attributes πŸ’…


🌸 SYNOPSIS 🌸

#include <cap-ng.h>

int capng_set_caps_fd(int fd);

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the vibe: this function writes the file based capabilities to the extended attributes of the file that the descriptor was opened against. yes, the actual file, the one your fd is pointing at. it's giving "commit those caps to disk" energy ✨

one thing to know, no cap: the bounding set is not included in file based capabilities operations. so don't go looking for it there, she's simply not invited to this party πŸ™ˆ

also, real talk β€” this function will only work if it was compiled on a kernel that supports file based capabilities, such as 2.6.2 6 and later. so like, check your kernel first, bestie 🫢

πŸ’€ RETURN VALUE πŸ’€

  • returns 0 on success πŸŽ€
  • returns -1 on failure 😭

that's it. that's the whole range. periodt.


πŸ”₯ SEE ALSO πŸ”₯

go read those next, iykyk ⭐


πŸŽ€ AUTHOR πŸŽ€

Steve Grubb β€” the icon, the legend, the main character πŸ‘‘


okay and that's the whole page!! this was brought to you by Red Hat, dated June 2009, and filed under CAPNG_SET_CAPS_FD(3) in the Libcap-ng API. mwah, go write some caps πŸ’–βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from