tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pax(1) doing unnecessary read operations etc. resulting in "wrong" error codes



Hi,

I cannot find any regulations about that case in the Opengroup specifications
(http://pubs.opengroup.org/onlinepubs/007904875/utilities/pax.html), if you
know another one or I'm completely wrong, please tell me.
I also have to admit not having digged into the code of pax, but I will do if
you think my issue is a problem.

I've been playing a bit with pax(1) and its substitutions, but then
encountered a problem: pax(1) seems to resolve *every* path and going
into every leave of the hierarchy before checking substitutions. Thus, if the
resulting substitution clears the file, i.e. excludes it, you will still get
an errornous return code and an error message to stderr.
Example:
    `pax -w -f /dev/null -s '/\/proc\/.*//' /proc`
is very likely to produce errors when run as a user, though the file that
would be created is (and should be) empty.
You get exactly the result (i.e. the archive) you wanted, but you have
unnecessary disk operations (not in this example) and a return code indicating
an error, plus error messages.

I don't know if this behaviour should be fixed, and if so, how. Making a
check before every readdir might be an (expensive) option, but is only
suitable for all-character-patterns. Though if you have a more complex
pattern you should expect the tool to traverse that hierarchy, too.


Regards, Julian

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index