diff --git a/server/src/scimodom/services/file.py b/server/src/scimodom/services/file.py index 50109c31..417c2979 100644 --- a/server/src/scimodom/services/file.py +++ b/server/src/scimodom/services/file.py @@ -28,7 +28,11 @@ def write_opener(path, flags): - return os.open(path, flags, DEFAULT_MODE) + old_umask = umask(0o07) + try: + return os.open(path, flags, DEFAULT_MODE) + finally: + umask(old_umask) class FileTooLarge(Exception):