From 19def4d5613a9645d57aa62351e991cc2f28bf0c Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Tue, 12 Aug 2025 16:11:24 +0200 Subject: [PATCH] add for write requests "path" where missing and "request" --- radicale/app/delete.py | 2 +- radicale/app/mkcalendar.py | 2 +- radicale/app/mkcol.py | 2 +- radicale/app/move.py | 2 +- radicale/app/proppatch.py | 2 +- radicale/app/put.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/radicale/app/delete.py b/radicale/app/delete.py index 13ab0d31..a8c7f0a6 100644 --- a/radicale/app/delete.py +++ b/radicale/app/delete.py @@ -60,7 +60,7 @@ class ApplicationPartDelete(ApplicationBase): access = Access(self._rights, user, path) if not access.check("w"): return httputils.NOT_ALLOWED - with self._storage.acquire_lock("w", user): + with self._storage.acquire_lock("w", user, path=path, request="DELETE"): item = next(iter(self._storage.discover(path)), None) if not item: return httputils.NOT_FOUND diff --git a/radicale/app/mkcalendar.py b/radicale/app/mkcalendar.py index b9f2063a..632d3c38 100644 --- a/radicale/app/mkcalendar.py +++ b/radicale/app/mkcalendar.py @@ -57,7 +57,7 @@ class ApplicationPartMkcalendar(ApplicationBase): return httputils.BAD_REQUEST # TODO: use this? # timezone = props.get("C:calendar-timezone") - with self._storage.acquire_lock("w", user): + with self._storage.acquire_lock("w", user, path=path, request="MKCALENDAR"): item = next(iter(self._storage.discover(path)), None) if item: return self._webdav_error_response( diff --git a/radicale/app/mkcol.py b/radicale/app/mkcol.py index 953508ad..169cb62c 100644 --- a/radicale/app/mkcol.py +++ b/radicale/app/mkcol.py @@ -62,7 +62,7 @@ class ApplicationPartMkcol(ApplicationBase): if not props.get("tag") and "W" not in permissions: logger.warning("MKCOL request %r (type:%s): %s", path, collection_type, "rejected because of missing rights 'W'") return httputils.NOT_ALLOWED - with self._storage.acquire_lock("w", user): + with self._storage.acquire_lock("w", user, path=path, request="MKCOL"): item = next(iter(self._storage.discover(path)), None) if item: return httputils.METHOD_NOT_ALLOWED diff --git a/radicale/app/move.py b/radicale/app/move.py index f555e871..77e56f3e 100644 --- a/radicale/app/move.py +++ b/radicale/app/move.py @@ -73,7 +73,7 @@ class ApplicationPartMove(ApplicationBase): if not to_access.check("w"): return httputils.NOT_ALLOWED - with self._storage.acquire_lock("w", user): + with self._storage.acquire_lock("w", user, path=path, request="MOVE", to_path=to_path): item = next(iter(self._storage.discover(path)), None) if not item: return httputils.NOT_FOUND diff --git a/radicale/app/proppatch.py b/radicale/app/proppatch.py index 76b4a1a1..d2c32811 100644 --- a/radicale/app/proppatch.py +++ b/radicale/app/proppatch.py @@ -87,7 +87,7 @@ class ApplicationPartProppatch(ApplicationBase): except socket.timeout: logger.debug("Client timed out", exc_info=True) return httputils.REQUEST_TIMEOUT - with self._storage.acquire_lock("w", user): + with self._storage.acquire_lock("w", user, path=path, request="PROPPATCH"): item = next(iter(self._storage.discover(path)), None) if not item: return httputils.NOT_FOUND diff --git a/radicale/app/put.py b/radicale/app/put.py index 9a08e561..343f3324 100644 --- a/radicale/app/put.py +++ b/radicale/app/put.py @@ -174,7 +174,7 @@ class ApplicationPartPut(ApplicationBase): bool(rights.intersect(access.permissions, "Ww")), bool(rights.intersect(access.parent_permissions, "w"))) - with self._storage.acquire_lock("w", user, path=path): + with self._storage.acquire_lock("w", user, path=path, request="PUT"): item = next(iter(self._storage.discover(path)), None) parent_item = next(iter( self._storage.discover(access.parent_path)), None)