From 2f86c7eb1586742428169502d63e646612344f7b Mon Sep 17 00:00:00 2001 From: ache Date: Wed, 23 Apr 1997 22:07:05 +0000 Subject: Don't clobber user space argv0 memory on shell exec, mainly for vfork() Fix another bug: if argv[0] is NULL, garbadge args might be added for shell script Submitted by: Tor Egge (with yet one fault detect from me) --- sys/kern/imgact_shell.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sys/kern/imgact_shell.c') diff --git a/sys/kern/imgact_shell.c b/sys/kern/imgact_shell.c index fb03011..526aac7 100644 --- a/sys/kern/imgact_shell.c +++ b/sys/kern/imgact_shell.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: imgact_shell.c,v 1.14 1997/02/22 09:38:57 peter Exp $ */ #include @@ -126,8 +126,7 @@ exec_shell_imgact(imgp) } } - /* set argv[0] to point to original file name */ - suword(imgp->uap->argv, (int)imgp->uap->fname); + imgp->argv0 = imgp->uap->fname; return(0); } -- cgit v1.1