Disable symlinks: added explicit cast of AT_FDCWD (ticket #111).
Solaris has AT_FDCWD defined to unsigned value, and comparison of a file
descriptor with it causes warnings in modern versions of gcc. Explicitly
cast AT_FDCWD to ngx_fd_t to resolve these warnings.
Maxim Dounin
10 years ago
581 | 581 | p = name->data; |
582 | 582 | end = p + name->len; |
583 | 583 | |
584 | at_fd = AT_FDCWD; | |
584 | at_fd = NGX_AT_FDCWD; | |
585 | 585 | at_name = *name; |
586 | 586 | |
587 | 587 | if (p[0] == '/') { |
631 | 631 | goto failed; |
632 | 632 | } |
633 | 633 | |
634 | if (at_fd != AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) { | |
634 | if (at_fd != NGX_AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) { | |
635 | 635 | ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, |
636 | 636 | ngx_close_file_n " \"%V\" failed", &at_name); |
637 | 637 | } |
641 | 641 | at_name.len = cp - at_name.data; |
642 | 642 | } |
643 | 643 | |
644 | if (p == end && at_fd != AT_FDCWD) { | |
644 | if (p == end && at_fd != NGX_AT_FDCWD) { | |
645 | 645 | |
646 | 646 | /* |
647 | 647 | * If pathname ends with a trailing slash, check if last path |
689 | 689 | |
690 | 690 | failed: |
691 | 691 | |
692 | if (at_fd != AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) { | |
692 | if (at_fd != NGX_AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) { | |
693 | 693 | ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, |
694 | 694 | ngx_close_file_n " \"%V\" failed", &at_name); |
695 | 695 | } |