summaryrefslogtreecommitdiffstats
path: root/sys/security/mac_biba
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2007-09-10 00:00:18 +0000
committerrwatson <rwatson@FreeBSD.org>2007-09-10 00:00:18 +0000
commit198c38400acd01acb916e7350ad6b0a60e56068e (patch)
tree6d07b0ffd85b745bb08a976a4412f5862aba277b /sys/security/mac_biba
parent2f5eb093a49d608441a859f9e1771c6dbbc128e0 (diff)
downloadFreeBSD-src-198c38400acd01acb916e7350ad6b0a60e56068e.zip
FreeBSD-src-198c38400acd01acb916e7350ad6b0a60e56068e.tar.gz
Rename mac_check_vnode_delete() MAC Framework and MAC Policy entry
point to mac_check_vnode_unlink(), reflecting UNIX naming conventions. This is the first of several commits to synchronize the MAC Framework in FreeBSD 7.0 with the MAC Framework as it will appear in Mac OS X Leopard. Reveiwed by: csjp, Samy Bahra <sbahra at gwu dot edu> Submitted by: Jacques Vidrine <nectar at apple dot com> Obtained from: Apple Computer, Inc. Sponsored by: SPARTA, SPAWAR Approved by: re (bmah)
Diffstat (limited to 'sys/security/mac_biba')
-rw-r--r--sys/security/mac_biba/mac_biba.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/sys/security/mac_biba/mac_biba.c b/sys/security/mac_biba/mac_biba.c
index 9396b38..7d56b6b 100644
--- a/sys/security/mac_biba/mac_biba.c
+++ b/sys/security/mac_biba/mac_biba.c
@@ -2625,30 +2625,6 @@ mac_biba_check_vnode_create(struct ucred *cred, struct vnode *dvp,
}
static int
-mac_biba_check_vnode_delete(struct ucred *cred, struct vnode *dvp,
- struct label *dvplabel, struct vnode *vp, struct label *vplabel,
- struct componentname *cnp)
-{
- struct mac_biba *subj, *obj;
-
- if (!mac_biba_enabled)
- return (0);
-
- subj = SLOT(cred->cr_label);
- obj = SLOT(dvplabel);
-
- if (!mac_biba_dominate_effective(subj, obj))
- return (EACCES);
-
- obj = SLOT(vplabel);
-
- if (!mac_biba_dominate_effective(subj, obj))
- return (EACCES);
-
- return (0);
-}
-
-static int
mac_biba_check_vnode_deleteacl(struct ucred *cred, struct vnode *vp,
struct label *vplabel, acl_type_t type)
{
@@ -3187,6 +3163,30 @@ mac_biba_check_vnode_stat(struct ucred *active_cred, struct ucred *file_cred,
}
static int
+mac_biba_check_vnode_unlink(struct ucred *cred, struct vnode *dvp,
+ struct label *dvplabel, struct vnode *vp, struct label *vplabel,
+ struct componentname *cnp)
+{
+ struct mac_biba *subj, *obj;
+
+ if (!mac_biba_enabled)
+ return (0);
+
+ subj = SLOT(cred->cr_label);
+ obj = SLOT(dvplabel);
+
+ if (!mac_biba_dominate_effective(subj, obj))
+ return (EACCES);
+
+ obj = SLOT(vplabel);
+
+ if (!mac_biba_dominate_effective(subj, obj))
+ return (EACCES);
+
+ return (0);
+}
+
+static int
mac_biba_check_vnode_write(struct ucred *active_cred,
struct ucred *file_cred, struct vnode *vp, struct label *vplabel)
{
@@ -3389,7 +3389,6 @@ static struct mac_policy_ops mac_biba_ops =
.mpo_check_vnode_chdir = mac_biba_check_vnode_chdir,
.mpo_check_vnode_chroot = mac_biba_check_vnode_chroot,
.mpo_check_vnode_create = mac_biba_check_vnode_create,
- .mpo_check_vnode_delete = mac_biba_check_vnode_delete,
.mpo_check_vnode_deleteacl = mac_biba_check_vnode_deleteacl,
.mpo_check_vnode_deleteextattr = mac_biba_check_vnode_deleteextattr,
.mpo_check_vnode_exec = mac_biba_check_vnode_exec,
@@ -3415,6 +3414,7 @@ static struct mac_policy_ops mac_biba_ops =
.mpo_check_vnode_setowner = mac_biba_check_vnode_setowner,
.mpo_check_vnode_setutimes = mac_biba_check_vnode_setutimes,
.mpo_check_vnode_stat = mac_biba_check_vnode_stat,
+ .mpo_check_vnode_unlink = mac_biba_check_vnode_unlink,
.mpo_check_vnode_write = mac_biba_check_vnode_write,
.mpo_associate_nfsd_label = mac_biba_associate_nfsd_label,
.mpo_create_mbuf_from_firewall = mac_biba_create_mbuf_from_firewall,
OpenPOWER on IntegriCloud