From aac472960f18a931308aa793d35d939880cec318 Mon Sep 17 00:00:00 2001 From: Unrud Date: Sun, 30 Jul 2017 12:00:42 +0200 Subject: [PATCH] Improve handling of unsafe user names --- radicale/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index cbc025b..52c3bab 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -458,7 +458,13 @@ class Application: None) if not principal: with self.Collection.acquire_lock("w", user): - self.Collection.create_collection(principal_path) + try: + self.Collection.create_collection(principal_path) + except ValueError as e: + self.logger.warning( + "Failed to create principal collection %r: %s", + principal_path, e) + is_authenticated = False else: self.logger.warning("Access to principal path %r denied by " "rights backend", principal_path)