From f05cc6dcaed2489546fccec1ee51ee8cf631fe97 Mon Sep 17 00:00:00 2001 From: ad Date: Mon, 23 Mar 2020 00:46:11 +0000 Subject: LK_SHARED is OK for VOP_ACCESS(). --- sys/kern/exec_script.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/kern/exec_script.c') diff --git a/sys/kern/exec_script.c b/sys/kern/exec_script.c index 6ac9624fd81..df39d8d7c10 100644 --- a/sys/kern/exec_script.c +++ b/sys/kern/exec_script.c @@ -1,4 +1,4 @@ -/* $NetBSD: exec_script.c,v 1.80 2019/09/15 20:21:12 christos Exp $ */ +/* $NetBSD: exec_script.c,v 1.81 2020/03/23 00:46:11 ad Exp $ */ /* * Copyright (c) 1993, 1994, 1996 Christopher G. Demetriou @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: exec_script.c,v 1.80 2019/09/15 20:21:12 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exec_script.c,v 1.81 2020/03/23 00:46:11 ad Exp $"); #ifdef _KERNEL_OPT #include "opt_script.h" @@ -216,7 +216,7 @@ check_shell: * close all open fd's when the start. That kills this * method of implementing "safe" set-id and x-only scripts. */ - vn_lock(epp->ep_vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(epp->ep_vp, LK_SHARED | LK_RETRY); error = VOP_ACCESS(epp->ep_vp, VREAD, l->l_cred); VOP_UNLOCK(epp->ep_vp); if (error == EACCES -- cgit