diff -up nginx-1.16.1/src/core/ngx_open_file_cache.c.orig nginx-1.16.1/src/core/ngx_open_file_cache.c
|
old
|
new
|
ngx_openat_file_owner(ngx_fd_t at_fd, co
|
| 496 | 496 | ngx_err_t err; |
| 497 | 497 | ngx_file_info_t fi, atfi; |
| 498 | 498 | |
| | 499 | ngx_log_debug0(NGX_LOG_DEBUG_CORE, log, 0, |
| | 500 | "ngx_openat_file_owner(): enter"); |
| | 501 | |
| | 502 | |
| 499 | 503 | /* |
| 500 | 504 | * To allow symlinks with the same owner, use openat() (followed |
| 501 | 505 | * by fstat()) and fstatat(AT_SYMLINK_NOFOLLOW), and then compare |
| … |
… |
ngx_openat_file_owner(ngx_fd_t at_fd, co
|
| 508 | 512 | * symlink during openat() or not). |
| 509 | 513 | */ |
| 510 | 514 | |
| | 515 | ngx_log_debug5(NGX_LOG_DEBUG_CORE, log, 0, |
| | 516 | "ngx_openat_file_owner(): ngx_openat_file(name=\"%s\", fd=#%d, mode=%d, create=%d, access=%d)", |
| | 517 | name, at_fd, mode, create, access); |
| | 518 | |
| 511 | 519 | fd = ngx_openat_file(at_fd, name, mode, create, access); |
| 512 | 520 | |
| 513 | 521 | if (fd == NGX_INVALID_FILE) { |
| | 522 | ngx_log_debug0(NGX_LOG_DEBUG_CORE, log, 0, |
| | 523 | "ngx_openat_file_owner(): ngx_openat_file(): failed (invalid file)"); |
| | 524 | |
| 514 | 525 | return NGX_INVALID_FILE; |
| 515 | 526 | } |
| 516 | 527 | |
| … |
… |
ngx_open_file_wrapper(ngx_str_t *name, n
|
| 616 | 627 | { |
| 617 | 628 | ngx_fd_t fd; |
| 618 | 629 | |
| | 630 | ngx_log_debug0(NGX_LOG_DEBUG_CORE, log, 0, |
| | 631 | "ngx_open_file_wrapper(): enter"); |
| | 632 | |
| 619 | 633 | #if !(NGX_HAVE_OPENAT) |
| 620 | 634 | |
| 621 | 635 | fd = ngx_open_file(name->data, mode, create, access); |
| … |
… |
ngx_open_file_wrapper(ngx_str_t *name, n
|
| 730 | 744 | p = cp + 1; |
| 731 | 745 | at_fd = fd; |
| 732 | 746 | at_name.len = cp - at_name.data; |
| | 747 | |
| | 748 | ngx_log_debug6(NGX_LOG_DEBUG_CORE, log, 0, |
| | 749 | "ngx_open_file_wrapper(): for_loop_end: p=\"%s\"(addr:%p), cp=\"%s\"(addr:%p), end=\"%s\"(addr:%p)", |
| | 750 | p, (void *) p, cp, (void *) cp, end, (void *) end); |
| 733 | 751 | } |
| 734 | 752 | |
| 735 | 753 | if (p == end) { |
diff -up nginx-1.16.1/src/http/modules/ngx_http_log_module.c.orig nginx-1.16.1/src/http/modules/ngx_http_log_module.c
|
old
|
new
|
ngx_http_log_script_write(ngx_http_reque
|
| 481 | 481 | |
| 482 | 482 | clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
| 483 | 483 | |
| | 484 | ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
| | 485 | "ngx_http_log_script_write(): enter"); |
| | 486 | |
| 484 | 487 | if (!r->root_tested) { |
| 485 | 488 | |
| 486 | 489 | /* test root directory existence */ |
| … |
… |
ngx_http_log_script_write(ngx_http_reque
|
| 490 | 493 | return len; |
| 491 | 494 | } |
| 492 | 495 | |
| | 496 | ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
| | 497 | "ngx_http_log_script_write(): ngx_http_map_uri_to_path(): path=\"%s\"(len:%d), root=len:%d", path.data, path.len, root); |
| | 498 | |
| 493 | 499 | path.data[root] = '\0'; |
| 494 | 500 | |
| | 501 | ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
| | 502 | "ngx_http_log_script_write(): after_truncate_root: path=\"%s\"(len:%d)", path.data, path.len); |
| | 503 | |
| 495 | 504 | ngx_memzero(&of, sizeof(ngx_open_file_info_t)); |
| 496 | 505 | |
| 497 | 506 | of.valid = clcf->open_file_cache_valid; |
| … |
… |
ngx_http_log_script_write(ngx_http_reque
|
| 515 | 524 | } |
| 516 | 525 | |
| 517 | 526 | ngx_log_error(NGX_LOG_ERR, r->connection->log, of.err, |
| 518 | | "testing \"%s\" existence failed", path.data); |
| | 527 | "testing file \"%s\" existence failed", path.data); |
| 519 | 528 | |
| 520 | 529 | /* simulate successful logging */ |
| 521 | 530 | return len; |
| … |
… |
ngx_http_log_script_write(ngx_http_reque
|
| 523 | 532 | |
| 524 | 533 | if (!of.is_dir) { |
| 525 | 534 | ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ENOTDIR, |
| 526 | | "testing \"%s\" existence failed", path.data); |
| | 535 | "testing directory \"%s\" existence failed", path.data); |
| 527 | 536 | |
| 528 | 537 | /* simulate successful logging */ |
| 529 | 538 | return len; |