summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordarix <darix@152afb58-edef-0310-8abb-c4023f1b3aa9>2006-09-21 08:48:52 +0000
committerdarix <darix@152afb58-edef-0310-8abb-c4023f1b3aa9>2006-09-21 08:48:52 +0000
commitcef83d4f40aa4906c6f21390e622a9562fe81206 (patch)
tree7b6d347a8c138d43580e4814fb77ccffa3d0f095
parent6d7f58368ea447bf5fda11db0f12d9f24e6360cb (diff)
downloadlighttpd-cef83d4f40aa4906c6f21390e622a9562fe81206.tar.gz
- mod_webdav honors the umask now.
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.11-ssl-fixes@1327 152afb58-edef-0310-8abb-c4023f1b3aa9
-rw-r--r--src/mod_webdav.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mod_webdav.c b/src/mod_webdav.c
index 2e67c96b..5f4ad271 100644
--- a/src/mod_webdav.c
+++ b/src/mod_webdav.c
@@ -668,7 +668,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:
@@ -1651,7 +1651,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 */
@@ -1675,9 +1675,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;