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

Added --no-same-owner flag when extracting the NodeJs archive #44

Open
wants to merge 1 commit into
base: 1.0
Choose a base branch
from

Conversation

driq
Copy link

@driq driq commented May 12, 2021

Added --no-same-owner flag when extracting the NodeJs archive, so that it can behaves as expected when composer runs as root.

Rationale

When tar extracts an archive as root, it attempts to set the owner UID/GID of the extracted files to the UID/GID, which is for the NodeJS archives is 500.

For the NodeJS iInstaller, this behaviour is not desirable, as it results in the extracted files being owned by a different user than the user that runs composer commands. It can even result in the failure to extract.

Although normally composer shouldn't be run as root, this is not necessarily true for applications that run in containers, such as Docker containers.

Solution

Add the --no-same-owner flag to the tar command, so that it will behave identical regardless of whether composer runs as root or as a normal user.

For reference, see https://linux.die.net/man/1/tar

…t it can behaves as expected when composer runs as root
@driq
Copy link
Author

driq commented Feb 1, 2022

@moufmouf is there a reason not to merge this?

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.

1 participant