mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
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;
This commit is contained in:
parent
eb10d8f71e
commit
db1532944c
@ -501,6 +501,14 @@ ngx_add_path(ngx_conf_t *cf, ngx_path_t **slot)
|
|||||||
if (p[i]->name.len == path->name.len
|
if (p[i]->name.len == path->name.len
|
||||||
&& ngx_strcmp(p[i]->name.data, path->name.data) == 0)
|
&& ngx_strcmp(p[i]->name.data, path->name.data) == 0)
|
||||||
{
|
{
|
||||||
|
if (p[i]->data != path->data) {
|
||||||
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
||||||
|
"the same path name \"%V\" "
|
||||||
|
"used in %s:%ui and",
|
||||||
|
&p[i]->name, p[i]->conf_file, p[i]->line);
|
||||||
|
return NGX_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
for (n = 0; n < 3; n++) {
|
for (n = 0; n < 3; n++) {
|
||||||
if (p[i]->level[n] != path->level[n]) {
|
if (p[i]->level[n] != path->level[n]) {
|
||||||
if (path->conf_file == NULL) {
|
if (path->conf_file == NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user