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

.ipynb_checkpoints doesn't respect umask #2858

Closed
dclong opened this issue Sep 23, 2017 · 5 comments · Fixed by #3002
Closed

.ipynb_checkpoints doesn't respect umask #2858

dclong opened this issue Sep 23, 2017 · 5 comments · Fixed by #3002

Comments

@dclong
Copy link

dclong commented Sep 23, 2017

I used the following configuration in /etc/jupyter/jupyter_notebook_config.py. Newly created notebooks have the right permission (664), however the .ipynb_checkpoints folders do not.

import os
os.umask(0o002)
@dclong dclong changed the title .ipy_checkpoints doesn't respect umask .ipynb_checkpoints doesn't respect umask Sep 24, 2017
@dclong
Copy link
Author

dclong commented Sep 25, 2017

And setfacl doesn't make .ipynb_checkpoints directories have the right permission, either.

@dclong
Copy link
Author

dclong commented Oct 11, 2017

I quickly checked the code and found the following piece of code which might be the root cause.

./services/contents/filecheckpoints.py:            ensure_dir_exists(cp_dir)

The function ensure_dir_exists is in ipython_genutils/path.py. It has a parameter mode with default value 0o755. Passing the right mode to ensure_dir_exists might resolve the issue.

@takluyver
Copy link
Member

I suspect that someone - possibly me - saw that the default for os.makedirs() was 0o777 and assumed that that it would actually create a world-writable directory by default. So I implemented a default equivalent to umask 0o022. I think we can probably let the default be determined by the umask.

@dclong
Copy link
Author

dclong commented Oct 11, 2017

@takluyver
That would resolve the issue.

@takluyver
Copy link
Member

See #2924

takluyver added a commit to takluyver/notebook that referenced this issue Oct 31, 2017
Closes jupytergh-2858

Requires jupyter_core 4.4.0, which I just released.
@takluyver takluyver added this to the 5.3 milestone Jan 15, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants