Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file name length limit (in tar archive) #2201

Closed
mc-butler opened this issue May 17, 2010 · 23 comments
Closed

file name length limit (in tar archive) #2201

mc-butler opened this issue May 17, 2010 · 23 comments
Assignees
Labels
area: vfs Virtual File System support prio: medium Has the potential to affect progress ver: 4.6.2-pre1 Reproducible in version 4.6.2-pre1
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/2201
Reporter helix84 (helix84@….sk)
Mentions szotsaki@….com

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

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on May 17, 2010 at 9:11 UTC (comment 1)

  • Component changed from mc-core to mc-vfs

@mc-butler
Copy link
Author

Changed by jendap (jendap@….com) on Aug 9, 2010 at 22:17 UTC (comment 2)

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...

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Aug 10, 2010 at 4:25 UTC (comment 2.3)

  • 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.

@mc-butler
Copy link
Author

Changed by jendap (jendap@….com) on Aug 10, 2010 at 8:40 UTC (comment 4)

perfect! that should solve all the issues with tar.

thanks!

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Aug 14, 2010 at 15:11 UTC (comment 5)

  • Blocked by set to #1952

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Aug 28, 2011 at 14:46 UTC (comment 6)

  • Milestone changed from 4.7 to 4.8.0-pre2
  • Branch state set to no branch
  • Blocked by #1952 deleted

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Aug 28, 2011 at 14:47 UTC (comment 7)

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

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)
[90d019a]

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Aug 29, 2011 at 10:41 UTC (comment 8)

  • Votes set to slavazanko

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Aug 29, 2011 at 12:04 UTC (comment 9)

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

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Aug 29, 2011 at 12:16 UTC (comment 10)

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

Merged to master.
[90d019a]

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 8, 2011 at 10:56 UTC (comment 11)

  • Keywords stable-candidate deleted
  • Status changed from testing to closed
  • Votes changed from committed-master to committed-master committed-stable

Cherry-picked to 4.7.5-stable.
[1fa4200]

@mc-butler
Copy link
Author

Changed by jkeil (jkeil+mc@….de) on Jun 2, 2015 at 12:49 UTC (comment 12)

  • 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

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jun 18, 2015 at 18:25 UTC (comment 13)

  • Milestone changed from 4.8.0-pre2 to Future Releases

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Oct 12, 2016 at 4:08 UTC (comment 14)

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

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Oct 12, 2016 at 5:21 UTC (comment 15)

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?

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Oct 12, 2016 at 9:57 UTC (comment 15.16)

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.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 9, 2020 at 10:34 UTC (comment 17)

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

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 29, 2020 at 5:22 UTC (comment 18)

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

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Sep 29, 2020 at 7:55 UTC (comment 19)

  • Blocked by set to #1952

@mc-butler
Copy link
Author

Changed by szotsaki (szotsaki@….com) on Dec 28, 2020 at 15:33 UTC (comment 20)

  • Cc set to szotsaki@….com

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on May 20, 2023 at 16:51 UTC (comment 21)

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

Fixed in #1952.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on May 20, 2023 at 16:52 UTC (comment 22)

  • Resolution set to fixed
  • Status changed from reopened to closed

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Feb 21, 2025 at 7:37 UTC (comment 23)

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

@mc-butler mc-butler marked this as a duplicate of #2306 Feb 28, 2025
@mc-butler mc-butler marked this as a duplicate of #3702 Feb 28, 2025
@mc-butler mc-butler marked this as a duplicate of #4116 Feb 28, 2025
@mc-butler mc-butler marked this as a duplicate of #4118 Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: vfs Virtual File System support prio: medium Has the potential to affect progress ver: 4.6.2-pre1 Reproducible in version 4.6.2-pre1
Development

No branches or pull requests

2 participants