diff options
author | rwatson <rwatson@FreeBSD.org> | 2003-01-21 03:26:28 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2003-01-21 03:26:28 +0000 |
commit | 990294caa29532bfacf879f6d766999cab2c761c (patch) | |
tree | 817c2e49bc1b37ad08b9049656bf9144150e8bb4 /sys | |
parent | c1e42cc8bb6beb27c070748587d19f1d63fc956a (diff) | |
download | FreeBSD-src-990294caa29532bfacf879f6d766999cab2c761c.zip FreeBSD-src-990294caa29532bfacf879f6d766999cab2c761c.tar.gz |
Perform VOP_GETATTR() before mac_check_vnode_exec() so that
the cached attributes are available to MAC modules.
Submitted by: mike halderman <mrh@nosc.mil>
Obtained from: TrustedBSD Project
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_exec.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 0ee36ba..17e18b2 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1109,17 +1109,17 @@ exec_check_permissions(imgp) td = curthread; /* XXXKSE */ + /* Get file attributes */ + error = VOP_GETATTR(vp, attr, td->td_ucred, td); + if (error) + return (error); + #ifdef MAC error = mac_check_vnode_exec(td->td_ucred, imgp->vp, imgp); if (error) return (error); #endif - /* Get file attributes */ - error = VOP_GETATTR(vp, attr, td->td_ucred, td); - if (error) - return (error); - /* * 1) Check if file execution is disabled for the filesystem that this * file resides on. |