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

Cache extension umask fixes #1648

Merged
merged 8 commits into from
Dec 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
implement umask feature
  • Loading branch information
pbiering committed Dec 10, 2024

Verified

This commit was signed with the committer’s verified signature.
limbonaut Serhii Snitsaruk
commit 05d4e91856133f0ec6b1730410734ce5f79c4201
4 changes: 4 additions & 0 deletions radicale/storage/multifilesystem/base.py
Original file line number Diff line number Diff line change
@@ -145,10 +145,14 @@ def _makedirs_synced(self, filesystem_path: str) -> None:
if os.path.isdir(filesystem_path):
return
parent_filesystem_path = os.path.dirname(filesystem_path)
if sys.platform != "win32" and self._folder_umask:
oldmask = os.umask(self._config_umask)
# Prevent infinite loop
if filesystem_path != parent_filesystem_path:
# Create parent dirs recursively
self._makedirs_synced(parent_filesystem_path)
# Possible race!
os.makedirs(filesystem_path, exist_ok=True)
self._sync_directory(parent_filesystem_path)
if sys.platform != "win32" and self._folder_umask:
os.umask(oldmask)