From astralblue@usa.net  Sun Jan 17 04:17:57 1999
Received: from gw1.pl.cp (redion.nttmcl.com [216.69.69.40])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA11156
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 17 Jan 1999 04:17:51 -0800 (PST)
          (envelope-from astralblue@usa.net)
Received: from localhost (gene@localhost)
	by gw1.pl.cp (8.9.1/8.9.1) with SMTP id EAA24453
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 17 Jan 1999 04:17:30 -0800 (PST)
	(envelope-from astralblue@usa.net)
Message-Id: <Pine.BSF.4.02A.9901170354270.24302-200000@gw1.pl.cp>
Date: Sun, 17 Jan 1999 04:17:29 -0800 (PST)
From: "Eugene M. Kim" <astralblue@usa.net>
To: FreeBSD-gnats-submit@freebsd.org
Subject: mtree(8) fails/malfunctions on certain 8-bit filenames

>Number:         9538
>Category:       bin
>Synopsis:       mtree(8) fails/malfunctions on certain 8-bit filenames
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 17 04:20:00 PST 1999
>Closed-Date:    Sun Jan 17 22:58:45 PST 1999
>Last-Modified:  Sun Jan 17 22:59:14 PST 1999
>Originator:     Eugene M. Kim
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
N/A
>Environment:

FreeBSD gw1.pl.cp 3.0-CURRENT FreeBSD 3.0-CURRENT #2: Sun Jan 10 23:52:23 PST 1999 root@gw1.pl.cp:/pubfs/1/root/usr.src/sys/compile/GW-PL  i386

>Description:

The recent change in mtree(8)'s behavior (escaping filenames using
strvis(3)/strunvis(3)) opened two bugs.

Because the special characters '/', '*', '?' and '[' are checked before
the `spec' filename is strunvis(3)'ed, the corresponding metacharacters
(M-/, M-* and so on) are misinterpreted.  The misinterpretation of M-/
triggers the no-embedded-slash check and chokes mtree -d to death, and
others make mtree -d fnmatch() filenames against the spec while it
should not.

>How-To-Repeat:

Make files with offending characters in their name and run ``mtree |
mtree -d'' in the directory.  mtree -d will die upon a filename with 
M-/.

>Fix:
	
Apply the attached patch from /usr.  Note that this patch is
backward-compatible with the previous strvis/strunvis version, since
strunvis() understands both old and new format.

-- 
Eugene M. Kim <astralblue@usa.net>

"Is your music unpopular?  Make it popular; make music
which people like, or make people who like your music."

--0-523022815-916575449=:24302
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="50.mtree"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.BSF.4.02A.9901170417290.24302@gw1.pl.cp>
Content-Description: 
Content-Disposition: attachment; filename="50.mtree"

ZGlmZiAtY3Igc3JjL3Vzci5zYmluL210cmVlL2NyZWF0ZS5jIHNyYy91c3Iu
c2Jpbi9tdHJlZS5uZXcvY3JlYXRlLmMNCioqKiBzcmMvdXNyLnNiaW4vbXRy
ZWUvY3JlYXRlLmMJVHVlIEphbiAxMiAwMjozMzozNyAxOTk5DQotLS0gc3Jj
L3Vzci5zYmluL210cmVlLm5ldy9jcmVhdGUuYwlTdW4gSmFuIDE3IDA0OjA1
OjAwIDE5OTkNCioqKioqKioqKioqKioqKg0KKioqIDE0NCwxNTAgKioqKg0K
ICAJZXNjYXBlZF9uYW1lID0gY2FsbG9jKDEsIHAtPmZ0c19uYW1lbGVuICog
NCAgKyAgMSk7DQogIAlpZiAoZXNjYXBlZF9uYW1lID09IE5VTEwpDQogIAkJ
ZXJyeCgxLCAic3RhdGYoKTogY2FsbG9jKCkgZmFpbGVkIik7DQohIAlzdHJ2
aXMoZXNjYXBlZF9uYW1lLCBwLT5mdHNfbmFtZSwgVklTX1dISVRFKTsNCiAg
DQogIAlpZiAoaWZsYWcgfHwgU19JU0RJUihwLT5mdHNfc3RhdHAtPnN0X21v
ZGUpKQ0KICAJCW9mZnNldCA9IHByaW50ZigiJSpzJXMiLCBpbmRlbnQsICIi
LCBlc2NhcGVkX25hbWUpOw0KLS0tIDE0NCwxNTAgLS0tLQ0KICAJZXNjYXBl
ZF9uYW1lID0gY2FsbG9jKDEsIHAtPmZ0c19uYW1lbGVuICogNCAgKyAgMSk7
DQogIAlpZiAoZXNjYXBlZF9uYW1lID09IE5VTEwpDQogIAkJZXJyeCgxLCAi
c3RhdGYoKTogY2FsbG9jKCkgZmFpbGVkIik7DQohIAlzdHJ2aXMoZXNjYXBl
ZF9uYW1lLCBwLT5mdHNfbmFtZSwgVklTX1dISVRFIHwgVklTX09DVEFMKTsN
CiAgDQogIAlpZiAoaWZsYWcgfHwgU19JU0RJUihwLT5mdHNfc3RhdHAtPnN0
X21vZGUpKQ0KICAJCW9mZnNldCA9IHByaW50ZigiJSpzJXMiLCBpbmRlbnQs
ICIiLCBlc2NhcGVkX25hbWUpOw0K
--0-523022815-916575449=:24302--
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jkoshy 
State-Changed-When: Sun Jan 17 22:58:45 PST 1999 
State-Changed-Why:  
Fixed in rev 1.13 of "src/usr.sbin/mtree/create.c", thanks! 
>Unformatted:
   This message is in MIME format.  The first part should be readable text,
   while the remaining parts are likely unreadable without MIME-aware tools.
   Send mail to mime@docserver.cac.washington.edu for more info.
 
 --0-523022815-916575449=:24302
 Content-Type: TEXT/PLAIN; charset=US-ASCII
 
 
