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

Installer does not untar files longer than 32 chars #6133

Closed
stAn47 opened this issue Feb 20, 2015 · 6 comments
Closed

Installer does not untar files longer than 32 chars #6133

stAn47 opened this issue Feb 20, 2015 · 6 comments

Comments

@stAn47
Copy link

stAn47 commented Feb 20, 2015

Steps to reproduce the issue

Create an installer package which has file names longer than 32 characters, tar it and gzip it into a normal joomla installation package (com_test.tar.gz)

the installer fails to recognize longer files than 32 characters as defined in:

\libraries\joomla\archive\tar.php

and truncates them and they may cause fatal errors if required by php

the long name seems to be stored only within this format:
././@LongLink000 147 0003740 Ladmin/plugins/vmpayment/amazon/library/OffAmazonPaymentsService/OffAmazonPaymentsService.config.inc.phpadmin/plugins/vmpayment/amazon/library/OffAmazonPaymentsService/OffAmazonPaymentsService.config.inc.0000666000000000000000000000113212471644025031355 0ustar

Expected result

full file names

Actual result

truncated filenames

System information (as much as possible)

PHP Version 5.5.21-1+deb.sury.org~precise+2
on ubuntu 12.04

production server

Additional comments

note - maybe joomla should not try to use php own code to unzip/untar these files, but rather check if functions like PharData exists:
http://stackoverflow.com/questions/9416508/php-untar-gz-without-exec

regards, stan

@vdespa
Copy link

vdespa commented Mar 14, 2015

For replication and testing purposes it would be very nice if you could attach the package which is causing you troubles.

Also please clarify if you are getting any errors.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6133.

@brianteeman
Copy link
Contributor

the query is about files of longer than 32 characters INSIDE the tar

@ghost
Copy link

ghost commented Mar 16, 2015

@brianteeman Thanks for info. I've deleted my misleading comment.

@OctavianC
Copy link
Contributor

Actually, this issue isn't about filenames containing more than 32 characters. According to Wikipedia, the original TAR format allows file paths (not file names!) up to 100 characters. If you look at the issue reporter's example, you'll notice that admin/plugins/vmpayment/amazon/library/OffAmazonPaymentsService/OffAmazonPaymentsService.config.inc.php is 103 characters, thus exceeding the limit.

I haven't been able to find much info on the web regarding this, but it seems that the PAX implementation of tar uses an 'L' typeflag (76) that puts the filename in the contents block and the original contents of the file in the next block:
http://stackoverflow.com/questions/2078778/what-exactly-is-the-gnu-tar-longlink-trick
http://manpages.ubuntu.com/manpages/intrepid/man5/star.5.html (see LF_LONGNAME)
I've been able to reproduce this by using 7-Zip. Attached you will find the test archive

I proposed a commit - but I referenced the wrong issue - apparently I was looking at the Joomla! tracker on one tab and copied the wrong ID :(
Will update soon.

@OctavianC
Copy link
Contributor

Test archive here, I can't attach .tar.gz in the comments: https://onedrive.live.com/redir?resid=C010BBBF057E905F!21825&authkey=!ABY3mmJ9Kf4MOqc&ithint=file%2cgz

OctavianC added a commit to OctavianC/joomla-cms that referenced this issue Mar 23, 2015
@stAn47
Copy link
Author

stAn47 commented Mar 23, 2015

hello friends, yes, i might have been wrong here and i apologize for not providing the tar gz which was originatelly within this post, but i was asked to remove it. my first tests seems like it was caused by the 32 char limit.

the 100 char limit seems to be causing it, which is now pointed at
http://issues.joomla.org/tracker/joomla-cms/6554

@brianteeman I would really appreciate if you add a short note to your replies with a link (to joomla docs) on how can a beginner dev start with github joomla checkout of specific fixes.I.e. how to checkout a specific fix via a command line.

thank you y'all, best regards, stan

@stAn47 stAn47 closed this as completed Mar 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants