From ab829cee5e6ff117df27f7a2a1e336f91f2a7acb Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Fri, 1 Apr 2016 16:26:25 +0000 Subject: [PATCH] [mod_webdav] allow Depth: Infinity lock on file (fixes #2296) (still not supporting Depth: Infinity on directories) patch by mstorsjo submitted as part of feature request #1953 From: Glenn Strauss git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3133 152afb58-edef-0310-8abb-c4023f1b3aa9 --- NEWS | 1 + src/mod_webdav.c | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 9df2a8a6..1cdc4383 100644 --- a/NEWS +++ b/NEWS @@ -56,6 +56,7 @@ NEWS * [core] fixed the loading for default modules if they are specified explicitly * [core] lighttpd -tt performs preflight startup checks (fixes #411) * [stat] mimetype.xattr-name global config option (fixes #2631) + * [mod_webdav] allow Depth: Infinity lock on file (fixes #2296) - 1.4.39 - 2016-01-02 * [core] fix memset_s call (fixes #2698) diff --git a/src/mod_webdav.c b/src/mod_webdav.c index c9365cd3..f9655ff0 100644 --- a/src/mod_webdav.c +++ b/src/mod_webdav.c @@ -2218,11 +2218,13 @@ propmatch_cleanup: hdr_if = ds->value; } - /* we don't support Depth: Infinity on locks */ + /* we don't support Depth: Infinity on directories */ if (hdr_if == NULL && depth == -1) { - con->http_status = 409; /* Conflict */ + if (0 == stat(con->physical.path->ptr, &st) && S_ISDIR(st.st_mode)) { + con->http_status = 409; /* Conflict */ - return HANDLER_FINISHED; + return HANDLER_FINISHED; + } } if (1 == webdav_parse_chunkqueue(srv, con, p, con->request_content_queue, &xml)) {