diff src/http/modules/ngx_http_dav_module.c @ 282:675a39fd14cd NGINX_0_5_11

nginx 0.5.11 *) Feature: now configure detects system PCRE library in MacPorts. Thanks to Chris McGrath. *) Bugfix: the response was incorrect if several ranges were requested; bug appeared in 0.5.6. *) Bugfix: the "create_full_put_path" directive could not create the intermediate directories if no "dav_access" directive was set. Thanks to Evan Miller. *) Bugfix: the "0" response code might be logged in the access_log instead of the "400" and "408" error codes. *) Bugfix: a segmentation fault might occur in worker process if nginx was built with -O2 optimization.
author Igor Sysoev <http://sysoev.ru>
date Mon, 05 Feb 2007 00:00:00 +0300
parents 704622b2528a
children 5bef04fc3fd5
line wrap: on
line diff
--- a/src/http/modules/ngx_http_dav_module.c
+++ b/src/http/modules/ngx_http_dav_module.c
@@ -252,7 +252,9 @@ ngx_http_dav_handler(ngx_http_request_t 
         ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                        "http mkcol path: \"%s\"", path.data);
 
-        if (ngx_create_dir(path.data, dlcf->access) != NGX_FILE_ERROR) {
+        if (ngx_create_dir(path.data, ngx_dir_access(dlcf->access))
+            != NGX_FILE_ERROR)
+        {
             if (ngx_http_dav_location(r, path.data) != NGX_OK) {
                 return NGX_HTTP_INTERNAL_SERVER_ERROR;
             }
@@ -351,7 +353,7 @@ ngx_http_dav_put_handler(ngx_http_reques
 
 #if !(NGX_WIN32)
 
-    if (ngx_change_file_access(temp->data, dlcf->access & ~0111)
+    if (ngx_change_file_access(temp->data, dlcf->access)
         == NGX_FILE_ERROR)
     {
         err = ngx_errno;
@@ -393,7 +395,7 @@ ngx_http_dav_put_handler(ngx_http_reques
     if (err == NGX_ENOENT) {
 
         if (dlcf->create_full_put_path) {
-            err = ngx_create_full_path(path.data, dlcf->access);
+            err = ngx_create_full_path(path.data, ngx_dir_access(dlcf->access));
 
             if (err == 0) {
                 if (ngx_rename_file(temp->data, path.data) != NGX_FILE_ERROR) {
@@ -539,7 +541,7 @@ ngx_http_dav_access(ngx_conf_t *cf, ngx_
 
     value = cf->args->elts;
 
-    lcf->access = 0700;
+    lcf->access = 0600;
 
     for (i = 1; i < cf->args->nelts; i++) {
 
@@ -562,16 +564,16 @@ ngx_http_dav_access(ngx_conf_t *cf, ngx_
         }
 
         if (ngx_strcmp(p, "rw") == 0) {
-            right = 7;
+            right = 6;
 
         } else if (ngx_strcmp(p, "r") == 0) {
-            right = 5;
+            right = 4;
 
         } else {
             goto invalid;
         }
 
-        lcf->access += right << shift;
+        lcf->access |= right << shift;
     }
 
     return NGX_CONF_OK;