Anonymous User
February 21, 2012 10:02AM
Author: vbart
Date: 2012-02-21 15:01:25 +0000 (Tue, 21 Feb 2012)
New Revision: 4487

Modified:
trunk/src/core/ngx_open_file_cache.c
Log:
Disable symlinks: cleanups once again.

In collaboration with Ruslan Ermilov.


Modified: trunk/src/core/ngx_open_file_cache.c
===================================================================
--- trunk/src/core/ngx_open_file_cache.c 2012-02-20 19:14:35 UTC (rev 4486)
+++ trunk/src/core/ngx_open_file_cache.c 2012-02-21 15:01:25 UTC (rev 4487)
@@ -504,8 +504,8 @@

fd = ngx_openat_file(at_fd, name, mode, create, access);

- if (fd == NGX_FILE_ERROR) {
- return NGX_FILE_ERROR;
+ if (fd == NGX_INVALID_FILE) {
+ return NGX_INVALID_FILE;
}

if (ngx_file_at_info(at_fd, name, &atfi, AT_SYMLINK_NOFOLLOW)
@@ -582,13 +582,12 @@
p = name->data;
end = p + name->len;

- at_fd = NGX_AT_FDCWD;
at_name = *name;

- if (p[0] == '/') {
- at_fd = ngx_openat_file(at_fd, "/",
- NGX_FILE_RDONLY|NGX_FILE_NONBLOCK,
- NGX_FILE_OPEN, 0);
+ if (*p == '/') {
+ at_fd = ngx_open_file("/",
+ NGX_FILE_RDONLY|NGX_FILE_NONBLOCK,
+ NGX_FILE_OPEN, 0);

if (at_fd == NGX_INVALID_FILE) {
of->err = ngx_errno;
@@ -598,6 +597,9 @@

at_name.len = 1;
p++;
+
+ } else {
+ at_fd = NGX_AT_FDCWD;
}

for ( ;; ) {
@@ -642,7 +644,7 @@
at_name.len = cp - at_name.data;
}

- if (p == end && at_fd != NGX_AT_FDCWD) {
+ if (p == end) {

/*
* If pathname ends with a trailing slash, check if last path

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r4487 - trunk/src/core

Anonymous User 1284 February 21, 2012 10:02AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 160
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready