Skip to content

mtree bugs with filenames containing wildcards #101

@jgoerzen

Description

@jgoerzen

Let's say I have a directory containing these files, one of which contains an asterisk:

file*
file2.txt
file.txt
file3.txt

Further assume they are different sizes and have different content.

If, in the output from mtree -c, file* is emitted before the others, the later mtree verify will apparently match all four files using the rule file* and emit errors on the other three. I observed this in the wild.

A workaround is to manually edit the emitted mtree data and move file* to be after the other non-wildcard files; then it will properly verify.

Additionally, the support for wildcards in the mtree format is not documented that I can see, and probably should be. Or perhaps it should be removed, since AFAICT, no tools are generating mtree files intentionally using this feature.

I observe a call to fnmatch in verify.c which MAY be the cause of this issue. (I am not certain).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions