CAPNG_SET_CAPS_FD(3)
π 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
0on success π - returns
-1on 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
- ubuntu jammy: libcap-ng-dev 0.7.9-2.2build3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms