diff options
author | darix <darix@152afb58-edef-0310-8abb-c4023f1b3aa9> | 2006-09-23 16:29:56 +0000 |
---|---|---|
committer | darix <darix@152afb58-edef-0310-8abb-c4023f1b3aa9> | 2006-09-23 16:29:56 +0000 |
commit | 26f3383f1b7d0966c5659c2c68bfe0694f16f694 (patch) | |
tree | dafda620e12924bd3ed1b98f8ee241cc4408c37a | |
parent | 5935348e6cb18a819d6d212a26fa3452823e58c0 (diff) | |
download | lighttpd-merge-1.4.x.tar.gz |
- merged fixes from the ssl fixes branchlighttpd-merge-1.4.x
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@1342 152afb58-edef-0310-8abb-c4023f1b3aa9
-rw-r--r-- | src/mod_webdav.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mod_webdav.c b/src/mod_webdav.c index 5479b42c..5ba3c37f 100644 --- a/src/mod_webdav.c +++ b/src/mod_webdav.c @@ -665,7 +665,7 @@ static int webdav_copy_file(server *srv, connection *con, plugin_data *p, physic return 403; } - if (-1 == (ofd = open(dst->path->ptr, O_WRONLY|O_TRUNC|O_CREAT|(overwrite ? 0 : O_EXCL), 0600))) { + if (-1 == (ofd = open(dst->path->ptr, O_WRONLY|O_TRUNC|O_CREAT|(overwrite ? 0 : O_EXCL), S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH))) { /* opening the destination failed for some reason */ switch(errno) { case EEXIST: @@ -1648,7 +1648,7 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) { return HANDLER_FINISHED; } - if (-1 == (fd = open(con->physical.path->ptr, O_WRONLY, 0600))) { + if (-1 == (fd = open(con->physical.path->ptr, O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH))) { switch (errno) { case ENOENT: con->http_status = 404; /* not found */ @@ -1672,9 +1672,9 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) { /* take what we have in the request-body and write it to a file */ /* if the file doesn't exist, create it */ - if (-1 == (fd = open(con->physical.path->ptr, O_WRONLY|O_TRUNC, 0600))) { + if (-1 == (fd = open(con->physical.path->ptr, O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH))) { if (errno == ENOENT && - -1 == (fd = open(con->physical.path->ptr, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, 0600))) { + -1 == (fd = open(con->physical.path->ptr, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH))) { /* we can't open the file */ con->http_status = 403; @@ -1701,14 +1701,14 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) { -1 == (c->file.fd = open(c->file.name->ptr, O_RDONLY))) { log_error_write(srv, __FILE__, __LINE__, "ss", "open failed: ", strerror(errno)); - return -1; + return HANDLER_ERROR; } if (MAP_FAILED == (c->file.mmap.start = mmap(0, c->file.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) { log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed: ", strerror(errno), c->file.name, c->file.fd); - return -1; + return HANDLER_ERROR; } c->file.mmap.length = c->file.length; |