feature: applied the invalid_referer_hash patch to the nginx core to make the $invalid_referer variable accessible in embedded dynamic languages like Perl and Lua. thanks Fry-kun for requesting this.

This commit is contained in:
agentzh (Yichun Zhang) 2013-05-21 16:19:10 -07:00
parent d9a491a88c
commit 24d8c2265e
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,12 @@
--- nginx-1.2.8/src/http/modules/ngx_http_referer_module.c 2013-05-06 03:27:10.000000000 -0700
+++ nginx-1.2.8-patched/src/http/modules/ngx_http_referer_module.c 2013-05-21 16:04:49.340286168 -0700
@@ -396,8 +396,7 @@ ngx_http_valid_referers(ngx_conf_t *cf,
ngx_str_set(&name, "invalid_referer");
- var = ngx_http_add_variable(cf, &name,
- NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOHASH);
+ var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE);
if (var == NULL) {
return NGX_CONF_ERROR;
}

View File

@ -150,6 +150,10 @@ echo "$info_txt applying patches/nginx-$main_ver-cve-2013-2070.patch for nginx"
patch -p0 < $root/patches/nginx-$main_ver-cve-2013-2070.patch || exit 1
echo
echo "$info_txt applying patches/nginx-$main_ver-invalid_referer_hash.patch for nginx"
patch -p1 < $root/patches/nginx-$main_ver-invalid_referer_hash.patch || exit 1
echo
rm -f *.patch || exit 1
cd .. || exit 1