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.
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:This PR
In this PR I add the right invocation for symlink ownership change and expand the tests to include directories and symlinks.