Bug 141065 - mc handles wrong symlinks in tar archives
Summary: mc handles wrong symlinks in tar archives
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: mc
Version: 3
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jindrich Novy
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-11-29 02:08 UTC by Doncho Gunchev
Modified: 2013-07-02 23:03 UTC (History)
3 users (show)

Fixed In Version: 4.6.1-0.11
Clone Of:
Environment:
Last Closed: 2004-12-01 12:10:00 UTC
Type: ---
Embargoed:


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

Description Doncho Gunchev 2004-11-29 02:08:56 UTC
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):
mc-4.6.1-0.10

How reproducible:
Always

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 08:46:15 UTC
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 11:49:52 UTC
Hi Doncho, you might want to report this issue upstream
(mc-devel). It might have been caused by the latest changes
to tar.c or vfs in general.


Comment 3 Jindrich Novy 2004-11-29 12:13:31 UTC
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 15:53:57 UTC
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 15:55:34 UTC
Created attachment 107544 [details]
Fix for bad extraction/viewing of symlinks from tarfs

Comment 6 Jindrich Novy 2004-11-30 08:22:45 UTC
Switching severity back to high since this may lead to data
loss/corruption.

Comment 7 Leonard den Ottolander 2004-11-30 15:52:19 UTC
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
something.


Comment 8 Doncho Gunchev 2004-11-30 23:40:49 UTC
    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.