summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_prot.c
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2011-03-05 12:40:35 +0000
committertrasz <trasz@FreeBSD.org>2011-03-05 12:40:35 +0000
commit62f6a13e39978ed28ac30de98bfd177259f00de2 (patch)
tree8810ff86b50f45ade154877395ba9bd0885b1dea /sys/kern/kern_prot.c
parent154e7a9e1b3b5b34692d8c1e59704d1567bbc073 (diff)
downloadFreeBSD-src-62f6a13e39978ed28ac30de98bfd177259f00de2.zip
FreeBSD-src-62f6a13e39978ed28ac30de98bfd177259f00de2.tar.gz
Add two new system calls, setloginclass(2) and getloginclass(2). This makes
it possible for the kernel to track login class the process is assigned to, which is required for RCTL. This change also make setusercontext(3) call setloginclass(2) and makes it possible to retrieve current login class using id(1). Reviewed by: kib (as part of a larger patch)
Diffstat (limited to 'sys/kern/kern_prot.c')
-rw-r--r--sys/kern/kern_prot.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index 4506034..9b94825 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
#include <sys/kdb.h>
#include <sys/kernel.h>
#include <sys/lock.h>
+#include <sys/loginclass.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/refcount.h>
@@ -1842,6 +1843,8 @@ crfree(struct ucred *cr)
*/
if (cr->cr_prison != NULL)
prison_free(cr->cr_prison);
+ if (cr->cr_loginclass != NULL)
+ loginclass_free(cr->cr_loginclass);
#ifdef AUDIT
audit_cred_destroy(cr);
#endif
@@ -1878,6 +1881,7 @@ crcopy(struct ucred *dest, struct ucred *src)
uihold(dest->cr_uidinfo);
uihold(dest->cr_ruidinfo);
prison_hold(dest->cr_prison);
+ loginclass_hold(dest->cr_loginclass);
#ifdef AUDIT
audit_cred_copy(src, dest);
#endif
OpenPOWER on IntegriCloud