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

jest-config: UID needs to be part of top-level folder #3387

Merged
merged 2 commits into from
Apr 27, 2017

Conversation

jeanlauliac
Copy link
Contributor

Summary

If jest runs first as root, then as non-root, then the top-level /tmp/jest folder will be owned by root and will not allow write permissions for the non-root instance. So we need to use completely different top-level folders for each user. We assume that we always have write permissions on the top-level /tmp or whichever os.tmpdir() returns.

Test plan

Automated testing.

@cpojer
Copy link
Member

cpojer commented Apr 27, 2017

I thought about doing it this way before but I was worried that getuid calls this.<something> on process. It seems like it doesn't, so we don't need to bind?

@jeanlauliac
Copy link
Contributor Author

I tried it out in node REPL, it worked fine, but I'll add the bind for correctness.

@jeanlauliac
Copy link
Contributor Author

Because it could change in future version of Node with no warning, in fact.

@cpojer cpojer merged commit c011c24 into master Apr 27, 2017
@cpojer
Copy link
Member

cpojer commented Apr 27, 2017

👍

@cpojer cpojer deleted the fixgetuid-in-jest-config branch June 1, 2017 11:55
tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
* jest-config: UID needs to be part of top-level folder

* pass the 'process' instance to getuid()
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants