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.
--- 22 unchanged lines hidden (view full) ---
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 * $FreeBSD: head/sys/security/mac/mac_syscalls.c 103136 2002-09-09 17:12:24Z rwatson $
40 */
41/*
42 * Developed by the TrustedBSD Project.
43 *
44 * Framework for extensible kernel access control. Kernel and userland
45 * interface to the framework, policy registration and composition.
46 */
47
--- 1063 unchanged lines hidden (view full) ---
1111 Eventually, we probably want to special-case refreshing
1112 of deadfs vnodes, and if there's a lock-free race somewhere,
1113 that case might be handled here.
1114
1115 mac_update_vnode_deadfs(vp);
1116 return (0);
1117 */
1118 /* printf("vn_refreshlabel: null v_mount\n"); */
1119 if (vp->v_tag != VT_NON)
1120 printf(
1121 "vn_refreshlabel: null v_mount with non-VT_NON\n");
1122 return (EBADF);
1123 }
1124
1125 if (vp->v_vflag & VV_CACHEDLABEL) {
1126 mac_vnode_label_cache_hits++;
1127 return (0);
1128 } else
1129 mac_vnode_label_cache_misses++;
--- 1816 unchanged lines hidden (view full) ---
2946
2947static int
2948vn_setlabel(struct vnode *vp, struct label *intlabel, struct ucred *cred)
2949{
2950 int error;
2951
2952 if (vp->v_mount == NULL) {
2953 /* printf("vn_setlabel: null v_mount\n"); */
2954 if (vp->v_tag != VT_NON)
2955 printf("vn_setlabel: null v_mount with non-VT_NON\n");
2956 return (EBADF);
2957 }
2958
2959 if ((vp->v_mount->mnt_flag & MNT_MULTILABEL) == 0)
2960 return (EOPNOTSUPP);
2961
2962 /*
2963 * Multi-phase commit. First check the policies to confirm the
--- 356 unchanged lines hidden ---
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.
--- 22 unchanged lines hidden (view full) ---
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 * $FreeBSD: head/sys/security/mac/mac_syscalls.c 103136 2002-09-09 17:12:24Z rwatson $
40 */
41/*
42 * Developed by the TrustedBSD Project.
43 *
44 * Framework for extensible kernel access control. Kernel and userland
45 * interface to the framework, policy registration and composition.
46 */
47
--- 1063 unchanged lines hidden (view full) ---
1111 Eventually, we probably want to special-case refreshing
1112 of deadfs vnodes, and if there's a lock-free race somewhere,
1113 that case might be handled here.
1114
1115 mac_update_vnode_deadfs(vp);
1116 return (0);
1117 */
1118 /* printf("vn_refreshlabel: null v_mount\n"); */
1119 if (vp->v_tag != VT_NON)
1120 printf(
1121 "vn_refreshlabel: null v_mount with non-VT_NON\n");
1122 return (EBADF);
1123 }
1124
1125 if (vp->v_vflag & VV_CACHEDLABEL) {
1126 mac_vnode_label_cache_hits++;
1127 return (0);
1128 } else
1129 mac_vnode_label_cache_misses++;
--- 1816 unchanged lines hidden (view full) ---
2946
2947static int
2948vn_setlabel(struct vnode *vp, struct label *intlabel, struct ucred *cred)
2949{
2950 int error;
2951
2952 if (vp->v_mount == NULL) {
2953 /* printf("vn_setlabel: null v_mount\n"); */
2954 if (vp->v_tag != VT_NON)
2955 printf("vn_setlabel: null v_mount with non-VT_NON\n");
2956 return (EBADF);
2957 }
2958
2959 if ((vp->v_mount->mnt_flag & MNT_MULTILABEL) == 0)
2960 return (EOPNOTSUPP);
2961
2962 /*
2963 * Multi-phase commit. First check the policies to confirm the
--- 356 unchanged lines hidden ---