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

Symlink creation not possible with TarArchive.WriteEntry(). #850

Open
nptr opened this issue Oct 16, 2023 · 1 comment
Open

Symlink creation not possible with TarArchive.WriteEntry(). #850

nptr opened this issue Oct 16, 2023 · 1 comment
Labels
bug tar Related to TAR file format

Comments

@nptr
Copy link

nptr commented Oct 16, 2023

Describe the bug

Creating a symlink with TarArchive.WriteEntry() fails with an ArgumentNullException which i think is unfounded.
Reason seems to be, that WriteEntry() expected file data where there should't be any. Creating a directory
(where there also isn't data) succeeds because there is a separate code path to handle this case. I would expect that LF_SYMLINK is also exempted.

Reproduction Code

https://dotnetfiddle.net/faKmUo

Steps to reproduce

  1. Open the link to the reproduction at dotnetfiddle.
  2. Run the code.
  3. Observe that SymlinkWithArchiveClass() failed.

Expected behavior

I would expect that SymlinkWithArchiveClass() succeeds, just like the lower level example SymlinkWithStreamClass(), that directly utilized TarOutputStream, does.

Operating System

Windows, macOS, Linux

Framework Version

.NET 7, .NET 6, .NET Framework 4.x

Tags

Tar

Additional context

No response

@nptr nptr added the bug label Oct 16, 2023
@github-actions github-actions bot added the tar Related to TAR file format label Oct 16, 2023
@piksel
Copy link
Member

piksel commented Oct 17, 2023

This is more of a feature request, I think. TarArchive does more of the heavy lifting, but at a cost of less flexibility. It shouldn't be much of a problem to skip reading the source if the size is set to 0, though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug tar Related to TAR file format
Projects
None yet
Development

No branches or pull requests

2 participants