summaryrefslogtreecommitdiffstats
path: root/sys/sys/capability.h
diff options
context:
space:
mode:
authorjonathan <jonathan@FreeBSD.org>2011-07-15 09:37:14 +0000
committerjonathan <jonathan@FreeBSD.org>2011-07-15 09:37:14 +0000
commit70f535313aa1ca4af3ed671bb68989fe80d925ae (patch)
tree9db0c82a705512fa5a96522d6f0cde4c6be56a67 /sys/sys/capability.h
parent2b00a143ac1aa5b806a27a47d1cc3fbc36bdb704 (diff)
downloadFreeBSD-src-70f535313aa1ca4af3ed671bb68989fe80d925ae.zip
FreeBSD-src-70f535313aa1ca4af3ed671bb68989fe80d925ae.tar.gz
Add implementation for capabilities.
Code to actually implement Capsicum capabilities, including fileops and kern_capwrap(), which creates a capability to wrap an existing file descriptor. We also modify kern_close() and closef() to handle capabilities. Finally, remove cap_filelist from struct capability, since we don't actually need it. Approved by: mentor (rwatson), re (Capsicum blanket) Sponsored by: Google Inc
Diffstat (limited to 'sys/sys/capability.h')
-rw-r--r--sys/sys/capability.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/sys/capability.h b/sys/sys/capability.h
index b56aa8b..5f5c35e 100644
--- a/sys/sys/capability.h
+++ b/sys/sys/capability.h
@@ -64,6 +64,12 @@
#define IN_CAPABILITY_MODE(td) (td->td_ucred->cr_flags & CRED_FLAG_CAPMODE)
/*
+ * Create a capability to wrap a file object.
+ */
+int kern_capwrap(struct thread *td, struct file *fp, cap_rights_t rights,
+ struct file **cap, int *capfd);
+
+/*
* Unwrap a capability if its rights mask is a superset of 'rights'.
*
* Unwrapping a non-capability is effectively a no-op; the value of fp_cap
OpenPOWER on IntegriCloud