Date: Fri, 22 Aug 2003 10:00:54 -0700 (PDT) From: Chris Vance <cvance@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 36681 for review Message-ID: <200308221700.h7MH0sgh025124@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=36681 Change 36681 by cvance@cvance_osx_laptop on 2003/08/22 10:00:48 Insert calls to the MAC framework to initialize/destroy cred labels Affected files ... .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_prot.c#2 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_prot.c#2 (text+ko) ==== @@ -72,6 +72,7 @@ #include <sys/timeb.h> #include <sys/times.h> #include <sys/malloc.h> +#include <sys/mac.h> #include <sys/mount.h> #include <mach/message.h> @@ -659,6 +660,9 @@ MALLOC_ZONE(cr, struct ucred *, sizeof(*cr), M_CRED, M_WAITOK); bzero((caddr_t)cr, sizeof(*cr)); cr->cr_ref = 1; +#ifdef MAC + mac_init_cred(cr); +#endif return (cr); } @@ -674,8 +678,12 @@ if (cr == NOCRED || cr == FSCRED) panic("crfree"); #endif - if (--cr->cr_ref == 0) + if (--cr->cr_ref == 0) { +#ifdef MAC + mac_destroy_cred(cr); +#endif FREE_ZONE((caddr_t)cr, sizeof *cr, M_CRED); + } } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200308221700.h7MH0sgh025124>