comparison 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
comparison
equal deleted inserted replaced
281:5338da501733 282:675a39fd14cd
250 ngx_http_map_uri_to_path(r, &path, &root, 0); 250 ngx_http_map_uri_to_path(r, &path, &root, 0);
251 251
252 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 252 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
253 "http mkcol path: \"%s\"", path.data); 253 "http mkcol path: \"%s\"", path.data);
254 254
255 if (ngx_create_dir(path.data, dlcf->access) != NGX_FILE_ERROR) { 255 if (ngx_create_dir(path.data, ngx_dir_access(dlcf->access))
256 != NGX_FILE_ERROR)
257 {
256 if (ngx_http_dav_location(r, path.data) != NGX_OK) { 258 if (ngx_http_dav_location(r, path.data) != NGX_OK) {
257 return NGX_HTTP_INTERNAL_SERVER_ERROR; 259 return NGX_HTTP_INTERNAL_SERVER_ERROR;
258 } 260 }
259 261
260 return NGX_HTTP_CREATED; 262 return NGX_HTTP_CREATED;
349 351
350 dlcf = ngx_http_get_module_loc_conf(r, ngx_http_dav_module); 352 dlcf = ngx_http_get_module_loc_conf(r, ngx_http_dav_module);
351 353
352 #if !(NGX_WIN32) 354 #if !(NGX_WIN32)
353 355
354 if (ngx_change_file_access(temp->data, dlcf->access & ~0111) 356 if (ngx_change_file_access(temp->data, dlcf->access)
355 == NGX_FILE_ERROR) 357 == NGX_FILE_ERROR)
356 { 358 {
357 err = ngx_errno; 359 err = ngx_errno;
358 failed = ngx_change_file_access_n; 360 failed = ngx_change_file_access_n;
359 name = temp->data; 361 name = temp->data;
391 err = ngx_errno; 393 err = ngx_errno;
392 394
393 if (err == NGX_ENOENT) { 395 if (err == NGX_ENOENT) {
394 396
395 if (dlcf->create_full_put_path) { 397 if (dlcf->create_full_put_path) {
396 err = ngx_create_full_path(path.data, dlcf->access); 398 err = ngx_create_full_path(path.data, ngx_dir_access(dlcf->access));
397 399
398 if (err == 0) { 400 if (err == 0) {
399 if (ngx_rename_file(temp->data, path.data) != NGX_FILE_ERROR) { 401 if (ngx_rename_file(temp->data, path.data) != NGX_FILE_ERROR) {
400 goto ok; 402 goto ok;
401 } 403 }
537 return "is duplicate"; 539 return "is duplicate";
538 } 540 }
539 541
540 value = cf->args->elts; 542 value = cf->args->elts;
541 543
542 lcf->access = 0700; 544 lcf->access = 0600;
543 545
544 for (i = 1; i < cf->args->nelts; i++) { 546 for (i = 1; i < cf->args->nelts; i++) {
545 547
546 p = value[i].data; 548 p = value[i].data;
547 549
560 } else { 562 } else {
561 goto invalid; 563 goto invalid;
562 } 564 }
563 565
564 if (ngx_strcmp(p, "rw") == 0) { 566 if (ngx_strcmp(p, "rw") == 0) {
565 right = 7; 567 right = 6;
566 568
567 } else if (ngx_strcmp(p, "r") == 0) { 569 } else if (ngx_strcmp(p, "r") == 0) {
568 right = 5; 570 right = 4;
569 571
570 } else { 572 } else {
571 goto invalid; 573 goto invalid;
572 } 574 }
573 575
574 lcf->access += right << shift; 576 lcf->access |= right << shift;
575 } 577 }
576 578
577 return NGX_CONF_OK; 579 return NGX_CONF_OK;
578 580
579 invalid: 581 invalid: