From f74611640b76a798cdedcc3fa1147b69eaac969f Mon Sep 17 00:00:00 2001 From: Giovanni <561184+wargio@users.noreply.github.com> Date: Wed, 11 Oct 2023 11:00:06 +0800 Subject: [PATCH] Update libinjection and bump version to 1.6 (#104) * Version 1.6 * Updated libinjection to 4aa3894 * Fix formatting. --- .github/workflows/distros.yaml | 6 +- .github/workflows/linter.yml | 10 +-- distros/alpine/1.18.0-r13/APKBUILD | 2 +- distros/alpine/1.18.0-r15/APKBUILD | 2 +- distros/alpine/1.20.1-r3/APKBUILD | 2 +- distros/alpine/1.20.2-r0/APKBUILD | 2 +- distros/alpine/1.20.2-r1/APKBUILD | 2 +- distros/alpine/1.22.0-r1/APKBUILD | 2 +- distros/alpine/1.22.1-r0/APKBUILD | 2 +- distros/alpine/1.24.0-r3/APKBUILD | 2 +- distros/alpine/1.24.0-r6/APKBUILD | 2 +- distros/arch/PKGBUILD | 2 +- naxsi_src/libinjection | 2 +- naxsi_src/naxsi_const.h | 2 +- naxsi_src/naxsi_json.c | 8 +-- naxsi_src/naxsi_runtime.c | 18 +++--- naxsi_src/naxsi_skeleton.c | 100 ++++++++++++++--------------- naxsi_src/naxsi_windows.h | 2 +- 18 files changed, 84 insertions(+), 84 deletions(-) diff --git a/.github/workflows/distros.yaml b/.github/workflows/distros.yaml index b93ef36..98a7214 100644 --- a/.github/workflows/distros.yaml +++ b/.github/workflows/distros.yaml @@ -39,6 +39,7 @@ jobs: echo RELEASE_NAME="naxsi-${RELEASE_ID}-src-with-deps-tgz" >> $GITHUB_ENV export TARNAME="naxsi-${RELEASE_ID}-src-with-deps.tar.gz" touch "$TARNAME" + rm -rf .git tar --exclude="$TARNAME" -czvf "$TARNAME" . - name: Upload tarball uses: actions/upload-artifact@v3 @@ -66,6 +67,7 @@ jobs: fi RELEASE_ID=${RELEASE_ID##refs/tags/} echo RELEASE_NAME="naxsi-${RELEASE_ID}-src-with-deps-zip" >> $GITHUB_ENV + rm -rf .git - name: Upload zip uses: actions/upload-artifact@v3 with: @@ -137,7 +139,7 @@ jobs: run: | rm -rf naxsi_src/libinjection git clone https://github.com/libinjection/libinjection.git naxsi_src/libinjection - git -C naxsi_src/libinjection checkout 51f3a96e9fcc90a6112f52ac96fd4661e7ab0a44 + git -C naxsi_src/libinjection checkout 4aa3894b21d03d9d8fc364505c0617d2aca73fc1 chmod 777 . - name: ${{ matrix.name }} package if: matrix.package == 'apk' @@ -191,7 +193,7 @@ jobs: run: | rm -rf naxsi_src/libinjection git clone https://github.com/libinjection/libinjection.git naxsi_src/libinjection - git -C naxsi_src/libinjection checkout 51f3a96e9fcc90a6112f52ac96fd4661e7ab0a44 + git -C naxsi_src/libinjection checkout 4aa3894b21d03d9d8fc364505c0617d2aca73fc1 git clone --depth=1 https://github.com/wargio/deb-creator.git chmod 777 . apt-get source nginx diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 5a642cd..526cfe2 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -49,12 +49,12 @@ jobs: uses: actions/checkout@v3 - name: Install wget, software-properties-common, lsb-release (dependencies of LLVM install script) run: sudo apt --assume-yes install wget software-properties-common lsb-release - - name: Install automatic LLVM 13 - run: wget https://apt.llvm.org/llvm.sh -O /tmp/llvm-install.sh; chmod +x /tmp/llvm-install.sh; sudo /tmp/llvm-install.sh 13 - - name: Install clang-format-13 - run: sudo apt --assume-yes install clang-format-13 + - name: Install automatic LLVM 16 + run: wget https://apt.llvm.org/llvm.sh -O /tmp/llvm-install.sh; chmod +x /tmp/llvm-install.sh; sudo /tmp/llvm-install.sh 16 + - name: Install clang-format-16 + run: sudo apt --assume-yes install clang-format-16 - name: Format check - run: find naxsi_src/ -type f -name "*.c" -o -name "*.h" | grep -v "libinjection" | xargs -I % clang-format --verbose --dry-run % + run: find naxsi_src/ -type f -name "*.c" -o -name "*.h" | grep -v "libinjection" | xargs -I % clang-format --verbose --Werror --dry-run % rules: runs-on: ubuntu-latest diff --git a/distros/alpine/1.18.0-r13/APKBUILD b/distros/alpine/1.18.0-r13/APKBUILD index f64ac13..687d959 100644 --- a/distros/alpine/1.18.0-r13/APKBUILD +++ b/distros/alpine/1.18.0-r13/APKBUILD @@ -61,7 +61,7 @@ _add_module() { subpackages="$subpackages $pkgname-mod-$name:_module" } -_add_module "http-naxsi" "1.5" "https://github.com/wargio/naxsi" "naxsi_src" +_add_module "http-naxsi" "1.6" "https://github.com/wargio/naxsi" "naxsi_src" _naxsi_provides="$pkgname-naxsi" # for backward compatibility prepare() { diff --git a/distros/alpine/1.18.0-r15/APKBUILD b/distros/alpine/1.18.0-r15/APKBUILD index 65c757f..b0a2df1 100644 --- a/distros/alpine/1.18.0-r15/APKBUILD +++ b/distros/alpine/1.18.0-r15/APKBUILD @@ -62,7 +62,7 @@ _add_module() { subpackages="$subpackages $pkgname-mod-$name:_module" } -_add_module "http-naxsi" "1.5" "https://github.com/wargio/naxsi" "naxsi_src" +_add_module "http-naxsi" "1.6" "https://github.com/wargio/naxsi" "naxsi_src" _naxsi_provides="$pkgname-naxsi" # for backward compatibility prepare() { diff --git a/distros/alpine/1.20.1-r3/APKBUILD b/distros/alpine/1.20.1-r3/APKBUILD index 1038f67..a1f3e7d 100644 --- a/distros/alpine/1.20.1-r3/APKBUILD +++ b/distros/alpine/1.20.1-r3/APKBUILD @@ -62,7 +62,7 @@ _add_module() { subpackages="$subpackages $pkgname-mod-$name:_module" } -_add_module "http-naxsi" "1.5" "https://github.com/wargio/naxsi" "naxsi_src" +_add_module "http-naxsi" "1.6" "https://github.com/wargio/naxsi" "naxsi_src" _naxsi_provides="$pkgname-naxsi" # for backward compatibility prepare() { diff --git a/distros/alpine/1.20.2-r0/APKBUILD b/distros/alpine/1.20.2-r0/APKBUILD index 56e68af..75509a4 100644 --- a/distros/alpine/1.20.2-r0/APKBUILD +++ b/distros/alpine/1.20.2-r0/APKBUILD @@ -62,7 +62,7 @@ _add_module() { subpackages="$subpackages $pkgname-mod-$name:_module" } -_add_module "http-naxsi" "1.5" "https://github.com/wargio/naxsi" "naxsi_src" +_add_module "http-naxsi" "1.6" "https://github.com/wargio/naxsi" "naxsi_src" _naxsi_provides="$pkgname-naxsi" # for backward compatibility prepare() { diff --git a/distros/alpine/1.20.2-r1/APKBUILD b/distros/alpine/1.20.2-r1/APKBUILD index b42c031..511ee1d 100644 --- a/distros/alpine/1.20.2-r1/APKBUILD +++ b/distros/alpine/1.20.2-r1/APKBUILD @@ -63,7 +63,7 @@ _add_module() { subpackages="$subpackages $pkgname-mod-$name:_module" } -_add_module "http-naxsi" "1.5" "https://github.com/wargio/naxsi" "naxsi_src" +_add_module "http-naxsi" "1.6" "https://github.com/wargio/naxsi" "naxsi_src" _naxsi_provides="$pkgname-naxsi" # for backward compatibility prepare() { diff --git a/distros/alpine/1.22.0-r1/APKBUILD b/distros/alpine/1.22.0-r1/APKBUILD index 832d5e7..6adc444 100644 --- a/distros/alpine/1.22.0-r1/APKBUILD +++ b/distros/alpine/1.22.0-r1/APKBUILD @@ -62,7 +62,7 @@ _add_module() { subpackages="$subpackages $pkgname-mod-$name:_module" } -_add_module "http-naxsi" "1.5" "https://github.com/wargio/naxsi" "naxsi_src" +_add_module "http-naxsi" "1.6" "https://github.com/wargio/naxsi" "naxsi_src" _naxsi_provides="$pkgname-naxsi" # for backward compatibility prepare() { diff --git a/distros/alpine/1.22.1-r0/APKBUILD b/distros/alpine/1.22.1-r0/APKBUILD index 8b3baab..7f783e4 100644 --- a/distros/alpine/1.22.1-r0/APKBUILD +++ b/distros/alpine/1.22.1-r0/APKBUILD @@ -62,7 +62,7 @@ _add_module() { subpackages="$subpackages $pkgname-mod-$name:_module" } -_add_module "http-naxsi" "1.5" "https://github.com/wargio/naxsi" "naxsi_src" +_add_module "http-naxsi" "1.6" "https://github.com/wargio/naxsi" "naxsi_src" _naxsi_provides="$pkgname-naxsi" # for backward compatibility prepare() { diff --git a/distros/alpine/1.24.0-r3/APKBUILD b/distros/alpine/1.24.0-r3/APKBUILD index 7292dd8..bd9be6f 100644 --- a/distros/alpine/1.24.0-r3/APKBUILD +++ b/distros/alpine/1.24.0-r3/APKBUILD @@ -64,7 +64,7 @@ _add_module() { subpackages="$subpackages $pkgname-mod-$name:_module" } -_add_module "http-naxsi" "1.5" "https://github.com/wargio/naxsi" "naxsi_src" +_add_module "http-naxsi" "1.6" "https://github.com/wargio/naxsi" "naxsi_src" _naxsi_provides="$pkgname-naxsi" # for backward compatibility prepare() { diff --git a/distros/alpine/1.24.0-r6/APKBUILD b/distros/alpine/1.24.0-r6/APKBUILD index dd7a248..bd38ac5 100644 --- a/distros/alpine/1.24.0-r6/APKBUILD +++ b/distros/alpine/1.24.0-r6/APKBUILD @@ -64,7 +64,7 @@ _add_module() { subpackages="$subpackages $pkgname-mod-$name:_module" } -_add_module "http-naxsi" "1.5" "https://github.com/wargio/naxsi" "naxsi_src" +_add_module "http-naxsi" "1.6" "https://github.com/wargio/naxsi" "naxsi_src" _naxsi_provides="$pkgname-naxsi" # for backward compatibility prepare() { diff --git a/distros/arch/PKGBUILD b/distros/arch/PKGBUILD index e8be9eb..f3d772e 100644 --- a/distros/arch/PKGBUILD +++ b/distros/arch/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Giovanni Dante (deroad) Grazioli pkgname=nginx-mod-naxsi-git -pkgver=1.5 +pkgver=1.6 pkgrel=1 epoch=1 _modname=naxsi diff --git a/naxsi_src/libinjection b/naxsi_src/libinjection index 51f3a96..4aa3894 160000 --- a/naxsi_src/libinjection +++ b/naxsi_src/libinjection @@ -1 +1 @@ -Subproject commit 51f3a96e9fcc90a6112f52ac96fd4661e7ab0a44 +Subproject commit 4aa3894b21d03d9d8fc364505c0617d2aca73fc1 diff --git a/naxsi_src/naxsi_const.h b/naxsi_src/naxsi_const.h index 22735eb..06f633e 100644 --- a/naxsi_src/naxsi_const.h +++ b/naxsi_src/naxsi_const.h @@ -4,7 +4,7 @@ #ifndef NAXSI_CONST_H #define NAXSI_CONST_H -#define NAXSI_VERSION "1.5" +#define NAXSI_VERSION "1.6" #define NAXSI_REQUEST_ID_SIZE 16 #define NAXSI_REQUEST_ID_STRLEN ((NAXSI_REQUEST_ID_SIZE << 1) + 1) diff --git a/naxsi_src/naxsi_json.c b/naxsi_src/naxsi_json.c index a5ee7ea..f185383 100644 --- a/naxsi_src/naxsi_json.c +++ b/naxsi_src/naxsi_json.c @@ -10,8 +10,6 @@ extern ngx_http_rule_t nx_int__invalid_json; #define json_char(x) ((x)->src + (x)->off) -//#define _debug_json 1 - ngx_int_t ngx_http_nx_json_forward(ngx_json_t* js) { @@ -146,9 +144,9 @@ ngx_http_nx_json_val(ngx_json_t* js) if ((js->c >= '0' && js->c <= '9') || js->c == '-') { val.data = js->src + js->off; while (((*(js->src + js->off) >= '0' && *(js->src + js->off) <= '9') || - *(js->src + js->off) == '.' || - *(js->src + js->off) == '+' || *(js->src + js->off) == '-' || - *(js->src + js->off) == 'e' || *(js->src + js->off) == 'E') && + *(js->src + js->off) == '.' || *(js->src + js->off) == '+' || + *(js->src + js->off) == '-' || *(js->src + js->off) == 'e' || + *(js->src + js->off) == 'E') && js->off < js->len) { val.len++; js->off++; diff --git a/naxsi_src/naxsi_runtime.c b/naxsi_src/naxsi_runtime.c index b8de9b4..9e3fc79 100644 --- a/naxsi_src/naxsi_runtime.c +++ b/naxsi_src/naxsi_runtime.c @@ -16,6 +16,7 @@ ** rules at any time ;) */ +// clang-format off #define InternalRule(var_name, rule_id, block, drop) \ ngx_http_rule_t var_name = { \ /*type*/ 0, /*whitelist flag*/ 0, \ @@ -41,6 +42,7 @@ InternalRule(nx_int__libinject_xss, 18, 1, 0); InternalRule(nx_int__no_rules, 19, 0, 1); InternalRule(nx_int__bad_utf8, 20, 0, 1); InternalRule(nx_int__illegal_host_header, 21, 0, 1); +// clang-format on #define naxsi_error_fatal(ctx, r, ...) \ do { \ @@ -2912,14 +2914,14 @@ ngx_http_naxsi_update_current_ctx_status(ngx_http_request_ctx_t* ctx, NX_DEBUG(_debug_custom_score, NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "XX-custom check rules"); if (!ctx->ignore && (cf->ignore_ips || cf->ignore_cidrs)) { - ngx_str_t* ip = &r->connection->addr_text; - NX_DEBUG(_debug_whitelist_ignore, - NGX_LOG_DEBUG_HTTP, - r->connection->log, - 0, - "XX- lookup ignore client ip: %V", - ip); - ctx->ignore = naxsi_can_ignore_ip(ip, cf) || naxsi_can_ignore_cidr(ip, cf); + ngx_str_t* ip = &r->connection->addr_text; + NX_DEBUG(_debug_whitelist_ignore, + NGX_LOG_DEBUG_HTTP, + r->connection->log, + 0, + "XX- lookup ignore client ip: %V", + ip); + ctx->ignore = naxsi_can_ignore_ip(ip, cf) || naxsi_can_ignore_cidr(ip, cf); } if (cf->check_rules && ctx->special_scores) { diff --git a/naxsi_src/naxsi_skeleton.c b/naxsi_src/naxsi_skeleton.c index 48ccea8..3a636b0 100644 --- a/naxsi_src/naxsi_skeleton.c +++ b/naxsi_src/naxsi_skeleton.c @@ -34,7 +34,7 @@ "Naxsi-Config : Incorrect line %V %V (%s:%d)...", \ &(value[0]), \ &(value[1]), \ - NAXSI_FILENAME, \ + NAXSI_FILENAME, \ __LINE__); \ } while (0) @@ -487,12 +487,12 @@ ngx_http_naxsi_create_loc_conf(ngx_conf_t* cf) static ngx_int_t ngx_http_naxsi_push_loc_conf(ngx_conf_t* cf, ngx_http_naxsi_loc_conf_t* conf) { - ngx_http_naxsi_loc_conf_t **bar; + ngx_http_naxsi_loc_conf_t** bar; ngx_http_naxsi_main_conf_t* main_cf; if (!conf->pushed) { main_cf = ngx_http_conf_get_module_main_conf(cf, ngx_http_naxsi_module); - bar = ngx_array_push(main_cf->locations); + bar = ngx_array_push(main_cf->locations); if (!bar) return (NGX_ERROR); *bar = conf; @@ -694,10 +694,10 @@ ngx_http_naxsi_init(ngx_conf_t* cf) static char* ngx_http_naxsi_br_loc_conf(ngx_conf_t* cf, ngx_command_t* cmd, void* conf) { - ngx_http_naxsi_loc_conf_t *alcf = conf; + ngx_http_naxsi_loc_conf_t* alcf = conf; - ngx_str_t* value; - ngx_http_rule_t rule, *rule_r; + ngx_str_t* value; + ngx_http_rule_t rule, *rule_r; #ifdef _debug_readconf if (cf) { @@ -710,7 +710,7 @@ ngx_http_naxsi_br_loc_conf(ngx_conf_t* cf, ngx_command_t* cmd, void* conf) return (NGX_CONF_ERROR); /* LCOV_EXCL_LINE */ } - value = cf->args->elts; + value = cf->args->elts; /* ** if it's a basic rule @@ -824,16 +824,16 @@ static char* ngx_http_naxsi_cr_loc_conf(ngx_conf_t* cf, ngx_command_t* cmd, void* conf) { - ngx_http_naxsi_loc_conf_t * alcf = conf; - ngx_str_t* value; - ngx_http_check_rule_t* rule_c; - unsigned int i; - u_char* var_end; + ngx_http_naxsi_loc_conf_t* alcf = conf; + ngx_str_t* value; + ngx_http_check_rule_t* rule_c; + unsigned int i; + u_char* var_end; if (!alcf || !cf) return (NGX_CONF_ERROR); - value = cf->args->elts; + value = cf->args->elts; if (ngx_strcmp(value[0].data, TOP_CHECK_RULE_T) && ngx_strcmp(value[0].data, TOP_CHECK_RULE_N)) return (NGX_CONF_ERROR); @@ -929,13 +929,13 @@ ngx_http_naxsi_cr_loc_conf(ngx_conf_t* cf, ngx_command_t* cmd, void* conf) static char* ngx_http_naxsi_ud_loc_conf(ngx_conf_t* cf, ngx_command_t* cmd, void* conf) { - ngx_http_naxsi_loc_conf_t * alcf = conf; - ngx_str_t* value; + ngx_http_naxsi_loc_conf_t* alcf = conf; + ngx_str_t* value; if (!alcf || !cf) return (NGX_CONF_ERROR); /* LCOV_EXCL_LINE */ - value = cf->args->elts; + value = cf->args->elts; /* store denied URL for location */ if ((!ngx_strcmp(value[0].data, TOP_DENIED_URL_N) || @@ -964,35 +964,34 @@ ngx_http_naxsi_ud_loc_conf(ngx_conf_t* cf, ngx_command_t* cmd, void* conf) static ngx_int_t ngx_http_naxsi_add_ii_loc_conf(ngx_conf_t* cf, ngx_http_naxsi_loc_conf_t* conf, char* ip_str) { - ngx_str_t key; + ngx_str_t key; - key.len = strlen(ip_str); - key.data = (unsigned char*)ngx_pcalloc(cf->pool, key.len); - if (!key.data) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "cannot allocate memory"); - return (NGX_ERROR); - } - memcpy(key.data, ip_str, key.len); + key.len = strlen(ip_str); + key.data = (unsigned char*)ngx_pcalloc(cf->pool, key.len); + if (!key.data) { + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "cannot allocate memory"); + return (NGX_ERROR); + } + memcpy(key.data, ip_str, key.len); + if (!conf->ignore_ips) { + conf->ignore_ips = (ngx_hash_t*)ngx_pcalloc(cf->pool, sizeof(ngx_hash_t)); if (!conf->ignore_ips) { - conf->ignore_ips = (ngx_hash_t*)ngx_pcalloc(cf->pool, sizeof(ngx_hash_t)); - if (!conf->ignore_ips) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "IPs hashtable alloc failed"); - return (NGX_ERROR); - } - conf->ignore_ips_ha.pool = cf->pool; - conf->ignore_ips_ha.temp_pool = cf->temp_pool; - if (ngx_hash_keys_array_init(&conf->ignore_ips_ha, NGX_HASH_SMALL) != NGX_OK) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "IPs hash keys init failed"); - return (NGX_ERROR); - } + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "IPs hashtable alloc failed"); + return (NGX_ERROR); } - if (ngx_hash_add_key(&conf->ignore_ips_ha, &key, (void*)1234, NGX_HASH_READONLY_KEY) != - NGX_OK) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "cannot add hash value"); + conf->ignore_ips_ha.pool = cf->pool; + conf->ignore_ips_ha.temp_pool = cf->temp_pool; + if (ngx_hash_keys_array_init(&conf->ignore_ips_ha, NGX_HASH_SMALL) != NGX_OK) { + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "IPs hash keys init failed"); return (NGX_ERROR); } - return (NGX_OK); + } + if (ngx_hash_add_key(&conf->ignore_ips_ha, &key, (void*)1234, NGX_HASH_READONLY_KEY) != NGX_OK) { + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "cannot add hash value"); + return (NGX_ERROR); + } + return (NGX_OK); } /* @@ -1001,16 +1000,15 @@ ngx_http_naxsi_add_ii_loc_conf(ngx_conf_t* cf, ngx_http_naxsi_loc_conf_t* conf, static char* ngx_http_naxsi_ii_loc_conf(ngx_conf_t* cf, ngx_command_t* cmd, void* conf) { - ngx_http_naxsi_loc_conf_t * alcf = conf; - ngx_str_t* value; + ngx_http_naxsi_loc_conf_t* alcf = conf; + ngx_str_t* value; if (!alcf || !cf) return (NGX_CONF_ERROR); /* LCOV_EXCL_LINE */ - value = cf->args->elts; + value = cf->args->elts; - if (!ngx_strcmp(value[0].data, TOP_IGNORE_IP_T) || - !ngx_strcmp(value[0].data, TOP_IGNORE_IP_N)) { + if (!ngx_strcmp(value[0].data, TOP_IGNORE_IP_T) || !ngx_strcmp(value[0].data, TOP_IGNORE_IP_N)) { char ip_str[INET6_ADDRSTRLEN + 1] = { 0 }; @@ -1037,13 +1035,13 @@ ngx_http_naxsi_ii_loc_conf(ngx_conf_t* cf, ngx_command_t* cmd, void* conf) static char* ngx_http_naxsi_ic_loc_conf(ngx_conf_t* cf, ngx_command_t* cmd, void* conf) { - ngx_http_naxsi_loc_conf_t * alcf = conf; - ngx_str_t* value; + ngx_http_naxsi_loc_conf_t* alcf = conf; + ngx_str_t* value; if (!alcf || !cf) return (NGX_CONF_ERROR); /* LCOV_EXCL_LINE */ - value = cf->args->elts; + value = cf->args->elts; if (!ngx_strcmp(value[0].data, TOP_IGNORE_CIDR_T) || !ngx_strcmp(value[0].data, TOP_IGNORE_CIDR_N)) { @@ -1056,7 +1054,7 @@ ngx_http_naxsi_ic_loc_conf(ngx_conf_t* cf, ngx_command_t* cmd, void* conf) // add it directly to IgnoreIP list char ip_str[INET6_ADDRSTRLEN + 1] = { 0 }; - size_t orig_len = value[1].len; + size_t orig_len = value[1].len; value[1].len = smask - (const char*)value[1].data; int ret = naxsi_parse_ip(&value[1], NULL, ip_str); @@ -1124,8 +1122,8 @@ ngx_http_naxsi_ic_loc_conf(ngx_conf_t* cf, ngx_command_t* cmd, void* conf) static char* ngx_http_naxsi_flags_loc_conf(ngx_conf_t* cf, ngx_command_t* cmd, void* conf) { - ngx_http_naxsi_loc_conf_t * alcf = conf; - ngx_str_t* value; + ngx_http_naxsi_loc_conf_t* alcf = conf; + ngx_str_t* value; if (!alcf || !cf) return (NGX_CONF_ERROR); @@ -1133,7 +1131,7 @@ ngx_http_naxsi_flags_loc_conf(ngx_conf_t* cf, ngx_command_t* cmd, void* conf) if (ngx_http_naxsi_push_loc_conf(cf, alcf) != NGX_OK) return NGX_CONF_ERROR; - value = cf->args->elts; + value = cf->args->elts; /* it's a flagrule, just a hack to enable/disable mod */ if (!ngx_strcmp(value[0].data, TOP_ENABLED_FLAG_T) || diff --git a/naxsi_src/naxsi_windows.h b/naxsi_src/naxsi_windows.h index a5bf2cd..7ca2e31 100644 --- a/naxsi_src/naxsi_windows.h +++ b/naxsi_src/naxsi_windows.h @@ -13,7 +13,7 @@ gettimeofday(struct timeval* t, void* timezone); // from linux's sys/times.h -//#include +// #include #define __need_clock_t #include