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

Filenames longer then 99 chars seem not to be implemented properly ... #4

Closed
DeepDiver1975 opened this issue Sep 28, 2015 · 12 comments
Closed

Comments

@DeepDiver1975
Copy link
Member

No description provided.

@VicDeo
Copy link
Member

VicDeo commented Oct 6, 2015

@DeepDiver1975 can't confirm:

jah-mobile:~/Downloads>tar -tvf fer.tar 
drwxrwxrwx 0/0               0 2015-10-06 22:18 fer/
drwxrwxrwx 0/0               0 2015-10-06 22:18 fer/ret/
-rwxrwxrwx 0/0             962 2015-10-06 22:18 fer/ret/0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.txt

jah-mobile:~/Downloads> tar -tvf test2.tar 
drwxrwxrwx 0/0               0 2015-10-06 22:27 test2/
drwxrwxrwx 0/0               0 2015-10-06 22:27 test2/ret/
-rwxrwxrwx 0/0           10428 2015-10-06 22:27 test2/ret/0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.jpg
-rwxrwxrwx 0/0             962 2015-10-06 22:27 test2/ret/0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.txt

104 characters long, no errors

@DeepDiver1975
Copy link
Member Author

uncomment this one and see it failing - https://github.com/owncloud/TarStreamer/blob/master/tests/Streamer.php#L70

@VicDeo
Copy link
Member

VicDeo commented Oct 6, 2015

@DeepDiver1975 wrong repo ;)

deo@jah-mobile:~/Downloads/test2> ls -l ret
total 16
-rwxr-xr-x 1 deo users 10428 Oct  6 22:27 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.jpg
-rwxr-xr-x 1 deo users   962 Oct  6 22:27 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.txt
deo@jah-mobile:~/Downloads/test2> tar -cf t.tar ret/
deo@jah-mobile:~/Downloads/test2> php t.php 
array(3) {
  [0] =>
  array(9) {
    'checksum' =>     int(5017)
    'filename' =>    string(4) "ret/"
    'mode' =>    int(493)
    'uid' =>    int(1000)
    'gid' =>    int(100)
    'size' =>    int(0)
    'mtime' =>    int(1444159666)
    'typeflag' =>    string(1) "5"
    'link' =>    string(0) ""
  }
  [1] =>
  array(9) {
    'checksum' =>     int(10050)
    'filename' =>    string(100) "ret/012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345"
    'mode' =>    int(493)
    'uid' =>    int(1000)
    'gid' =>    int(100)
    'size' =>    int(962)
    'mtime' =>    int(1444159666)
    'typeflag' =>    string(1) "0"
    'link' =>    string(0) ""
  }
  [2] =>
  array(9) {
    'checksum' =>    int(10059)
    'filename' =>    string(100) "ret/012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345"
    'mode' =>    int(493)
    'uid' =>    int(1000)
    'gid' =>    int(100)
    'size' =>    int(10428)
    'mtime' =>    int(1444159666)
    'typeflag' =>    string(1) "0"
    'link' =>    string(0) ""
  }
}

@VicDeo
Copy link
Member

VicDeo commented Oct 6, 2015

t.php:

$arc = new Archive_Tar('t.tar');
$list = $arc->listContent();
var_dump($list);

@DeepDiver1975
Copy link
Member Author

Okay - please open a PR which tests the proper behavior - THX

@VicDeo
Copy link
Member

VicDeo commented Oct 7, 2015

argh
@DeepDiver1975 it doesn't support long names via POSIX.1-2001 extended headers...
https://github.com/owncloud/3rdparty/blob/master/pear/archive_tar/Archive/Tar.php#L1909

GNU tar was based on an early draft of the POSIX 1003.1 ustar standard. GNU extensions to tar, such as the support for file names longer than 100 characters, use portions of the tar header record which were specified in that POSIX draft as unused. Subsequent changes in POSIX have allocated the same parts of the header record for other purposes. As a result, GNU tar format is incompatible with the current POSIX specification, and with tar programs that follow it.

@VicDeo
Copy link
Member

VicDeo commented Oct 7, 2015

the question is whether tar for macs is capable to read long filenames in a POSIX way, via 'L'-headers

@ghost
Copy link

ghost commented Oct 7, 2015

I just tried the file name "Team Week Presentation July 2015-12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970.odp.zip" and "Team Week Presentation July 2015-12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970.odp", downloaded as file, archive (with 2 files), archive (with 1 file), had no problem with any of them. Mac with OS X El Capitan, Safari browser

@VicDeo
Copy link
Member

VicDeo commented Oct 7, 2015

@cmonteroluque yes. There are two ways of handling long names. We use header of 'x' type for that.
and the library used for testing can read only 'L' headers

@DeepDiver1975
Copy link
Member Author

We need to find out of 'x' type is supported on MacOS - results are to be expected here owncloud/core#19318 (comment)

As a result we either add 'x' support to Archive_Tar or 'L' headers to the tarstreamer

@VicDeo
Copy link
Member

VicDeo commented Oct 8, 2015

@DeepDiver1975

'L' headers to the tarstreamer

It is done yesterday. Tests with Archive_Tar are passing locally. Not pushed yet, I'm cleaning the code.

@VicDeo
Copy link
Member

VicDeo commented Oct 8, 2015

L-headers support #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants