From nobody@FreeBSD.ORG  Fri Dec 24 09:12:06 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 2C93F14CA3; Fri, 24 Dec 1999 09:12:06 -0800 (PST)
Message-Id: <19991224171206.2C93F14CA3@hub.freebsd.org>
Date: Fri, 24 Dec 1999 09:12:06 -0800 (PST)
From: mihs@wm28.csie.ncu.edu.tw
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: A bug when the pathname with some space
X-Send-Pr-Version: www-1.0

>Number:         15667
>Category:       bin
>Synopsis:       A bug when the pathname with some space
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    jkh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 24 09:20:02 PST 1999
>Closed-Date:    Mon Jan 3 21:09:17 PST 2000
>Last-Modified:  Mon Jan  3 21:09:26 PST 2000
>Originator:     Ming-I Hsieh
>Release:        FreeBSD 3.4-RELEASE
>Organization:
Wireless Network and Multimedia Laboratory
>Environment:
FreeBSD wm27 3.4-RELEASE FreeBSD 3.4-RELEASE #0: Thu Dec 23 18:41:49 CST 1999     root@wm27:/usr/src/sys/compile/mihs  i386
>Description:
When the pathname with a or more spaces. the unpack in
/usr/src/usr.sbin/pkg_install/lib/file.c will cause the
tar can't find the +CONTENTS file. Because the
if (vsystem("tar %s %s %s", args, pkg, flist ? flist : "")) {
will produce a string like "tar -$(ARGS) $PATH FILENAME.tgz ...".
It will make the tar can't find the right archive.

>How-To-Repeat:
Web Send-Pr
>Fix:
change "tar %s %s %s" to "tar %s '%s' %s"

--- file.c.orig Sat Dec 25 01:04:09 1999
+++ file.c      Sat Dec 25 01:05:08 1999
@@ -490,7 +490,7 @@
     else
        strcpy(args, "-z");
     strcat(args, " -xpf");
-    if (vsystem("tar %s %s %s", args, pkg, flist ? flist : "")) {
+    if (vsystem("tar %s '%s' %s", args, pkg, flist ? flist : "")) {
        warnx("tar extract of %s failed!", pkg);
        return 1;
     }

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->jkh 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Tue Dec 28 07:40:34 PST 1999 
Responsible-Changed-Why:  
Proposed fix looks good, over to the maintainer. 
State-Changed-From-To: open->closed 
State-Changed-By: jkh 
State-Changed-When: Mon Jan 3 21:09:17 PST 2000 
State-Changed-Why:  
Fix applied, thank you. 
>Unformatted:
