diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2011-11-01 11:06:31 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2011-11-01 11:06:31 +0000 |
| commit | acde3201b8d1bf7da10df81eecc31ecdb072c70b (patch) | |
| tree | 69f3c98e17a0f16c245f7ca0e879bf888286c9ed | |
| parent | 116e15f03aec385367706aeb3888ff6291cde7b5 (diff) | |
| download | nginx-acde3201b8d1bf7da10df81eecc31ecdb072c70b.tar.gz nginx-acde3201b8d1bf7da10df81eecc31ecdb072c70b.tar.bz2 | |
Merging r3992, r4192:
access_log related fixes:
*) Removal of error message about %name log_format parameters,
they have been deleted long ago in 0.5.0-RELEASE.
*) Improved access log escaping to better protect other software.
Some character sets (notably ISO-8859-1) have C1 control characters in
upper half, make sure to escape them.
| -rw-r--r-- | src/http/modules/ngx_http_log_module.c | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/src/http/modules/ngx_http_log_module.c b/src/http/modules/ngx_http_log_module.c index e6a7fdbbf..fee717123 100644 --- a/src/http/modules/ngx_http_log_module.c +++ b/src/http/modules/ngx_http_log_module.c @@ -690,12 +690,12 @@ ngx_http_log_escape(u_char *dst, u_char *src, size_t size) 0x10000000, /* 0001 0000 0000 0000 0000 0000 0000 0000 */ /* ~}| {zyx wvut srqp onml kjih gfed cba` */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ + 0x80000000, /* 1000 0000 0000 0000 0000 0000 0000 0000 */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ + 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ + 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ + 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ + 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ }; @@ -1055,25 +1055,6 @@ ngx_http_log_compile_format(ngx_conf_t *cf, ngx_array_t *flushes, for ( /* void */ ; s < args->nelts; s++) { - for (i = 0; i < value[s].len; i++) { - if (value[s].data[i] != '%') { - continue; - } - - ch = value[s].data[i + 1]; - - if ((ch >= 'A' && ch <= 'Z') - || (ch >= 'a' && ch <= 'z') - || ch == '{') - { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "the parameters in the \"%%name\" form are not supported, " - "use the \"$variable\" instead"); - - return NGX_CONF_ERROR; - } - } - i = 0; while (i < value[s].len) { |
