Mercurial > hg > nginx
comparison src/core/ngx_file.c @ 5377:cec155f07c84
Improved check for duplicate path names in ngx_add_path().
The same path names with different "data" context should not be allowed.
In particular it rejects configurations like this:
proxy_cache_path /var/cache/ keys_zone=one:10m max_size=1g inactive=5m;
proxy_cache_path /var/cache/ keys_zone=two:20m max_size=4m inactive=30s;
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Mon, 16 Sep 2013 18:49:23 +0400 |
parents | dd9cb4edf499 |
children | 570677a06dce |
comparison
equal
deleted
inserted
replaced
5376:dd9cb4edf499 | 5377:cec155f07c84 |
---|---|
499 p = cf->cycle->paths.elts; | 499 p = cf->cycle->paths.elts; |
500 for (i = 0; i < cf->cycle->paths.nelts; i++) { | 500 for (i = 0; i < cf->cycle->paths.nelts; i++) { |
501 if (p[i]->name.len == path->name.len | 501 if (p[i]->name.len == path->name.len |
502 && ngx_strcmp(p[i]->name.data, path->name.data) == 0) | 502 && ngx_strcmp(p[i]->name.data, path->name.data) == 0) |
503 { | 503 { |
504 if (p[i]->data != path->data) { | |
505 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
506 "the same path name \"%V\" " | |
507 "used in %s:%ui and", | |
508 &p[i]->name, p[i]->conf_file, p[i]->line); | |
509 return NGX_ERROR; | |
510 } | |
511 | |
504 for (n = 0; n < 3; n++) { | 512 for (n = 0; n < 3; n++) { |
505 if (p[i]->level[n] != path->level[n]) { | 513 if (p[i]->level[n] != path->level[n]) { |
506 if (path->conf_file == NULL) { | 514 if (path->conf_file == NULL) { |
507 if (p[i]->conf_file == NULL) { | 515 if (p[i]->conf_file == NULL) { |
508 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, | 516 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, |