From 4d3b6bcba42023eb50cdb5d0c18804b0c0a7752e Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Mon, 26 Sep 2022 11:32:55 -0700 Subject: [PATCH] Prepare radicale patch. --- mastus/radicale.nix | 4 +++- mastus/radicale1249.patch | 43 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 mastus/radicale1249.patch diff --git a/mastus/radicale.nix b/mastus/radicale.nix index 4c6d2d9..0befcf8 100644 --- a/mastus/radicale.nix +++ b/mastus/radicale.nix @@ -5,7 +5,9 @@ in { services.radicale = { enable = true; - package = pkgs.radicale3; + package = pkgs.radicale3.overrideDerivation (_: { + #patches = [ ./radicale1249.patch ]; + }); settings = { server = { hosts = "127.0.0.1:${toString radicalePort}"; diff --git a/mastus/radicale1249.patch b/mastus/radicale1249.patch new file mode 100644 index 0000000..372adfe --- /dev/null +++ b/mastus/radicale1249.patch @@ -0,0 +1,43 @@ +diff -urN radicale/app/propfind.py radicale/app/propfind.py +--- radicale/app/propfind.py 2022-04-20 17:57:41.000000000 +0200 ++++ radicale/app/propfind.py 2022-06-01 07:33:33.000000000 +0200 +@@ -350,8 +350,8 @@ + permission = "r" + status = "read" + else: +- permission = "" +- status = "NO" ++ permission = "r" ++ status = "read" + logger.debug( + "%s has %s access to %s", + repr(user) if user else "anonymous user", status, target) +@@ -362,8 +362,8 @@ + path: str, user: str) -> types.WSGIResponse: + """Manage PROPFIND request.""" + access = Access(self._rights, user, path) +- if not access.check("r"): +- return httputils.NOT_ALLOWED ++ #if not access.check("r"): ++ # return httputils.NOT_ALLOWED + try: + xml_content = self._read_xml_request_body(environ) + except RuntimeError as e: +@@ -380,8 +380,8 @@ + item = next(items_iter, None) + if not item: + return httputils.NOT_FOUND +- if not access.check("r", item): +- return httputils.NOT_ALLOWED ++ #if not access.check("r", item): ++ # return httputils.NOT_ALLOWED + # put item back + items_iter = itertools.chain([item], items_iter) + allowed_items = self._collect_allowed_items(items_iter, user) +@@ -390,5 +390,6 @@ + xml_answer = xml_propfind(base_prefix, path, xml_content, + allowed_items, user, self._encoding) + if xml_answer is None: ++ logger.warning("xml_propfind returned no answer") + return httputils.NOT_ALLOWED + return client.MULTI_STATUS, headers, self._xml_response(xml_answer)