# HG changeset patch # User Igor Sysoev # Date 1222663642 0 # Node ID 41b51261b726f646ca328969142a2e57298eda5a # Parent c31f46332e809acae35cf017709dae074527d2d6 disable $realpath_root variable in a "root" directive diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -3291,6 +3291,17 @@ ngx_http_core_root(ngx_conf_t *cf, ngx_c return NGX_CONF_ERROR; } + if (ngx_strstr(value[1].data, "$realpath_root") + || ngx_strstr(value[1].data, "${realpath_root}")) + { + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + "the $realpath_root variable may not be used " + "in the \"%V\" directive", + &cmd->name); + + return NGX_CONF_ERROR; + } + lcf->alias = alias; lcf->root = value[1];