Skip to content

SelfUpdater: Add --no-same-owner to tar invocation #2785

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

staticfloat
Copy link

This avoids having tar attempt to set the original owner and access times for files when extracting them as root. While not best practice on multi-user systems, single-user systems (such as Alpine, or a chroot user namespace) run all processes as root, and it is possible to get a tar on that system that will attempt to set e.g. UID 1000 from a tarball when that doesn't make any sense. As the Azure Pipelines agent doesn't really care about file ownership in this case, this flag should be completely safe to set, and should have no effect outside of the cases where it is needed.

This avoids having `tar` attempt to set the original owner and access times for files when extracting them as `root`.  While not best practice on multi-user systems, single-user systems (such as Alpine, or a chroot user namespace) run all processes as `root`, and it is possible to get a `tar` on that system that will attempt to set e.g. `UID 1000` from a tarball when that doesn't make any sense.  As the Azure Pipelines agent doesn't really care about file ownership in this case, this flag should be completely safe to set, and should have no effect outside of the cases where it is needed.
It appears that `busybox tar` does not support `--no-same-owner`, so use `-o` instead.
@staticfloat
Copy link
Author

It does indeed appear that busybox tar does not support the long form --no-same-owner, however it does support the -o flag, as does GNU tar and BSD tar. Is there any other tar implementation that we must check against?

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

Successfully merging this pull request may close these issues.

2 participants