diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-11-11 02:57:49 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-11-11 02:57:49 +0000 |
commit | b8771cbd23252cfa6d956bfbf07ec48731d4aa37 (patch) | |
tree | 09614fa75b1519e3b609ccec167d52c457cbf1c2 /sys | |
parent | fa49d4908ee5419c16c8f25b5d33853a75e3686d (diff) |
ktrace vnodes do not need to be opened with FREAD, as they are
only written to. (Will keep an eye out for NFS surprises)
ok guenther
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_ktrace.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 78bad900b1b..cb01f68c3cb 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_ktrace.c,v 1.83 2015/11/02 16:31:55 semarie Exp $ */ +/* $OpenBSD: kern_ktrace.c,v 1.84 2015/11/11 02:57:48 deraadt Exp $ */ /* $NetBSD: kern_ktrace.c,v 1.23 1996/02/09 18:59:36 christos Exp $ */ /* @@ -449,7 +449,7 @@ sys_ktrace(struct proc *p, void *v, register_t *retval) NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, fname), p); nd.ni_pledge = PLEDGE_CPATH | PLEDGE_WPATH; - if ((error = vn_open(&nd, FREAD|FWRITE|O_NOFOLLOW, 0)) != 0) + if ((error = vn_open(&nd, FWRITE|O_NOFOLLOW, 0)) != 0) goto done; vp = nd.ni_vp; @@ -522,7 +522,7 @@ sys_ktrace(struct proc *p, void *v, register_t *retval) error = EPERM; done: if (vp != NULL) - (void) vn_close(vp, FREAD|FWRITE, cred, p); + (void) vn_close(vp, FWRITE, cred, p); return (error); } |