Klaus Demo nginx / 7ba66f4
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
2 changed file(s) with 6 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
581581 p = name->data;
582582 end = p + name->len;
583583
584 at_fd = AT_FDCWD;
584 at_fd = NGX_AT_FDCWD;
585585 at_name = *name;
586586
587587 if (p[0] == '/') {
631631 goto failed;
632632 }
633633
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) {
635635 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
636636 ngx_close_file_n " \"%V\" failed", &at_name);
637637 }
641641 at_name.len = cp - at_name.data;
642642 }
643643
644 if (p == end && at_fd != AT_FDCWD) {
644 if (p == end && at_fd != NGX_AT_FDCWD) {
645645
646646 /*
647647 * If pathname ends with a trailing slash, check if last path
689689
690690 failed:
691691
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) {
693693 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
694694 ngx_close_file_n " \"%V\" failed", &at_name);
695695 }
339339
340340 #define ngx_file_at_info_n "fstatat()"
341341
342 #define NGX_AT_FDCWD (ngx_fd_t) AT_FDCWD
343
342344 #endif
343345
344346