Bug 141065 - mc handles wrong symlinks in tar archives
mc handles wrong symlinks in tar archives
Product: Fedora
Classification: Fedora
Component: mc (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Jindrich Novy
Depends On:
  Show dependency treegraph
Reported: 2004-11-28 21:08 EST by Doncho N. Gunchev
Modified: 2013-07-02 19:03 EDT (History)
3 users (show)

See Also:
Fixed In Version: 4.6.1-0.11
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-12-01 07:10:00 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Fix for bad extraction/viewing of symlinks from tarfs (429 bytes, patch)
2004-11-29 10:55 EST, Jindrich Novy
no flags Details | Diff

  None (edit)
Description Doncho N. Gunchev 2004-11-28 21:08:56 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5)
Gecko/20041111 Firefox/1.0

Description of problem:
When you point a symlink in a tar.gz / tar.bz2 archive mc shows only
the first few letters from it (with most symlinks). Pressing F3 (view)
works fine, but when you copy (F5) a file and a symlink to it the
symlink is pointing to shorter name - strips characters again.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. make a dir with some files having long (20-30) character long names
2. make some symlinks to these files
3. archive these in .tar.bz2 file
4. browse the archive and inspect the links with mc

Actual Results:  Most symlinks get showed and extracted wrong (if not all)

Additional info:

Extracting files from archive with mc this way breaks almost all
symlinks. I fill this bug against not officially released version
because I tested it with the latest available one and the problem is
still there.
Comment 1 Jindrich Novy 2004-11-29 03:46:15 EST
Hello Doncho,

I was able to reproduce the bug. I'm trying to fix it now.

Thanks for the bugreport.
Comment 2 Leonard den Ottolander 2004-11-29 06:49:52 EST
Hi Doncho, you might want to report this issue upstream
(mc-devel@gnome.org). It might have been caused by the latest changes
to tar.c or vfs in general.
Comment 3 Jindrich Novy 2004-11-29 07:13:31 EST
Hi Leonard, I don't think this bug is very recent, I was able to
reproduce it also with mc CVS checkout from 6th Sep.
Comment 4 Jindrich Novy 2004-11-29 10:53:57 EST
Doncho, so I finally found a solution for the bug. That was *fun* to
browse through all the vfs mc code to figure out that the broken
extraction/viewing of symlinks from tarfs is actually caused by sloppy
commit in upstream, 2th Sep. 

There is incorrectly calculated length of buf instead of link name in
the inode. The random size you may see when extracting symlinks from
tarfs is caused by the fact that buf is mostly uninitialized.
Comment 5 Jindrich Novy 2004-11-29 10:55:34 EST
Created attachment 107544 [details]
Fix for bad extraction/viewing of symlinks from tarfs
Comment 6 Jindrich Novy 2004-11-30 03:22:45 EST
Switching severity back to high since this may lead to data
Comment 7 Leonard den Ottolander 2004-11-30 10:52:19 EST
Jindrich, please don't use UPSTREAM in vain :) . This resolution is
ment for situations that will not be looked at downstream and might
take a long time to get solved upstream.

As this situation is now handled and the fix will be in a next release
you better wait with closing this bug until the fix has trickled
downstream (the next release), and then close it ERRATA or RAWHIDE or
Comment 8 Doncho N. Gunchev 2004-11-30 18:40:49 EST
    Hello all. Using mc-4.6.1-0.10 as base I recompiled mc with this
patch and it works for me (bouth browsing and extraction). Many thanks
for the amazingly quick response and fix!

Note You need to log in before you can comment on or make changes to this bug.