Deleted Added
full compact
mac_internal.h (111883) mac_internal.h (111936)
1/*-
2 * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson
3 * Copyright (c) 2001 Ilmar S. Habibulin
4 * Copyright (c) 2001, 2002 Networks Associates Technology, Inc.
5 * All rights reserved.
6 *
7 * This software was developed by Robert Watson and Ilmar Habibulin for the
8 * TrustedBSD Project.

--- 19 unchanged lines hidden (view full) ---

28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
1/*-
2 * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson
3 * Copyright (c) 2001 Ilmar S. Habibulin
4 * Copyright (c) 2001, 2002 Networks Associates Technology, Inc.
5 * All rights reserved.
6 *
7 * This software was developed by Robert Watson and Ilmar Habibulin for the
8 * TrustedBSD Project.

--- 19 unchanged lines hidden (view full) ---

28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * $FreeBSD: head/sys/security/mac/mac_internal.h 111883 2003-03-04 21:03:05Z jhb $
36 * $FreeBSD: head/sys/security/mac/mac_internal.h 111936 2003-03-05 23:50:15Z rwatson $
37 */
38/*
39 * Developed by the TrustedBSD Project.
40 *
41 * Framework for extensible kernel access control. Kernel and userland
42 * interface to the framework, policy registration and composition.
43 */
44

--- 2644 unchanged lines hidden (view full) ---

2689 if (!mac_enforce_system)
2690 return (0);
2691
2692 MAC_CHECK(check_system_swapon, cred, vp, &vp->v_label);
2693 return (error);
2694}
2695
2696int
37 */
38/*
39 * Developed by the TrustedBSD Project.
40 *
41 * Framework for extensible kernel access control. Kernel and userland
42 * interface to the framework, policy registration and composition.
43 */
44

--- 2644 unchanged lines hidden (view full) ---

2689 if (!mac_enforce_system)
2690 return (0);
2691
2692 MAC_CHECK(check_system_swapon, cred, vp, &vp->v_label);
2693 return (error);
2694}
2695
2696int
2697mac_check_system_swapoff(struct ucred *cred, struct vnode *vp)
2698{
2699 int error;
2700
2701 ASSERT_VOP_LOCKED(vp, "mac_check_system_swapoff");
2702
2703 if (!mac_enforce_system)
2704 return (0);
2705
2706 MAC_CHECK(check_system_swapoff, cred, vp, &vp->v_label);
2707 return (error);
2708}
2709
2710int
2697mac_check_system_sysctl(struct ucred *cred, int *name, u_int namelen,
2698 void *old, size_t *oldlenp, int inkernel, void *new, size_t newlen)
2699{
2700 int error;
2701
2702 /*
2703 * XXXMAC: We're very much like to assert the SYSCTL_LOCK here,
2704 * but since it's not exported from kern_sysctl.c, we can't.

--- 978 unchanged lines hidden ---
2711mac_check_system_sysctl(struct ucred *cred, int *name, u_int namelen,
2712 void *old, size_t *oldlenp, int inkernel, void *new, size_t newlen)
2713{
2714 int error;
2715
2716 /*
2717 * XXXMAC: We're very much like to assert the SYSCTL_LOCK here,
2718 * but since it's not exported from kern_sysctl.c, we can't.

--- 978 unchanged lines hidden ---