From b51781874990f1acfaf573a46a8170bec1ee2e94 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Mon, 1 Aug 2016 18:59:47 +0200 Subject: [PATCH] Don't reject everybody from "/" with owner_only Fix 407. --- radicale/rights.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/radicale/rights.py b/radicale/rights.py index 1851f7a..c70ad46 100644 --- a/radicale/rights.py +++ b/radicale/rights.py @@ -80,6 +80,10 @@ permission:r user:.+ collection:%(login)s(/.*)? permission:rw +[r] +user:.+ +collection: +permission:r """} @@ -108,7 +112,7 @@ class Rights(BaseRights): if user and not storage.is_safe_path_component(user): # Prevent usernames like "user/calendar.ics" raise ValueError("Unsafe username") - collection_url = collection.path.rstrip("/") or "/" + collection_url = collection.path.rstrip("/") if collection_url in (".well-known/carddav", ".well-known/caldav"): return permission == "r" # Prevent "regex injection"