-
Notifications
You must be signed in to change notification settings - Fork 606
naxsi build fails with pcre*2*-enabled nginx-1.21.5: incorrect PCRE_MULTILINE usage #580
Comments
Possibly connected commits:
|
from nginx-devel ML, https://forum.nginx.org/read.php?29,293178,293179#msg-293179 the second issue, above, seems to be the relevant one here. and, "The NAXSI bug mentioned in the second commit needs to be fixed "The" bug refers to incorrect usage of but, afaict, is not yet filed/open as an existing issue here @ naxsi |
same issue.
|
I've tried to compile naxsi 1.3 as module for nginx 1.21.6, and got the error: error: invalid use of incomplete typedef 'ngx_regex_t' {aka 'struct pcre2_real_code_8'} 205 | (tmp_idx < len && (match = pcre_exec(rl->br->rx->regex->code, I found this issue report: Ref: nbs-system#580 then i tried to solve the pcre2 compatibility issue. I've included an helper function that is 'copied' from: https://github.com/nginx/nginx/blob/master/src/core/ngx_regex.c#L393 that it is called in place of 'pcre_exec' when nginx_version >= 1021005 Not sure if this is the best solution, but I managed to build naxsi 1.3 as module for nginx 1.21.6 succesfully, and it seems to work well. I'm not used to develop in C anymore (since 25 years ago, at least!), but I hope that this patch I made can help anybody else.
same issue.
|
same here: make[1]: *** [objs/Makefile:2244: objs/addon/naxsi_src/naxsi_runtime.o] Error 1 |
For what's worth, we are using this patch on Arch to build this module: |
* Fix: use pcre2 when building with nginx >= 1.21.5 I've tried to compile naxsi 1.3 as module for nginx 1.21.6, and got the error: error: invalid use of incomplete typedef 'ngx_regex_t' {aka 'struct pcre2_real_code_8'} 205 | (tmp_idx < len && (match = pcre_exec(rl->br->rx->regex->code, I found this issue report: Ref: #580 then i tried to solve the pcre2 compatibility issue. I've included an helper function that is 'copied' from: https://github.com/nginx/nginx/blob/master/src/core/ngx_regex.c#L393 that it is called in place of 'pcre_exec' when nginx_version >= 1021005 Not sure if this is the best solution, but I managed to build naxsi 1.3 as module for nginx 1.21.6 succesfully, and it seems to work well. I'm not used to develop in C anymore (since 25 years ago, at least!), but I hope that this patch I made can help anybody else. * Added a check for nginx_version >= 1021005 Added a check for nginx_version >= 1021005 to avoid helper function definition on older versions * Use NGX_PCRE2 conditional Update naxsi.h Don't include pcre.h in order for compilation to work both against pcre and pcre2 Fix pcre vs pcre2 compilation Co-authored-by: laluigino <99279306+laluigino@users.noreply.github.com>
* Fix: use pcre2 when building with nginx >= 1.21.5 I've tried to compile naxsi 1.3 as module for nginx 1.21.6, and got the error: error: invalid use of incomplete typedef 'ngx_regex_t' {aka 'struct pcre2_real_code_8'} 205 | (tmp_idx < len && (match = pcre_exec(rl->br->rx->regex->code, I found this issue report: Ref: #580 then i tried to solve the pcre2 compatibility issue. I've included an helper function that is 'copied' from: https://github.com/nginx/nginx/blob/master/src/core/ngx_regex.c#L393 that it is called in place of 'pcre_exec' when nginx_version >= 1021005 Not sure if this is the best solution, but I managed to build naxsi 1.3 as module for nginx 1.21.6 succesfully, and it seems to work well. I'm not used to develop in C anymore (since 25 years ago, at least!), but I hope that this patch I made can help anybody else. * Added a check for nginx_version >= 1021005 Added a check for nginx_version >= 1021005 to avoid helper function definition on older versions * Use NGX_PCRE2 conditional Update naxsi.h Don't include pcre.h in order for compilation to work both against pcre and pcre2 Fix pcre vs pcre2 compilation Co-authored-by: laluigino <99279306+laluigino@users.noreply.github.com>
I do not know why this is still open but it was fixed: wargio/naxsi@9e06c5f |
Hello, Could you please release this fix 👍 ? |
It is fixed: https://github.com/wargio/naxsi |
Sorry, it wasn't clear enough. |
Not going to happen in this repository. |
Building/packaging latest nginx-1.21.5
on Fedora 35, with PCRE2,
and only PCRE2 enabled,
fails,
at,
The text was updated successfully, but these errors were encountered: