Subject: bin/7663: mtree(8) complains about things that in fact match
To: None <qiclab!gnats.netbsd.org!gnats-bugs@netbsd.org>
From: No Spam <qiclab!sopwith.UUCP!nospam@netbsd.org>
List: netbsd-bugs
Date: 05/29/1999 11:36:34
>Number: 7663
>Category: bin
>Synopsis: mtree(8) does not handle filenames beginning with # correctly
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: bin-bug-people (Utility Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat May 29 11:35:02 1999
>Last-Modified:
>Originator: Der Beagle
>Organization:
>Release: 1.3.3
>Environment:
System: NetBSD sopwith 1.3.3 NetBSD 1.3.3 (GENERIC) #7: Fri Dec 11 21:32:58 PST 1998 ross@zeta:/usr/src/sys/arch/alpha/compile/GENERIC alpha
>Description:
From the mtree(8) man page:
Empty lines and lines whose first non-whitespace character is a hash mark
(``#'') are ignored.
This results in incorrect behaviour if filenames begin with '#'.
Mtree then reports the '#' file as being "extra".
If the filename is long enough for mtree -c to split the output
line, even more bogus errors are reported.
This happens on both 1.3.3 and 1.4.
In addition to the '#' problem, I also observe incorrect complaints
about flags not matching when they should. I haven't been able to
generate a demo from scratch, but here is an example:
machtoo ls -lao
total 2
drwxr-xr-x 2 root wheel - 512 Dec 29 1997 .
drwxr-xr-x 21 root wheel - 1024 Feb 6 1998 ..
machtoo mtree -c | mtree
.: flags ("none" is not "none")
machtoo mtree -c
# user: snoopy
# machine: machtoo.uucp
# tree: /a/home
# date: Sat May 29 11:21:39 1999
# .
. type=dir mode=0755 nlink=2 time=883450272.0 flags=none
machtoo
>How-To-Repeat:
machtoo pwd
/tmp
machtoo touch foo
machtoo ls -lao
total 2
drwxrwxrwt 2 root wheel - 512 May 29 10:43 .
drwxr-xr-x 18 root wheel - 512 May 26 18:45 ..
-rw-r--r-- 1 snoopy wheel - 0 May 29 10:43 foo
machtoo mtree -c | mtree
machtoo touch "#abc"
machtoo mtree -c | mtree
extra: #abc
machtoo mv "#abc" "#aaaaaaaaaaaaaaaa"
machtoo mtree -c | mtree
.: size (0, 512)
modification time (Sat May 29 10:44:10 1999, Sat May 29 10:44:31 1999)
extra: #aaaaaaaaaaaaaaaa
machtoo mtree -c
# user: snoopy
# machine: machtoo.uucp
# tree: /tmp
# date: Sat May 29 10:44:36 1999
# .
/set type=file gid=0 uid=901 mode=0644 nlink=1 flags=none
. type=dir uid=0 mode=01777 nlink=2 time=927999871.254883000
#aaaaaaaaaaaaaaaa \
size=0 time=927999850.812500000
foo size=0 time=927999835.137695000
machtoo
>Fix:
I suggest having mtree only treat '#' as a comment when it appears at
the very beginning of a line, without whitespace.
>Audit-Trail:
>Unformatted: