From aacdd3da02bd4be6cc3e8a6d3dc82135c19a6aaf Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Mon, 22 Apr 2019 22:09:50 -0400 Subject: [PATCH] [mod_webdav] special-case If: () (recognize , but supporting logic is limited) --- src/mod_webdav.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mod_webdav.c b/src/mod_webdav.c index c0922d52..423ec10f 100644 --- a/src/mod_webdav.c +++ b/src/mod_webdav.c @@ -3537,9 +3537,9 @@ webdav_has_lock (connection * const con, * List = "(" 1*Condition ")" * Condition = ["Not"] (State-token | "[" entity-tag "]") */ + int notflag = 0; while (*p != '\0' && *++p != ')') { while (*p == ' ' || *p == '\t') ++p; - int notflag = 0; if ( (p[0] & 0xdf) == 'N' && (p[1] & 0xdf) == 'O' && (p[2] & 0xdf) == 'T') { @@ -3575,6 +3575,17 @@ webdav_has_lock (connection * const con, continue; } + if (p[1] == 'D' + && 0 == strncmp(p, "", + sizeof("")-1)) { + if (0 == notflag) { + http_status_set_error(con,412);/* Precondition Failed */ + return 0; + } + p += sizeof("")-2; /* point p to '>' */ + continue; + } + /* State-token (Coded-URL) * Coded-URL = "<" absolute-URI ">" * ; No linear whitespace (LWS) allowed in Coded-URL -- 2.11.4.GIT