Ticket #2201 (closed defect: fixed)

Opened 15 years ago

Last modified 19 months ago

file name length limit (in tar archive)

Reported by: helix84 Owned by: andrew_b
Priority: major Milestone: 4.8.30
Component: mc-vfs Version: 4.6.2-pre1
Keywords: Cc: szotsaki@…
Blocked By: #1952 Blocking:
Branch state: merged Votes for changeset: committed-master

Description

Steps to reproduce:
Navigate deeply into an archive containing long directory/file names.
Alternately, extract the contents of such archive.
The filenames will be cut off at some point.

Example:
1) wget http://sourceforge.net/projects/dspace/files/DSpace%20Stable/1.6.0/dspace-1.6.0-src-release.tar.bz2/download
2) navigate into the archive in mc
3) try to copy (extract) the contents of the archive
4) you will get overwrite prompt: "Target file "/home/dspac~DConfigura" already exists!"

Problem:
The filenames are cut off at about 100 characters (length of the whole path inside the archive).

Proposed solution:
a) remove the limit
b) warn about this limit when entering the archive if the limit is reached for the archive being opened

Change History

comment:1 Changed 15 years ago by andrew_b

  • Component changed from mc-core to mc-vfs

comment:2 follow-up: ↓ 3 Changed 14 years ago by jendap

There's no limit filename length. The problem is in "tar.c" in vfs implementation.

The file you appended has "TAR_USTAR" header that but it seems store long names as "TAR_GNU". Gnu tar (the standard command line utility) handles these correctly. Yet I'm not sure if this file is valid or if it works due to gnu tar workarounds.

The tar format is ancient - there are many versions and options of header encoding. Does anybody know it? There's another issue with long names - #2306. I've looked at gnu tar source code - it looks much more complex than current mc implementation. How about to port some code from gnu tar to mc? Both are GPL licensed :-)

The tar.c in mc needs some serious love...

Last edited 10 years ago by andrew_b (previous) (diff)

comment:3 in reply to: ↑ 2 Changed 14 years ago by andrew_b

  • Owner set to andrew_b
  • Status changed from new to accepted

Replying to jendap:

The tar.c in mc needs some serious love...

No love. tar vfs will be reimplemented as extfs plugin based on gnu tar.

comment:4 Changed 14 years ago by jendap

perfect! that should solve all the issues with tar.

thanks!

comment:5 Changed 14 years ago by andrew_b

  • Blocked By 1952 added

comment:6 Changed 13 years ago by andrew_b

  • Branch state set to no branch
  • Blocked By 1952 removed
  • Milestone changed from 4.7 to 4.8.0-pre2

comment:7 Changed 13 years ago by andrew_b

  • Keywords stable-candidate added
  • Branch state changed from no branch to on review

In general, the TarVFS is scheduled for total reimplementation. But this fix is useful for stable releases.

Thanks AVFS (avf.sf.net) for the code of this fix.

Branch: 2201_tar_filename_length (parent: master)
changeset:90d019a4998794eab2772cb1d2382f65af8e9858

comment:8 Changed 13 years ago by slavazanko

  • Votes for changeset set to slavazanko

comment:9 Changed 13 years ago by angel_il

  • Votes for changeset changed from slavazanko to slavazanko angel_il
  • Branch state changed from on review to approved

comment:10 Changed 13 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from slavazanko angel_il to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

comment:11 Changed 13 years ago by andrew_b

  • Keywords stable-candidate removed
  • Status changed from testing to closed
  • Votes for changeset changed from committed-master to committed-master committed-stable

comment:12 Changed 10 years ago by jkeil

  • Status changed from closed to reopened
  • Resolution fixed deleted

I'm reopening this issue because [1] is still unresolved. I've spent some time trying to track down the error in the code and as far as I can tell the information is just missing. NAMSIZ is set to 100 and everything afterwards is cut off. From what I understand, the filename is not even completely read into record.charptr.

[1] https://bugzilla.suse.com/show_bug.cgi?id=836558

comment:13 Changed 10 years ago by andrew_b

  • Milestone changed from 4.8.0-pre2 to Future Releases

comment:14 Changed 8 years ago by andrew_b

Ticket #3702 has been marked as a duplicate of this ticket.

comment:15 follow-up: ↓ 16 Changed 8 years ago by zaytsev

There is tar extsfs script in the linked Suse bug, by the way, I can ask them if they have a newer version... is the current thinking still to replace it with an extfs plugin?

comment:16 in reply to: ↑ 15 Changed 8 years ago by andrew_b

Replying to zaytsev:

There is tar extsfs script in the linked Suse bug, by the way, I can ask them if they have a newer version... is the current thinking still to replace it with an extfs plugin?

Probably, #1952 is the better place to discuss of move TAR VFS from internal C implementation to EXTFS script.

comment:17 Changed 4 years ago by andrew_b

Ticket #4116 has been marked as a duplicate of this ticket.

comment:18 Changed 4 years ago by andrew_b

Ticket #4118 has been marked as a duplicate of this ticket.

comment:19 Changed 4 years ago by zaytsev

  • Blocked By 1952 added

comment:20 Changed 4 years ago by szotsaki

  • Cc szotsaki@… added

comment:21 Changed 19 months ago by andrew_b

  • Votes for changeset changed from committed-master committed-stable to committed-master
  • Milestone changed from Future Releases to 4.8.30

Fixed in #1952.

comment:22 Changed 19 months ago by andrew_b

  • Status changed from reopened to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.