]> git.kaiwu.me - nginx.git/commitdiff
disable $realpath_root variable in a "root" directive
authorIgor Sysoev <igor@sysoev.ru>
Mon, 29 Sep 2008 04:47:22 +0000 (04:47 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 29 Sep 2008 04:47:22 +0000 (04:47 +0000)
src/http/ngx_http_core_module.c

index ebd082f59611465810cf05cd6cc1c9184736a43f..1d8a5522297de3f2ffe8acbecc9413a70575b6e3 100644 (file)
@@ -3291,6 +3291,17 @@ ngx_http_core_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
         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];