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

Set 0o777 permissions on downloaded sources #40864

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/env/lib/download-sources.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ module.exports = function downloadSources( config, spinner ) {

/**
* Downloads the given source if necessary. The specific action taken depends
* on the source type. The source is downloaded to source.path.
* on the source type. The source is downloaded to source.path and rwx permissions
* are applied.
*
* @param {WPSource} source The source to download.
* @param {Object} options
Expand All @@ -85,6 +86,8 @@ async function downloadSource( source, options ) {
} else if ( source.type === 'zip' ) {
await downloadZipSource( source, options );
}

await fs.promises.chmod( source.path, 0o777 );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems it would only be applying to the path and it wouldn't be recursively applying the to all files in the directory tree, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The chmodr package should be used instead, perhaps. However, I can't vouch for it.

Might be better to use the approach in #22515 (comment).

}

/**
Expand Down