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

Use Bitwise AND to set permissions in utils/unpacking.py #8179

Closed
deveshks opened this issue May 1, 2020 · 3 comments · Fixed by #8375
Closed

Use Bitwise AND to set permissions in utils/unpacking.py #8179

deveshks opened this issue May 1, 2020 · 3 comments · Fixed by #8375

Comments

@deveshks
Copy link
Contributor

deveshks commented May 1, 2020

Originally triaged in #8164

We are using 0o777 - current_umask() to set file permissions, but we should be using a Bitwise AND (0o777 & ~current_umask())

os.chmod(fn, (0o777 - current_umask() | 0o111))

os.chmod(path, (0o777 - current_umask() | 0o111))

We would also want to move the two os.chmod calls into a helper function.

@deveshks
Copy link
Contributor Author

deveshks commented Jun 1, 2020

Hi @sbidoul , @pradyunsg

Do we still want to make the above mentioned changes? If yes, I can go ahead and make a PR for the same.

@sbidoul
Copy link
Member

sbidoul commented Jun 2, 2020

@deveshks yes, please go ahead.

@deveshks
Copy link
Contributor Author

deveshks commented Jun 2, 2020

@deveshks yes, please go ahead.

Thanks, I have filed the PR. Please have a look

@pradyunsg pradyunsg removed the S: needs triage Issues/PRs that need to be triaged label Feb 12, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants