[mod_webdav] fix logic error in handling file creation error

From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2955 152afb58-edef-0310-8abb-c4023f1b3aa9
This commit is contained in:
Stefan Bühler 2014-02-16 13:08:36 +00:00
parent 57c661c191
commit 8e31e18b8e
2 changed files with 2 additions and 1 deletions

1
NEWS
View File

@ -19,6 +19,7 @@ NEWS
* force assertion: setting FD_CLOEXEC must work (if available)
* [network] check return value of lseek()
* fix unchecked return values from stream_open/stat_cache_get_entry
* [mod_webdav] fix logic error in handling file creation error
- 1.4.34
* [mod_auth] explicitly link ssl for SHA1 (fixes #2517)

View File

@ -1690,7 +1690,7 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
/* if the file doesn't exist, create it */
if (-1 == (fd = open(con->physical.path->ptr, O_WRONLY|O_TRUNC, WEBDAV_FILE_MODE))) {
if (errno == ENOENT &&
if (errno != ENOENT ||
-1 == (fd = open(con->physical.path->ptr, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, WEBDAV_FILE_MODE))) {
/* we can't open the file */
con->http_status = 403;