diff options
author | rwatson <rwatson@FreeBSD.org> | 2002-10-19 20:56:44 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2002-10-19 20:56:44 +0000 |
commit | ae81971478e11f94e571b00cea3b72e3a147afa0 (patch) | |
tree | adb6b87eb06753dc31d03b61ea64d93ad2d066f3 /sys/kern | |
parent | 08f5fce1188ec355c4e7a7ac154b9d41f32a6b9a (diff) | |
download | FreeBSD-src-ae81971478e11f94e571b00cea3b72e3a147afa0.zip FreeBSD-src-ae81971478e11f94e571b00cea3b72e3a147afa0.tar.gz |
Drop in the MAC check for file creation as part of open().
Approved by: re
Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_vnops.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 1fb416b..08f8093 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -140,9 +140,17 @@ restart: return (error); goto restart; } - VOP_LEASE(ndp->ni_dvp, td, cred, LEASE_WRITE); - error = VOP_CREATE(ndp->ni_dvp, &ndp->ni_vp, - &ndp->ni_cnd, vap); +#ifdef MAC + error = mac_check_vnode_create(cred, ndp->ni_dvp, + &ndp->ni_cnd, vap); + if (error == 0) { +#endif + VOP_LEASE(ndp->ni_dvp, td, cred, LEASE_WRITE); + error = VOP_CREATE(ndp->ni_dvp, &ndp->ni_vp, + &ndp->ni_cnd, vap); +#ifdef MAC + } +#endif vput(ndp->ni_dvp); vn_finished_write(mp); if (error) { |