Bug 41583 - [patch] mtree(8) assorted mtree bugs
Summary: [patch] mtree(8) assorted mtree bugs
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 4.6-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-12 20:10 UTC by Mike Hibler
Modified: 2018-07-20 11:41 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Hibler 2002-08-12 20:10:02 UTC
Three bugs in mtree:

1. Cannot handle filenames which start with '#'.
    This one has been reported before (bin/35226, bin/41246).  My "fix" is different
    than the one in 35226, I just added the '-N' option which says: when creating a
    spec, don't ever produce comments and when reading a spec, don't expect
    comments.  The aforementioned fix is probably better than mine.

2. Cannot handle symlink values with non-standard chars.
     This one has also been reported/fixed previously (bin/35454).
     My fix is essentially the same.

3. Mishandles fixing owner/mode of symlinks when using -P
    When using -P in conjunction with -U, mtree chown/chmods the
    target of the symlink rather than the symlink itself.  This does
    not match the semantics for creation of a spec file where -P gives
    you the attributes of the link.

Fix: 

Grab:
ftp://www.flux.utah.edu/flux/freebsd/mtree.patch
How-To-Repeat: Use mtree on non-trivial hierarchies.
Comment 1 Tony Finch 2002-08-13 00:09:04 UTC
Mike Hibler <mike@cs.utah.edu> wrote:
>
>1. Cannot handle filenames which start with '#'.
>    This one has been reported before (bin/35226, bin/41246).  My "fix" is different
>    than the one in 35226, I just added the '-N' option which says: when creating a
>    spec, don't ever produce comments and when reading a spec, don't expect
>    comments.  The aforementioned fix is probably better than mine.
>
>2. Cannot handle symlink values with non-standard chars.
>     This one has also been reported/fixed previously (bin/35454).
>     My fix is essentially the same.

NetBSD has an improved version of strvis() which their mtree() uses, which
we should perhaps have a closer look at. I looked at it recently, and I think
it fixes your problem #1 (at the expense of backslash-escaping hashes everywhere)
but it doesn't fix #2 -- but that should be easy to do.

Tony.
-- 
f.a.n.finch <dot@dotat.at> http://dotat.at/
FAIR ISLE SOUTH FAEROES: SOUTHERLY OR SOUTHWESTERLY 4 OR 5, OCCASIONALLY 6,
BECOMING VARIABLE 3 IN SOUTHEAST FAIR ISLE. RAIN OR SHOWERS. MODERATE OR GOOD.
Comment 2 Jens Schweikhardt freebsd_committer 2002-08-13 18:09:27 UTC
State Changed
From-To: open->analyzed

mtree has problems with whitespace and # and possibly other 
characters. If you are going to address this, please also look 
at the patches in the PRs 35226 and 35454 and make sure 41426 
is handled okay as well. I will close the three mentioned PRs 
and make this one the meta PR for mtree.
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2012-07-01 17:10:35 UTC
State Changed
From-To: analyzed->open

unowned PRs must not be in analyzed state
Comment 4 Enji Cooper freebsd_committer 2017-11-05 20:59:16 UTC
Handing a number of makefs, mtree, and msdosfs bugs in my queue over to emaste@.
Comment 5 Ed Maste freebsd_committer 2017-11-21 01:38:15 UTC
I do not expect to be able to look at these in the short term.
Comment 6 Eitan Adler freebsd_committer freebsd_triage 2018-05-20 23:51:12 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

Do
- Set Status to "Open"
Comment 7 Thanos 2018-07-20 11:41:15 UTC
MARKED AS SPAM