Before invoking chmod()
on a directory, if the caller does not own the directory, I would like to test that the caller has the CAP_FOWNER
capability.
From searching, it seems that I should be able to test for the CAP_FOWNER
capability by calling capable(CAP_FOWNER)
-- but capable()
is not among my man pages and does not seem to be exported by <linux/capability.h>
.
What's the right include file for capable()
, or alternatively, what's the simplest/best way to test for a linux capability?