From modulus@h24-79-64-13.wp.shawcable.net  Fri Jul  4 11:50:32 2003
Return-Path: <modulus@h24-79-64-13.wp.shawcable.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E126337B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  4 Jul 2003 11:50:32 -0700 (PDT)
Received: from h24-79-64-13.wp.shawcable.net (h24-79-64-13.wp.shawcable.net [24.79.64.13])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C428A43FB1
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  4 Jul 2003 11:50:31 -0700 (PDT)
	(envelope-from modulus@h24-79-64-13.wp.shawcable.net)
Received: from h24-79-64-13.wp.shawcable.net (modulus@localhost [127.0.0.1])
	by h24-79-64-13.wp.shawcable.net (8.12.9/8.12.9) with ESMTP id h64IoWDQ045917
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 4 Jul 2003 13:50:32 -0500 (CDT)
	(envelope-from modulus@h24-79-64-13.wp.shawcable.net)
Received: (from modulus@localhost)
	by h24-79-64-13.wp.shawcable.net (8.12.9/8.12.9/Submit) id h64IoWX6045916;
	Fri, 4 Jul 2003 13:50:32 -0500 (CDT)
Message-Id: <200307041850.h64IoWX6045916@h24-79-64-13.wp.shawcable.net>
Date: Fri, 4 Jul 2003 13:50:32 -0500 (CDT)
From: "Christian S.J. Peron" <maneo@bsdpro.com>
Reply-To: "Christian S.J. Peron" <maneo@bsdpro.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch]: jexec does not duplicate the actions of shell searches
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         54109
>Category:       bin
>Synopsis:       [patch]: jexec does not duplicate the actions of shell searches
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 04 12:00:25 PDT 2003
>Closed-Date:    Fri Jul 04 12:15:15 PDT 2003
>Last-Modified:  Fri Jul 04 12:15:15 PDT 2003
>Originator:     Christian S.J. Peron
>Release:        FreeBSD 5.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD h24-79-64-13 5.1-RELEASE FreeBSD 5.1-RELEASE #5: Fri Jun 20 09:49:44 CDT 2003 maneo@movl:/usr/src/sys/i386/compile/RAID0 i386


	
>Description:
	jexec does not duplicate the actions of the shell searching 
	for an executable file if the specified file name does 
	not contain a slash ``/'' character.

	Its not a big deal really, but just a bit more convinient
	to do something like:

		jexec 1 ps auxw

	rather than:

		jexec 1 /bin/ps auxw

	
>How-To-Repeat:
	N/A
	
>Fix:

--- jexec.c	Fri Jul  4 13:49:54 2003
+++ jexec.c.2	Fri Jul  4 13:49:40 2003
@@ -48,7 +48,7 @@
 		err(1, "jail_attach(): %d", jid);
 	if (chdir("/") == -1)
 		err(1, "chdir(): /");
-	if (execv(argv[2], argv + 2) == -1)
+	if (execvp(argv[2], argv + 2) == -1)
 		err(1, "execv(): %s", argv[2]);
 	exit(0);
 }

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: bmilekic 
State-Changed-When: Fri Jul 4 12:14:53 PDT 2003 
State-Changed-Why:  
Committed fix.  Thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=54109 
>Unformatted:
