aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_file.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2013-09-16 18:49:23 +0400
committerValentin Bartenev <vbart@nginx.com>2013-09-16 18:49:23 +0400
commitdb1532944cef68f835917894b8e9fc569d1712b4 (patch)
tree0c93c5e1e44073fa5b9a3432dc82055e3343978b /src/core/ngx_file.c
parenteb10d8f71ec237d77fc5dec58917087700661eb0 (diff)
downloadnginx-db1532944cef68f835917894b8e9fc569d1712b4.tar.gz
nginx-db1532944cef68f835917894b8e9fc569d1712b4.zip
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;
Diffstat (limited to 'src/core/ngx_file.c')
-rw-r--r--src/core/ngx_file.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/ngx_file.c b/src/core/ngx_file.c
index 176bbb6c6..7e6e921a3 100644
--- a/src/core/ngx_file.c
+++ b/src/core/ngx_file.c
@@ -501,6 +501,14 @@ ngx_add_path(ngx_conf_t *cf, ngx_path_t **slot)
if (p[i]->name.len == path->name.len
&& 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++) {
if (p[i]->level[n] != path->level[n]) {
if (path->conf_file == NULL) {