Hi,

Since version 1.30, tar lacks an unambiguous listing format, by which I mean an output of tar -t that one can then pass to tar -x and will correctly represent all legal paths.

The natural approach, I think, would be to have an argument something like -print0 that could then be passed to tar --null

Currently, tar listings may be quoted or unquoted.

Unquoted paths are ambiguous, because you don't know if a newline represents a newline in a path or is a separator between paths.

Quoted paths are unambiguous; however since tar 1.30,
--verbatim-files-from (which is necessary to cope with paths starting with a - which are otherwise treated as command-line arguments) does not unquote paths.

So if you (might) have paths that start - and paths that contain
newlines, you can't win[0].

It used to be possible to correctly and unambiguously use quoted paths
and --verbatim-files-from together because --verbatim-files-from would unquote. That was broken with the following change in tar (which went into 1.30):

"
2017-11-09  Sergey Poznyakoff  <g...@gnu.org.ua>

        Fix --verbatim-files-from

        * src/names.c (read_next_name): Don't unquote name read from the
        file, if --verbatim-files-from option is in effect.
        (names_options): improve description of --verbatim-files-from
"

Regards,

Matthew
[0] this caused actual problems with "pristine-tar" in Debian, so it's not solely a theoretical concern [this was originally reported as Debian bug #1025331, but it's an upstream issue]

Reply via email to