alexcrichton / tar-rs

Tar file reading/writing for Rust
https://docs.rs/tar
Apache License 2.0
630 stars 190 forks source link

[Symlink] Add symlink ownership management. #371

Closed stswidwinski closed 3 months ago

stswidwinski commented 3 months ago

Context

The tar-rs crate ignores ownership of symlinks, even if .set_preserve_ownerships(true); is invoked. While permissions of symlinks are mostly meaningless on most systems, ownership does dictate the access to symlinks. For instance:

$ mkdir foo 
$ sudo ln -s foo link
$  rm link
rm: link: Permission denied

This PR

In this PR I add the right invocation for symlink ownership change and expand the tests to include directories and symlinks.

stswidwinski commented 3 months ago

Hi @alexcrichton, please let me know how I can help release this PR. Happy to provide more information or make changes as needed