CAPNG_APPLY_CAPS_FD(3)
π CAPNG_APPLY_CAPS_FD(3) π
okay bestie, welcome to the Libcap-ng API corner of the man pages, where we make files hold their own capabilities like the little main characters they are β¨
πΈ NAME πΈ
capng_apply_caps_fd β write file-based capabilities to extended attributes π
π¦ SYNOPSIS π¦
#include <cap-ng.h>
int capng_apply_caps_fd(int fd);
β¨ DESCRIPTION β¨
so here's the tea, bestie π β this function writes the file based capabilities to the extended attributes of the file that the descriptor was opened against. like, the fd you hand it? that's the file getting the glow-up π
real talk: the bounding set is NOT included in file based capabilities operations. it just doesn't come to this party π ββοΈ
also, lowkey important: this function will only work if it was compiled on a kernel that supports file based capabilities, such as 2.6.26 and later. if your kernel is giving ancient energy, this isn't happening π
π₯ RETURN VALUE π₯
0β slay, it worked, success π-1β something besides a regular file got passed in, or the extended attribute operation failed π-2β the file capability data cannot be serialized π
π SEE ALSO π
π«Ά AUTHOR π«Ά
Steve Grubb
and that's the whole vibe, bestie β this page came from the Libcap-ng API, brought to you by Red Hat, dated Sept 2020, and it's literally called CAPNG_APPLY_CAPS_FD(3). periodt. ππ
π¦ where this page comes from
- arch rolling: libcap-ng 0.9.6-1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 43: libcap-ng-devel 0.9.6-1.fc43 Β· LGPL-2.0-or-later
- fedora 43: libcap-ng-devel 0.9.6-1.fc43 Β· LGPL-2.0-or-later
- fedora 44: libcap-ng-devel 0.9.6-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: libcap-ng-devel 0.9.6-1.fc44 Β· LGPL-2.0-or-later
- nixpkgs unstable: libcap-ng 0.9.6
- ubuntu stonking: libcap-ng-dev 0.9.6-1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms