[BusyBox] bug#1043: tar having problems with long paths

Torbjörn Axelsson torax at cendio.se
Fri Sep 22 11:10:22 UTC 2000


Package: Busybox
Version: 0.47pre
Severity: critical

This applies to revision 1.65 of tar.c as well as earlier 0.47pre
versions.

The busybox tar does not handle long paths correctly. Neither does it
work with gnu tar archives (which could be a lesser problem) nor does
it create correct archives itself.

Unfortunately the changes between 1.64 and 1.65 reintroduced:
Lineo-Open-Source-Repository bug report logs - #1029
tar doesn't parse command line options correctly
(I will send another mail on that issue in a few minutes.)

Instructions for recreating the scenario follows.

/Torbjörn Axelsson, Cendio Systems


The files and their contents:

tartest.bb.tar:

bar/a/very/long/path/that/will/give/tar/problems/with/path/length/by/being/say/about/120/characters/long/or/so/file

tartest.gnu.tar:

tartest.gnu/a/very/long/path/that/will/give/tar/problems/with/path/length/by/being/say/about/120/characters/long/or/so/file

The file contains:

Howdy


Creating the archive:

mkdir -p tartest.gnu/a/very/long/path/that/will/give/tar/problems/with/path/length/by/being/say/about/120/characters/long/or/so

echo "Howdy" > tartest.gnu/a/very/long/path/that/will/give/tar/problems/with/path/length/by/being/say/about/120/characters/long/or/so/file

mkdir -p bar/a/very/long/path/that/will/give/tar/problems/with/path/length/by/being/say/about/120/characters/long/or/so

echo "Howdy" > bar/a/very/long/path/that/will/give/tar/problems/with/path/length/by/being/say/about/120/characters/long/or/so/file


Create bb test archive:

../busybox/tar cf - bar >  tartest.bb.tar


Create gnutar test archive:

tar cf tartest.gnutar.tar tartest.gnutar


The problems:

First sending the gnu archive to busybox tar:

[torax at salem tmp]$ ../busybox/tar tvf tartest.gnu.tar 
drwxrwxr-x 166/20166         0 2000-09-22 12:22:07 tartest.gnu/
[...]
drwxrwxr-x 166/20166         0 2000-09-22 12:22:07 tartest.gnu/a/very/long/path/that/will/give/tar/problems/with/path/length/by/being/say/about/120/
0--------- root/root       109 1970-01-01 01:00:00 ././@LongLink

Then sending the busybox archive to busybox tar:

[torax at salem tmp]$ ../busybox/tar tvf tartest.bb.tar 
drwxrwxr-x 166/20166         0 2000-09-22 12:22:07 bar/
[...]
drwxrwxr-x 166/20166         0 2000-09-22 12:22:07 bar/a/very/long/path/that/will/give/tar/problems/with/path/length/by/being/say/about/120/
?rwsrwsrwt 166/20166         0 2000-09-22 12:22:07 bar/a/very/long/path/that/will/give/tar/problems/with/path/length/by/being/say/about/120/characters/
?rwsrwsrwt -1/20166          0 2000-09-22 12:22:07 bar/a/very/long/path/that/will/give/tar/problems/with/path/length/by/being/say/about/120/characters/0040775/
?rwsrwsrwt -1/20166          0 2000-09-22 12:22:07 bar/a/very/long/path/that/will/give/tar/problems/with/path/length/by/being/say/about/120/characters/0040775/
?rwsrwsrwt -1/20166          0 2000-09-22 12:22:31 bar/a/very/long/path/that/will/give/tar/problems/with/path/length/by/being/say/about/120/characters/0040775/
-rw-rw-r-- 166/20166         7 2000-09-22 12:22:36 bar/a/very/long/path/that/will/give/tar/problems/with/path/length/by/being/say/about/120/characters/0100664

Now send the busybox archive to gnu tar:

[torax at salem tmp]$ tar tvf tartest.bb.tar 
drwxrwxr-x root/20166        0 2000-09-22 12:22:07 bar/
[...]
drwxrwxr-x root/20166        0 2000-09-22 12:22:07 bar/a/very/long/path/that/will/give/tar/problems/with/path/length/by/being/say/about/120/
drwxrwxr-x root/20166        0 2000-09-22 12:22:07 bar/a/very/long/path/that/will/give/tar/problems/with/path/length/by/being/say/about/120/characters/
tar: Archive contains `"0"' where numeric mode_t value expected
drwsrwsrwt root/20166        0 2000-09-22 12:22:07 bar/a/very/long/path/that/will/give/tar/problems/with/path/length/by/being/say/about/120/characters/
tar: Archive contains `"0"' where numeric mode_t value expected
drwsrwsrwt root/20166        0 2000-09-22 12:22:07 bar/a/very/long/path/that/will/give/tar/problems/with/path/length/by/being/say/about/120/characters/
tar: Archive contains `"0"' where numeric mode_t value expected
drwsrwsrwt root/20166        0 2000-09-22 12:22:31 bar/a/very/long/path/that/will/give/tar/problems/with/path/length/by/being/say/about/120/characters/
drw-rw-r-- root/20166        7 2000-09-22 12:22:36 bar/a/very/long/path/that/will/give/tar/problems/with/path/length/by/being/say/about/120/characters/
tar: Error exit delayed from previous errors







More information about the busybox mailing list