aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/user.h
diff options
context:
space:
mode:
authorJonathan Anderson <jonathan@FreeBSD.org>2011-07-20 09:53:35 +0000
committerJonathan Anderson <jonathan@FreeBSD.org>2011-07-20 09:53:35 +0000
commitc30b9b51697c4e90459d26bfbdf3d7ab0c81b5c2 (patch)
treeb0320260840976b60228a102eb8ea186c13b8498 /sys/sys/user.h
parent2168aaa506e673458dfc1a93d9690f5bc3d8c1a4 (diff)
downloadsrc-c30b9b51697c4e90459d26bfbdf3d7ab0c81b5c2.tar.gz
src-c30b9b51697c4e90459d26bfbdf3d7ab0c81b5c2.zip
Export capability information via sysctls.
When reporting on a capability, flag the fact that it is a capability, but also unwrap to report all of the usual information about the underlying file. Approved by: re (kib), mentor (rwatson) Sponsored by: Google Inc
Notes
Notes: svn path=/head/; revision=224225
Diffstat (limited to 'sys/sys/user.h')
-rw-r--r--sys/sys/user.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/sys/user.h b/sys/sys/user.h
index 1863f86ffe9d..ecf4ea940138 100644
--- a/sys/sys/user.h
+++ b/sys/sys/user.h
@@ -251,6 +251,7 @@ struct user {
#define KF_TYPE_SHM 8
#define KF_TYPE_SEM 9
#define KF_TYPE_PTS 10
+/* no KF_TYPE_CAPABILITY (11), since capabilities wrap other file objects */
#define KF_TYPE_UNKNOWN 255
#define KF_VTYPE_VNON 0
@@ -286,6 +287,7 @@ struct user {
#define KF_FLAG_TRUNC 0x00001000
#define KF_FLAG_EXCL 0x00002000
#define KF_FLAG_EXEC 0x00004000
+#define KF_FLAG_CAPABILITY 0x00008000
/*
* Old format. Has variable hidden padding due to alignment.
@@ -378,7 +380,9 @@ struct kinfo_file {
} kf_un;
uint16_t kf_status; /* Status flags. */
uint16_t kf_pad1; /* Round to 32 bit alignment. */
- int _kf_ispare[7]; /* Space for more stuff. */
+ int _kf_ispare0; /* Space for more stuff. */
+ cap_rights_t kf_cap_rights; /* Capability rights. */
+ int _kf_ispare[4]; /* Space for more stuff. */
/* Truncated before copyout in sysctl */
char kf_path[PATH_MAX]; /* Path to file, if any. */
};