Browse Source

Don't change permissions of lock file

The file is part of the storage folder. Setting permissions of the storage folder is not handled by Radicale.
Unrud 8 năm trước cách đây
mục cha
commit
6f5e30670f
1 tập tin đã thay đổi với 0 bổ sung8 xóa
  1. 0 8
      radicale/storage.py

+ 0 - 8
radicale/storage.py

@@ -32,7 +32,6 @@ import os
 import pickle
 import posixpath
 import shlex
-import stat
 import subprocess
 import sys
 import threading
@@ -1296,13 +1295,6 @@ class Collection(BaseCollection):
                 cls._makedirs_synced(folder)
                 lock_path = os.path.join(folder, ".Radicale.lock")
                 cls._lock_file = open(lock_path, "w+")
-                # Set access rights to a necessary minimum to prevent locking
-                # by arbitrary users
-                try:
-                    os.chmod(lock_path, stat.S_IWUSR | stat.S_IRUSR)
-                except OSError as e:
-                    cls.logger.info("Failed to set permissions on lock file:"
-                                    " %s", e, exc_info=True)
             if file_locking and not cls._lock_file_locked:
                 if os.name == "nt":
                     handle = msvcrt.get_osfhandle(cls._lock_file.fileno())