Tar long paths stored using LongName extension are not handled #102

Closed
opened 2026-01-29 22:06:37 +00:00 by claunia · 2 comments
Owner

Originally created by @pawelpabich on GitHub (Jul 6, 2016).

Tar archives with long paths that are stored using LongName extension are not handled which causes files to be treated as folders.

Sample error:

at System.IO.Win32FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent)
   at System.IO.Win32FileSystem.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.File.Open(String path, FileMode mode)
   at SharpCompress.Reader.IReaderExtensions.WriteEntryToFile(IReader reader, String destinationFileName, ExtractOptions options) in C:\Code\Github\sharpcompress\src\SharpCompress\Reader\IReader.Extensions.cs:line 84
   at SharpCompress.Reader.IReaderExtensions.WriteEntryToDirectory(IReader reader, String destinationDirectory, ExtractOptions options) in C:\Code\Github\sharpcompress\src\SharpCompress\Reader\IReader.Extensions.cs:line 64
   at SharpCompress.Test.TarReaderTests.Tar_LongNamesWithLongNameExtension() in C:\Code\Github\sharpcompress\test\SharpCompress.Test\Tar\TarReaderTests.cs:line 83
Result Message: Access to the path 'C:\Temp\TarOutput\wp-content\plugins\gravityformsextend\lib\Aws\Symfony\Component\ClassLoader\Tests\Fixtures\Apc\beta' is denied.```
Originally created by @pawelpabich on GitHub (Jul 6, 2016). Tar archives with long paths that are stored using LongName extension are not handled which causes files to be treated as folders. Sample error: `````` at System.IO.Win32FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent) at System.IO.Win32FileSystem.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.File.Open(String path, FileMode mode) at SharpCompress.Reader.IReaderExtensions.WriteEntryToFile(IReader reader, String destinationFileName, ExtractOptions options) in C:\Code\Github\sharpcompress\src\SharpCompress\Reader\IReader.Extensions.cs:line 84 at SharpCompress.Reader.IReaderExtensions.WriteEntryToDirectory(IReader reader, String destinationDirectory, ExtractOptions options) in C:\Code\Github\sharpcompress\src\SharpCompress\Reader\IReader.Extensions.cs:line 64 at SharpCompress.Test.TarReaderTests.Tar_LongNamesWithLongNameExtension() in C:\Code\Github\sharpcompress\test\SharpCompress.Test\Tar\TarReaderTests.cs:line 83 Result Message: Access to the path 'C:\Temp\TarOutput\wp-content\plugins\gravityformsextend\lib\Aws\Symfony\Component\ClassLoader\Tests\Fixtures\Apc\beta' is denied.``` ``````
Author
Owner

@adamhathcock commented on GitHub (Jul 6, 2016):

Thanks for this. Looks good.

I'm on vacation this week but I should be able to push out a new build next week with .NET Core RTM support

@adamhathcock commented on GitHub (Jul 6, 2016): Thanks for this. Looks good. I'm on vacation this week but I should be able to push out a new build next week with .NET Core RTM support
Author
Owner

@pawelpabich commented on GitHub (Jul 6, 2016):

Awesome!

@pawelpabich commented on GitHub (Jul 6, 2016): Awesome!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#102