diff options
author | rwatson <rwatson@FreeBSD.org> | 2002-11-04 17:36:47 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2002-11-04 17:36:47 +0000 |
commit | 8ea7b65d85d2e6db58fc65fa3d88f48943998d78 (patch) | |
tree | ec799650547102270b2a608d84a408a392fd70a7 /sys | |
parent | 4a4afa18bb71ec1040123b5649b90e8c4aa20703 (diff) | |
download | FreeBSD-src-8ea7b65d85d2e6db58fc65fa3d88f48943998d78.zip FreeBSD-src-8ea7b65d85d2e6db58fc65fa3d88f48943998d78.tar.gz |
Correct use of mac_biba_subject_privileged() in swapon() code.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories
Diffstat (limited to 'sys')
-rw-r--r-- | sys/security/mac_biba/mac_biba.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/security/mac_biba/mac_biba.c b/sys/security/mac_biba/mac_biba.c index 72be3cc..95ef88f 100644 --- a/sys/security/mac_biba/mac_biba.c +++ b/sys/security/mac_biba/mac_biba.c @@ -1871,6 +1871,7 @@ mac_biba_check_system_swapon(struct ucred *cred, struct vnode *vp, struct label *label) { struct mac_biba *subj, *obj; + int error; if (!mac_biba_enabled) return (0); @@ -1878,8 +1879,9 @@ mac_biba_check_system_swapon(struct ucred *cred, struct vnode *vp, subj = SLOT(&cred->cr_label); obj = SLOT(label); - if (!mac_biba_subject_privileged(subj)) - return (EPERM); + error = mac_biba_subject_privileged(subj); + if (error) + return (error); if (!mac_biba_high_single(obj)) return (EACCES); |