[4/9] cap_file: add new rootid argument

Submitted by Christian Brauner on Aug. 10, 2018, 4:13 p.m.


Message ID 20180810161335.27036-5-christian@brauner.io
State New
Series "libcap: add user namespace fscaps support"
Headers show

Commit Message

Christian Brauner Aug. 10, 2018, 4:13 p.m.
Newer kernels support setting file capabilities in user namespaces. In
addition to directly setting file capabilites in a user namespaces they
can also be set in lieu of another user namespace by passing a uid down
to the kernel which will convert it to an appropriate kuid_t
This commit adds a new rootid argument to the internal struct
_cap_struct so that we can store the rootid when the kernel supports
VFS_CAP_REVISION_3 and returns a struct vfs_ns_cap_data.

Signed-off-by: Christian Brauner <christian@brauner.io>
Reviewed-by: Serge Hallyn <serge@hallyn.com>
 libcap/libcap.h | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/libcap/libcap.h b/libcap/libcap.h
index 2596c11..9abe4a2 100644
--- a/libcap/libcap.h
+++ b/libcap/libcap.h
@@ -118,6 +118,7 @@  struct _cap_struct {
 	struct __user_cap_data_struct set;
 	__u32 flat[NUMBER_OF_CAP_SETS];
+    uid_t rootid;
 /* the maximum bits supportable */