First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 37132
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo's Team for Core System packages <base-system@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Daniel Ahlberg (RETIRED) <aliz@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
ebuild.sh.diff ebuild.sh.diff patch Tony Vroon 2004-01-03 12:40 0000 329 bytes Details | Diff
1.13.92-disable-dotslash-check.diff 1.13.92-disable-dotslash-check.diff patch Tony Vroon 2004-01-03 13:14 0000 282 bytes Details | Diff
tar-1.13.92.ebuild.diff tar-1.13.92.ebuild.diff patch Tony Vroon 2004-01-03 13:15 0000 357 bytes Details | Diff
1.13.92-hardcode-absolute-names-to-on.diff 1.13.92-hardcode-absolute-names-to-on.diff patch Tony Vroon 2004-01-03 13:58 0000 413 bytes Details | Diff
tar-1.13.92.ebuild.diff tar-1.13.92.ebuild.diff patch Tony Vroon 2004-01-03 13:59 0000 396 bytes Details | Diff
tar-1.13.92-fix-pathstrip.patch tar-1.13.92-fix-pathstrip.patch patch Martin Schlemmer (RETIRED) 2004-01-06 10:58 0000 356 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 37132 depends on: Show dependency tree
Bug 37132 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2004-01-03 12:05 0000
Some tar archives has paths like these in them: ..././...
when trying to unpack these archives with tar 1.13.92 it gives the following warning: tar: Removing leading ...

Confirmed tarballs that suffers from this are: libpcap-0.8.1, tcpdump-3.8.1 and iptables-1.2.9

------- Comment #1 From Tony Vroon 2004-01-03 12:10:47 0000 -------
The tar problem manifests itself like this:

