@@ -277,6 +277,16 @@ cap_t cap_get_file(const char *filename)
return result;
}
+/*
+ * Get rootid as seen in the current user namespace for the file capability
+ * sets.
+ */
+
+uid_t cap_get_nsowner(cap_t cap_d)
+{
+ return cap_d->rootid;
+}
+
/*
* Set the capabilities of an open file, as specified by its file
* descriptor.
@@ -363,6 +373,12 @@ cap_t cap_get_file(const char *filename)
return NULL;
}
+uid_t cap_get_nsowner(cap_t cap_d)
+{
+ errno = EINVAL;
+ return -1;
+}
+
int cap_set_fd(int fildes, cap_t cap_d)
{
errno = EINVAL;
@@ -82,6 +82,7 @@ extern int cap_clear_flag(cap_t, cap_flag_t);
/* libcap/cap_file.c */
extern cap_t cap_get_fd(int);
extern cap_t cap_get_file(const char *);
+extern uid_t cap_get_nsowner(cap_t);
extern int cap_set_fd(int, cap_t);
extern int cap_set_file(const char *, cap_t);