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
This commit is contained in:
Robert Watson 2003-01-21 03:26:28 +00:00
parent 7251b4bf93
commit ec35c2af68
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=109606

View File

@ -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.