summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-02-27 18:32:23 +0000
committerjhb <jhb@FreeBSD.org>2002-02-27 18:32:23 +0000
commit3706cd350927f08fa8742cce9448c9ba8e4d6b2c (patch)
treede74317436bc6bf8211535e1dbda3f6762d05582 /sys/kern/kern_exec.c
parentec01b5bdbc40025303ba133be03a747c8dc62a2c (diff)
downloadFreeBSD-src-3706cd350927f08fa8742cce9448c9ba8e4d6b2c.zip
FreeBSD-src-3706cd350927f08fa8742cce9448c9ba8e4d6b2c.tar.gz
Simple p_ucred -> td_ucred changes to start using the per-thread ucred
reference.
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 3a1b56c..6905adf 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -837,10 +837,12 @@ exec_check_permissions(imgp)
struct proc *p = imgp->proc;
struct vnode *vp = imgp->vp;
struct vattr *attr = imgp->attr;
+ struct thread *td;
int error;
+ td = curthread; /* XXXKSE */
/* Get file attributes */
- error = VOP_GETATTR(vp, attr, p->p_ucred, curthread); /* XXXKSE */
+ error = VOP_GETATTR(vp, attr, td->td_ucred, td);
if (error)
return (error);
@@ -854,9 +856,8 @@ exec_check_permissions(imgp)
*/
if ((vp->v_mount->mnt_flag & MNT_NOEXEC) ||
((attr->va_mode & 0111) == 0) ||
- (attr->va_type != VREG)) {
+ (attr->va_type != VREG))
return (EACCES);
- }
/*
* Zero length files can't be exec'd
@@ -867,7 +868,7 @@ exec_check_permissions(imgp)
/*
* Check for execute permission to file based on current credentials.
*/
- error = VOP_ACCESS(vp, VEXEC, p->p_ucred, curthread); /* XXXKSE */
+ error = VOP_ACCESS(vp, VEXEC, td->td_ucred, td);
if (error)
return (error);
@@ -882,11 +883,8 @@ exec_check_permissions(imgp)
* Call filesystem specific open routine (which does nothing in the
* general case).
*/
- error = VOP_OPEN(vp, FREAD, p->p_ucred, curthread); /* XXXKSE */
- if (error)
- return (error);
-
- return (0);
+ error = VOP_OPEN(vp, FREAD, td->td_ucred, td);
+ return (error);
}
/*
OpenPOWER on IntegriCloud