Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 May 1999 22:46:03 +0700 (ALMST)
From:      Boris Popov <bp@butya.kz>
To:        freebsd-hackers@freebsd.org
Subject:   execve and VOP_CLOSE
Message-ID:  <Pine.BSF.4.05.9905212229150.32052-100000@lion.butya.kz>

next in thread | raw e-mail | index | archive | help
	Hello,

	Playing with nwfs I found that kernel execve routine calls
VOP_OPEN without following VOP_CLOSE. Instead it just do vrele which
causes call to VOP_INACTIVE. For other cases it seems that OPEN/CLOSE are
always called in pair.

	This doesn't looks like a big problem because code in VOP_INACTIVE
should check for an unclosed files/directories, but may be the following
will be more correct:

--- kern_exec.c	Sun Apr 25 14:10:54 1999
+++ kern_exec.c.new	Fri May 21 22:26:16 1999
@@ -185,6 +185,7 @@
 			goto exec_fail_dealloc;
 		if (imgp->interpreted) {
 			exec_unmap_first_page(imgp);
+			vn_close(ndp->ni_vp, FREAD, p->p_ucred, p);
 			/* free old vnode and name buffer */
 			vrele(ndp->ni_vp);
 			zfree(namei_zone, ndp->ni_cnd.cn_pnbuf);

--
Boris Popov



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9905212229150.32052-100000>