comparison src/http/modules/ngx_http_index_module.c @ 662:e5fa0a4a7d27 NGINX_1_1_15

nginx 1.1.15 *) Feature: the "disable_symlinks" directive. *) Feature: the "proxy_cookie_domain" and "proxy_cookie_path" directives. *) Bugfix: nginx might log incorrect error "upstream prematurely closed connection" instead of correct "upstream sent too big header" one. Thanks to Feibo Li. *) Bugfix: nginx could not be built with the ngx_http_perl_module if the --with-openssl option was used. *) Bugfix: internal redirects to named locations were not limited. *) Bugfix: calling $r->flush() multiple times might cause errors in the ngx_http_gzip_filter_module. *) Bugfix: temporary files might be not removed if the "proxy_store" directive were used with SSI includes. *) Bugfix: in some cases non-cacheable variables (such as the $args variable) returned old empty cached value. *) Bugfix: a segmentation fault might occur in a worker process if too many SSI subrequests were issued simultaneously; the bug had appeared in 0.7.25.
author Igor Sysoev <http://sysoev.ru>
date Wed, 15 Feb 2012 00:00:00 +0400
parents d0f7a625f27c
children f5b859b2f097
comparison
equal deleted inserted replaced
661:b49c1751031c 662:e5fa0a4a7d27
207 of.valid = clcf->open_file_cache_valid; 207 of.valid = clcf->open_file_cache_valid;
208 of.min_uses = clcf->open_file_cache_min_uses; 208 of.min_uses = clcf->open_file_cache_min_uses;
209 of.test_only = 1; 209 of.test_only = 1;
210 of.errors = clcf->open_file_cache_errors; 210 of.errors = clcf->open_file_cache_errors;
211 of.events = clcf->open_file_cache_events; 211 of.events = clcf->open_file_cache_events;
212 #if (NGX_HAVE_OPENAT)
213 of.disable_symlinks = clcf->disable_symlinks;
214 #endif
212 215
213 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) 216 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
214 != NGX_OK) 217 != NGX_OK)
215 { 218 {
216 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, of.err, 219 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, of.err,
218 221
219 if (of.err == 0) { 222 if (of.err == 0) {
220 return NGX_HTTP_INTERNAL_SERVER_ERROR; 223 return NGX_HTTP_INTERNAL_SERVER_ERROR;
221 } 224 }
222 225
226 #if (NGX_HAVE_OPENAT)
227 if (of.err == NGX_EMLINK
228 || of.err == NGX_ELOOP)
229 {
230 return NGX_HTTP_FORBIDDEN;
231 }
232 #endif
233
223 if (of.err == NGX_ENOTDIR 234 if (of.err == NGX_ENOTDIR
224 || of.err == NGX_ENAMETOOLONG 235 || of.err == NGX_ENAMETOOLONG
225 || of.err == NGX_EACCES) 236 || of.err == NGX_EACCES)
226 { 237 {
227 return ngx_http_index_error(r, clcf, path.data, of.err); 238 return ngx_http_index_error(r, clcf, path.data, of.err);
294 305
295 of.test_dir = 1; 306 of.test_dir = 1;
296 of.test_only = 1; 307 of.test_only = 1;
297 of.valid = clcf->open_file_cache_valid; 308 of.valid = clcf->open_file_cache_valid;
298 of.errors = clcf->open_file_cache_errors; 309 of.errors = clcf->open_file_cache_errors;
310 #if (NGX_HAVE_OPENAT)
311 of.disable_symlinks = clcf->disable_symlinks;
312 #endif
299 313
300 if (ngx_open_cached_file(clcf->open_file_cache, &dir, &of, r->pool) 314 if (ngx_open_cached_file(clcf->open_file_cache, &dir, &of, r->pool)
301 != NGX_OK) 315 != NGX_OK)
302 { 316 {
303 if (of.err) { 317 if (of.err) {
318
319 #if (NGX_HAVE_OPENAT)
320 if (of.err == NGX_EMLINK
321 || of.err == NGX_ELOOP)
322 {
323 return NGX_HTTP_FORBIDDEN;
324 }
325 #endif
304 326
305 if (of.err == NGX_ENOENT) { 327 if (of.err == NGX_ENOENT) {
306 *last = c; 328 *last = c;
307 return ngx_http_index_error(r, clcf, dir.data, NGX_ENOENT); 329 return ngx_http_index_error(r, clcf, dir.data, NGX_ENOENT);
308 } 330 }