Continue 7-CURRENT MAC Framework rearrangement and cleanup:

Don't perform a nested include of _label.h in mac.h, as mac.h now
describes only  the user API to MAC, and _label.h defines the in-kernel
representation of MAC labels.

Remove mac.h includes from policies and MAC framework components that do
not use userspace MAC API definitions.

Add _KERNEL inclusion checks to mac_internal.h and mac_policy.h, as these
are kernel-only include files

Obtained from:	TrustedBSD Project
This commit is contained in:
Robert Watson 2007-02-06 10:59:23 +00:00
parent cebf4a4ed6
commit c96ae1968a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166531
22 changed files with 10 additions and 21 deletions

View File

@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$");
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/mac.h>
#include <sys/sbuf.h>
#include <sys/systm.h>
#include <sys/mount.h>

View File

@ -43,6 +43,10 @@
#ifndef _SYS_SECURITY_MAC_MAC_INTERNAL_H_
#define _SYS_SECURITY_MAC_MAC_INTERNAL_H_
#ifndef _KERNEL
#error "no user-serviceable parts inside"
#endif
/*
* MAC Framework sysctl namespace.
*/

View File

@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$");
#include "opt_mac.h"
#include <sys/param.h>
#include <sys/mac.h>
#include <sys/sysctl.h>
#include <sys/systm.h>

View File

@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/mac.h>
#include <sys/sbuf.h>
#include <sys/systm.h>
#include <sys/vnode.h>

View File

@ -43,6 +43,12 @@
#ifndef _SYS_SECURITY_MAC_MAC_POLICY_H_
#define _SYS_SECURITY_MAC_MAC_POLICY_H_
#ifndef _KERNEL
#error "no user-serviceable parts inside"
#endif
#include <sys/_label.h>
/*-
* Pluggable access control policy definition structure.
*

View File

@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$");
#include <sys/kernel.h>
#include <sys/ksem.h>
#include <sys/malloc.h>
#include <sys/mac.h>
#include <sys/module.h>
#include <sys/systm.h>
#include <sys/sysctl.h>

View File

@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/mac.h>
#include <sys/systm.h>
#include <sys/vnode.h>
#include <sys/sysctl.h>

View File

@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$");
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/mac.h>
#include <sys/sbuf.h>
#include <sys/systm.h>
#include <sys/vnode.h>

View File

@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$");
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/mac.h>
#include <sys/sbuf.h>
#include <sys/systm.h>
#include <sys/vnode.h>

View File

@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$");
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/mac.h>
#include <sys/sbuf.h>
#include <sys/systm.h>
#include <sys/vnode.h>

View File

@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$");
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/mac.h>
#include <sys/proc.h>
#include <sys/sbuf.h>
#include <sys/systm.h>

View File

@ -46,7 +46,6 @@
#include <sys/extattr.h>
#include <sys/kernel.h>
#include <sys/ksem.h>
#include <sys/mac.h>
#include <sys/malloc.h>
#include <sys/mman.h>
#include <sys/mount.h>

View File

@ -49,7 +49,6 @@
#include <sys/kernel.h>
#include <sys/jail.h>
#include <sys/lock.h>
#include <sys/mac.h>
#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/mutex.h>

View File

@ -45,7 +45,6 @@
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/kernel.h>
#include <sys/mac.h>
#include <sys/mount.h>
#include <sys/proc.h>
#include <sys/systm.h>

View File

@ -46,7 +46,6 @@
#include <sys/extattr.h>
#include <sys/kernel.h>
#include <sys/ksem.h>
#include <sys/mac.h>
#include <sys/mman.h>
#include <sys/malloc.h>
#include <sys/mount.h>

View File

@ -48,7 +48,6 @@
#include <sys/conf.h>
#include <sys/extattr.h>
#include <sys/kernel.h>
#include <sys/mac.h>
#include <sys/mount.h>
#include <sys/proc.h>
#include <sys/systm.h>

View File

@ -43,7 +43,6 @@
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/kernel.h>
#include <sys/mac.h>
#include <sys/mount.h>
#include <sys/priv.h>
#include <sys/proc.h>

View File

@ -62,7 +62,6 @@
#include <sys/kernel.h>
#include <sys/libkern.h>
#include <sys/lock.h>
#include <sys/mac.h>
#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/mutex.h>

View File

@ -44,7 +44,6 @@
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/kernel.h>
#include <sys/mac.h>
#include <sys/mount.h>
#include <sys/priv.h>
#include <sys/proc.h>

View File

@ -52,7 +52,6 @@
#include <sys/extattr.h>
#include <sys/kernel.h>
#include <sys/ksem.h>
#include <sys/mac.h>
#include <sys/mount.h>
#include <sys/proc.h>
#include <sys/systm.h>

View File

@ -47,7 +47,6 @@
#include <sys/extattr.h>
#include <sys/kernel.h>
#include <sys/ksem.h>
#include <sys/mac.h>
#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/proc.h>

View File

@ -47,8 +47,6 @@
#ifndef _SYS_MAC_H_
#define _SYS_MAC_H_
#include <sys/_label.h>
#ifndef _POSIX_MAC
#define _POSIX_MAC
#endif