Skip to content

Fix permissions issue with DirectoryStore #493

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

Merged

Conversation

jrbourbeau
Copy link
Member

@jrbourbeau jrbourbeau commented Oct 25, 2019

This PR builds on #445 and uses the built-in open function for creating temporary files in DirectoryStore instead of tempfile.NamedTemporaryFile. As outlined in #325 (comment), the reasons for doing this are to avoid the limited permissions associated with tempfile.NamedTemporaryFile while also not needing to query current umask and then use chmod. It's also worth noting that here we're using uuid to generate a unique filepath for temporary files that are created.

Closes #325

TODO:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/tutorial.rst
  • Changes documented in docs/release.rst
  • Docs build locally (e.g., run tox -e docs)
  • AppVeyor and Travis CI passes
  • Test coverage is 100% (Coveralls passes)

@jrbourbeau
Copy link
Member Author

cc @jakirkham @alimanfoo for review when you have a moment

cc @eddienko @d-v-b if possible, could you confirm these changes fix the permissions issues you've encountered recently

@d-v-b
Copy link
Contributor

d-v-b commented Oct 25, 2019

@jrbourbeau some quick tests on my end (creating a container and inspecting permissions) suggests that your changes do indeed fix the problem! Thanks for putting this together.

@jrbourbeau
Copy link
Member Author

Awesome, thank you for testing!

@eddienko
Copy link

Looks good to me as well. I am not sure the test is needed now.

@jakirkham jakirkham merged commit e6667aa into zarr-developers:master Oct 28, 2019
@jakirkham
Copy link
Member

Thanks @jrbourbeau! Also thanks everyone for testing. 😄

@alimanfoo
Copy link
Member

Adding my thanks @jrbourbeau and @eddienko, this one has been a real pain point, great to see this go in.

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.

Set file permissions accoding to umask
6 participants