summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 0970562..a37b9f1 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1376,7 +1376,7 @@ exec_check_permissions(imgp)
struct vnode *vp = imgp->vp;
struct vattr *attr = imgp->attr;
struct thread *td;
- int error;
+ int error, writecount;
td = curthread;
@@ -1421,7 +1421,10 @@ exec_check_permissions(imgp)
* Check number of open-for-writes on the file and deny execution
* if there are any.
*/
- if (vp->v_writecount)
+ error = VOP_GET_WRITECOUNT(vp, &writecount);
+ if (error != 0)
+ return (error);
+ if (writecount != 0)
return (ETXTBSY);
/*
OpenPOWER on IntegriCloud