|
|
| version 1.1.1.1, 2013/10/14 10:32:47 | version 1.1.1.2, 2014/06/15 20:20:06 |
|---|---|
| Line 179 SETDEFAULTS_FUNC(mod_webdav_set_defaults) { | Line 179 SETDEFAULTS_FUNC(mod_webdav_set_defaults) { |
| if (!p) return HANDLER_ERROR; | if (!p) return HANDLER_ERROR; |
| p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *)); | p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *)); |
| for (i = 0; i < srv->config_context->used; i++) { | for (i = 0; i < srv->config_context->used; i++) { |
| plugin_config *s; | plugin_config *s; |
| Line 1258 URIHANDLER_FUNC(mod_webdav_subrequest_handler) { | Line 1258 URIHANDLER_FUNC(mod_webdav_subrequest_handler) { |
| if (1 == webdav_parse_chunkqueue(srv, con, p, con->request_content_queue, &xml)) { | if (1 == webdav_parse_chunkqueue(srv, con, p, con->request_content_queue, &xml)) { |
| xmlNode *rootnode = xmlDocGetRootElement(xml); | xmlNode *rootnode = xmlDocGetRootElement(xml); |
| assert(rootnode); | force_assert(rootnode); |
| if (0 == xmlStrcmp(rootnode->name, BAD_CAST "propfind")) { | if (0 == xmlStrcmp(rootnode->name, BAD_CAST "propfind")) { |
| xmlNode *cmd; | xmlNode *cmd; |
| Line 1690 URIHANDLER_FUNC(mod_webdav_subrequest_handler) { | Line 1690 URIHANDLER_FUNC(mod_webdav_subrequest_handler) { |
| /* if the file doesn't exist, create it */ | /* if the file doesn't exist, create it */ |
| if (-1 == (fd = open(con->physical.path->ptr, O_WRONLY|O_TRUNC, WEBDAV_FILE_MODE))) { | 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))) { | -1 == (fd = open(con->physical.path->ptr, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, WEBDAV_FILE_MODE))) { |
| /* we can't open the file */ | /* we can't open the file */ |
| con->http_status = 403; | con->http_status = 403; |
| Line 1717 URIHANDLER_FUNC(mod_webdav_subrequest_handler) { | Line 1717 URIHANDLER_FUNC(mod_webdav_subrequest_handler) { |
| if (-1 == c->file.fd && /* open the file if not already open */ | if (-1 == c->file.fd && /* open the file if not already open */ |
| -1 == (c->file.fd = open(c->file.name->ptr, O_RDONLY))) { | -1 == (c->file.fd = open(c->file.name->ptr, O_RDONLY))) { |
| log_error_write(srv, __FILE__, __LINE__, "ss", "open failed: ", strerror(errno)); | log_error_write(srv, __FILE__, __LINE__, "ss", "open failed: ", strerror(errno)); |
| close(fd); | |
| return HANDLER_ERROR; | return HANDLER_ERROR; |
| } | } |
| Line 1726 URIHANDLER_FUNC(mod_webdav_subrequest_handler) { | Line 1726 URIHANDLER_FUNC(mod_webdav_subrequest_handler) { |
| strerror(errno), c->file.name, c->file.fd); | strerror(errno), c->file.name, c->file.fd); |
| close(c->file.fd); | close(c->file.fd); |
| c->file.fd = -1; | c->file.fd = -1; |
| close(fd); | |
| return HANDLER_ERROR; | return HANDLER_ERROR; |
| } | } |
| Line 2235 propmatch_cleanup: | Line 2235 propmatch_cleanup: |
| if (1 == webdav_parse_chunkqueue(srv, con, p, con->request_content_queue, &xml)) { | if (1 == webdav_parse_chunkqueue(srv, con, p, con->request_content_queue, &xml)) { |
| xmlNode *rootnode = xmlDocGetRootElement(xml); | xmlNode *rootnode = xmlDocGetRootElement(xml); |
| assert(rootnode); | force_assert(rootnode); |
| if (0 == xmlStrcmp(rootnode->name, BAD_CAST "lockinfo")) { | if (0 == xmlStrcmp(rootnode->name, BAD_CAST "lockinfo")) { |
| xmlNode *lockinfo; | xmlNode *lockinfo; |