Some user feedback: I would have been preferable to implement the following API for filling a capability (cap_fill isn't as generally useful): int cap_fill_flag(cap_t working, cap_flag_t to, const cap_t ref, cap_flag_t from); a function that would transcribe from one capability set's from flag to the other's to flag.
Created attachment 299053 [details] implement cap_fill_flag() Here is a patch.
https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=2ffbc9d2488e044cbb4851f3218f19171bafa46c