>>> md5 src_uri ;-) tcpdump-3.8.1.tar.gz
>>> Unpacking source...
>>> Unpacking tcpdump-3.8.1.tar.gz to /var/tmp/portage/tcpdump-3.8.1/work
tar: Removing leading `tcpdump-3.8.1/./' from member names
>>> Source unpacked.

!!! ERROR: net-analyzer/tcpdump-3.8.1 failed.
!!! Function econf, Line 341, Exitcode 1
!!! no configure script found

And those weird paths are actually in the mentioned tar's:
tcpdump-3.8.1/./
tcpdump-3.8.1/./lbl/
tcpdump-3.8.1/./lbl/os-osf4.h
(truncated)

------- Comment #2 From Daniel Ahlberg (RETIRED) 2004-01-03 12:13:21 0000 -------
The result is that tar strips out the subdir in the tarball unpacking it
directly to $PORTAGE_TMDIR/work and not $PORTAGE_TMPDIR/work/libpcap-0.8.1

------- Comment #3 From Tony Vroon 2004-01-03 12:21:00 0000 -------
A fragment from tar-1.13.92/ChangeLog
One entry seems relevant, marked with <!>

003-11-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>

        * src/tar.h (archive_format): USTAR_FORMAT: New type.
        * src/create.c: Added POSIX.1-1988 support.
    <!>* src/names.c (safer_name_suffix): Skip leading ./
        * src/tar.c: New option --format=ustar forces
        POSIX.1-1988 archive format.
        * tests/delete03.sh: Updated.
        * tests/extrac04.sh: Updated.
        * tests/multiv01.sh: Updated.

------- Comment #4 From Tony Vroon 2004-01-03 12:34:48 0000 -------
Looks as if the "P" option to tar (--absolute-names) disables the check.
Playing around with this.

------- Comment #5 From Tony Vroon 2004-01-03 12:40:33 0000 -------
Created an attachment (id=23085) [details]
ebuild.sh.diff

This adds --absolute-names to the unpack command in ebuild.sh and allows me to
install libpcap.
Please perform a sanity check on this and treat it with care until I've tested
more thoroughly.

------- Comment #6 From SpanKY 2004-01-03 12:42:11 0000 -------
i dont really think the way to go is patching ebuild.sh

it's obvious it's a bug in tar, fix tar and we dont have to screw around with releasing another portage

------- Comment #7 From Tony Vroon 2004-01-03 12:45:56 0000 -------
Tested with:  libpcap-0.8.1, tcpdump-3.8.1 and iptables-1.2.9
These weren't willing to install earlier and work now.

Tested with: kdegames-3.2.0_beta2, tar-1.13.92 and portage-2.0.49-r20
These worked before, and still work now.

------- Comment #8 From Tony Vroon 2004-01-03 12:47:02 0000 -------
I'm not a C coder though.

Could mask the tar version, file a bug upstream or have someone else hack on names.c, I guess.

Anyway, should anyone be willing to take this route, it will work.

------- Comment #9 From Tony Vroon 2004-01-03 13:14:27 0000 -------
Created an attachment (id=23092) [details]
1.13.92-disable-dotslash-check.diff

This hardcodes the (apparently buggy) check to disabled in the tar sources.
Basically, this is the same solution as provided earlier, but then in a way
that doesn't require a portage upgrade (which would be tedious indeed, SpanKY,
agreed).

------- Comment #10 From Tony Vroon 2004-01-03 13:15:20 0000 -------
Created an attachment (id=23093) [details]
tar-1.13.92.ebuild.diff

And ofcourse the diff to the tar ebuild to apply this diff.

How's this? (Tested again, same 6 packages)

------- Comment #11 From SpanKY 2004-01-03 13:50:55 0000 -------
absolute_names_option is referenced in both src/extract.c and src/names.c, so
perhaps the better way of doing it is to patch src/tar.c around line 1246 with
absolute_names_option = true;

------- Comment #12 From Tony Vroon 2004-01-03 13:58:43 0000 -------
Created an attachment (id=23099) [details]
1.13.92-hardcode-absolute-names-to-on.diff

Redoing things the hardcoded way, in tar.c, as asked.

------- Comment #13 From Tony Vroon 2004-01-03 13:59:37 0000 -------
Created an attachment (id=23100) [details]
tar-1.13.92.ebuild.diff

And the ebuild change to have the patch applied.

Bugfixes to order, anyone else that would like a change? :)

------- Comment #14 From SpanKY 2004-01-03 21:54:31 0000 -------
*** Bug 37157 has been marked as a duplicate of this bug. ***

------- Comment #15 From Daniel Ahlberg (RETIRED) 2004-01-04 02:52:35 0000 -------
*** Bug 37170 has been marked as a duplicate of this bug. ***

------- Comment #16 From Daniel Ahlberg (RETIRED) 2004-01-04 03:58:59 0000 -------
*** Bug 36810 has been marked as a duplicate of this bug. ***

------- Comment #17 From Daniel Ahlberg (RETIRED) 2004-01-04 04:00:03 0000 -------
*** Bug 37103 has been marked as a duplicate of this bug. ***

------- Comment #18 From jochen 2004-01-04 04:55:38 0000 -------
*** Bug 37176 has been marked as a duplicate of this bug. ***

------- Comment #19 From Bryan Østergaard (RETIRED) 2004-01-04 06:41:14 0000 -------
*** Bug 37190 has been marked as a duplicate of this bug. ***

------- Comment #20 From Brandon Hale (RETIRED) 2004-01-04 08:06:09 0000 -------
*** Bug 37195 has been marked as a duplicate of this bug. ***

------- Comment #21 From Seemant Kulleen (RETIRED) 2004-01-04 08:54:58 0000 -------
thanks for the patch, Tony, added to portage and reporting this issue upstream

------- Comment #22 From Seemant Kulleen (RETIRED) 2004-01-04 09:16:32 0000 -------
*** Bug 37202 has been marked as a duplicate of this bug. ***

------- Comment #23 From Seemant Kulleen (RETIRED) 2004-01-04 09:26:15 0000 -------
*** Bug 37203 has been marked as a duplicate of this bug. ***

------- Comment #24 From Seemant Kulleen (RETIRED) 2004-01-05 04:29:03 0000 -------
*** Bug 37287 has been marked as a duplicate of this bug. ***

------- Comment #25 From Haroon Rafique 2004-01-05 11:05:11 0000 -------
For the slow people among us (who need everything spelled out), the fix is to:
a) emerge tar, and then
b) emerge libpcap.
tar version app-arch/tar-1.13.92-r1 seems to address the problem mentioned here.

------- Comment #26 From Martin Schlemmer (RETIRED) 2004-01-06 10:53:46 0000 -------
I do not think this is the proper fix ..

------- Comment #27 From Martin Schlemmer (RETIRED) 2004-01-06 10:58:45 0000 -------
Created an attachment (id=23245) [details]
tar-1.13.92-fix-pathstrip.patch

The problem is the strip code also strip './', and not just '../'.  I do not
see why the code also strip './', as it refers to the current dir (or the
proper file if you append the path given to -C arg), and as we all know, RH
etc starts to ship tarballs that have pathnames start with './' for security
reasons - same reason why unzip add './' to all paths.

Anyhow, attached is patch that fixes the code not to stip './'.

Comments?

------- Comment #28 From Martin Schlemmer (RETIRED) 2004-01-06 11:05:36 0000 -------
On another matter - if you look at the following code:

--
          if (p[0] == '.')
            {
              if (p[1] == '.' && (ISSLASH (p[2]) || !p[2]))
                prefix_len = p + 2 - file_name;
              else if (ISSLASH (p[1]))
                prefix_len = p + 1 - file_name;
            }
--

from src/names.c ('safer_name_suffix' function), is it safe?  I see no
test to see if the lenght of the input filename is >= 3 chars, but still
the code checks p[0], p[1] and p[2] without checking if its valid (sure,
there is the '!p[2]' check, but that follows 'ISSLASH (p[2])').  My C
is a bit rustic, so I might see something where there is none ...

------- Comment #29 From Luca Barbato 2004-01-06 11:25:16 0000 -------
if the string is 0 terminated should not be a problem:

if p[1] == 0 it exits and won't check the other conditions.

Maybe I forgot something, from a quick look at the rest of the code it should not cause any harm.

------- Comment #30 From Martin Schlemmer (RETIRED) 2004-01-06 11:39:49 0000 -------
If p[2] is out of bounds, the 'ISSLASH (p[2])' will touch it.  The p==0 test
is only after, and this is not part of that while loop ...

------- Comment #31 From Martin Schlemmer (RETIRED) 2004-01-06 14:04:12 0000 -------
Ok, here is the proper fix:

http://savannah.gnu.org/cgi-bin/viewcvs/tar/tar/src/names.c.diff?r1=1.36&r2=1.37&diff_format=u

I missed a change it seems :)  I'll commit tonight if somebody do not get there
before me.


------- Comment #32 From Randy Tupas 2004-01-07 02:21:03 0000 -------
I suffered from the exact same problem. After upgrading app-arch/tar-1.13.92 to
1.13.92-r1, I was able to successfully upgrade libpcap and iptables.

------- Comment #33 From SpanKY 2004-01-07 22:17:51 0000 -------
*** Bug 37352 has been marked as a duplicate of this bug. ***

------- Comment #34 From Tony Vroon 2004-01-07 23:06:05 0000 -------
(From update of attachment 23099 [details])
This workaround is no longer necessary now that the true cause is found.
Obsoleting.

------- Comment #35 From SpanKY 2004-01-08 17:17:27 0000 -------
*** Bug 37610 has been marked as a duplicate of this bug. ***

------- Comment #36 From Andreas Proschofsky 2004-01-10 04:47:41 0000 -------
http://bugs.gentoo.org/show_bug.cgi?id=37728

Seems to be a duplicate of this one too, openoffice and openoffice-ximian both break with the current unstable app-arch/tar-1.13.92-r1

------- Comment #37 From Martin Schlemmer (RETIRED) 2004-01-11 06:02:17 0000 -------
Added -r2 with new patch - can we verify that it still works?


------- Comment #38 From Martin Schlemmer (RETIRED) 2004-01-11 08:12:14 0000 -------
Ok, seems this also fixes the openoffice issues with -r1 (bug #37610).

------- Comment #39 From SpanKY 2004-01-19 21:25:28 0000 -------
*** Bug 38739 has been marked as a duplicate of this bug. ***

First Last Prev Next    No search results available      Search page      Enter new bug