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

fix: make sure transform cache is world-writable #21947

Closed
wants to merge 1 commit into from

Conversation

aslushnikov
Copy link
Collaborator

Fixes #21859

// Make sure we create cache folders with 777 permissions.
// Based on the stackoveflow answer: https://stackoverflow.com/a/34721366/314883
// See https://github.com/microsoft/playwright/issues/21859
const oldmask = process.umask(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why don't we do this once at the start of the test runner, and not only here? We create quite a few directories.

// Based on the stackoveflow answer: https://stackoverflow.com/a/34721366/314883
// See https://github.com/microsoft/playwright/issues/21859
const oldmask = process.umask(0);
fs.mkdirSync(path.dirname(cachePath), { recursive: true, mode: 0o777 });
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps a helper that we will use everywhere?

@mxschmitt
Copy link
Member

I'm worried that this makes it possible that user1 can modify the transpiled code of user2.

@aslushnikov
Copy link
Collaborator Author

aslushnikov commented Mar 26, 2023

I'm worried that this makes it possible that user1 can modify the transpiled code of user2.

oh year, we decided against this and will use different folders, prefixed with username. PR is coming soon!

@aslushnikov aslushnikov deleted the create-777-cache branch March 26, 2023 09:18
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.

[BUG] permission denied accessing '/tmp/playwright-transform-cache'
3 participants