Deleted Added
full compact
mac_vfs.c (106217) mac_vfs.c (106308)
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 *
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_vfs.c 106217 2002-10-30 18:48:51Z rwatson $
39 * $FreeBSD: head/sys/security/mac/mac_vfs.c 106308 2002-11-01 20:46:53Z 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

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

2165
2166 MAC_CHECK(check_ifnet_transmit, ifnet, &ifnet->if_label, mbuf,
2167 &mbuf->m_pkthdr.label);
2168
2169 return (error);
2170}
2171
2172int
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

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

2165
2166 MAC_CHECK(check_ifnet_transmit, ifnet, &ifnet->if_label, mbuf,
2167 &mbuf->m_pkthdr.label);
2168
2169 return (error);
2170}
2171
2172int
2173mac_check_kenv_dump(struct ucred *cred)
2174{
2175 int error;
2176
2177 if (!mac_enforce_system)
2178 return (0);
2179
2180 MAC_CHECK(check_kenv_dump, cred);
2181
2182 return (error);
2183}
2184
2185int
2186mac_check_kenv_get(struct ucred *cred, char *name)
2187{
2188 int error;
2189
2190 if (!mac_enforce_system)
2191 return (0);
2192
2193 MAC_CHECK(check_kenv_get, cred, name);
2194
2195 return (error);
2196}
2197
2198int
2199mac_check_kenv_set(struct ucred *cred, char *name, char *value)
2200{
2201 int error;
2202
2203 if (!mac_enforce_system)
2204 return (0);
2205
2206 MAC_CHECK(check_kenv_set, cred, name, value);
2207
2208 return (error);
2209}
2210
2211int
2212mac_check_kenv_unset(struct ucred *cred, char *name)
2213{
2214 int error;
2215
2216 if (!mac_enforce_system)
2217 return (0);
2218
2219 MAC_CHECK(check_kenv_unset, cred, name);
2220
2221 return (error);
2222}
2223
2224int
2173mac_check_mount_stat(struct ucred *cred, struct mount *mount)
2174{
2175 int error;
2176
2177 if (!mac_enforce_fs)
2178 return (0);
2179
2180 MAC_CHECK(check_mount_stat, cred, mount, &mount->mnt_mntlabel);

--- 1269 unchanged lines hidden ---
2225mac_check_mount_stat(struct ucred *cred, struct mount *mount)
2226{
2227 int error;
2228
2229 if (!mac_enforce_fs)
2230 return (0);
2231
2232 MAC_CHECK(check_mount_stat, cred, mount, &mount->mnt_mntlabel);

--- 1269 unchanged lines hidden ---