[GH-ISSUE #119] ngx_waf編譯時,沒有適配最新的 libinjection #93

Closed
opened 2026-03-04 12:18:52 +03:00 by kerem · 7 comments
Owner

Originally created by @jeromeleong on GitHub (Jan 9, 2023).
Original GitHub issue: https://github.com/ADD-SP/ngx_waf/issues/119

主要是在是libinjection的libinjection_sqli.c出現錯誤
我之後改用了10月的libinjection才沒有出現錯誤

fatal error: version.h: No such file or directory
Originally created by @jeromeleong on GitHub (Jan 9, 2023). Original GitHub issue: https://github.com/ADD-SP/ngx_waf/issues/119 主要是在是[libinjection的libinjection_sqli.c](https://github.com/libinjection/libinjection/blob/main/src/libinjection_sqli.c)出現錯誤 我之後改用了10月的[libinjection](https://github.com/libinjection/libinjection/tree/f994d3301fb545d09f4a4d24788a715faebea3e6)才沒有出現錯誤 ``` shell fatal error: version.h: No such file or directory ```
kerem closed this issue 2026-03-04 12:18:52 +03:00
Author
Owner

@dne1203 commented on GitHub (Jun 25, 2023):

我似乎遇到了類似的問題,請問您怎麽解決的
cc -c -fPIC -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -fstack-protector-strong -Wno-sign-compare -I src/core -I src/event -I src/event/modules -I src/event/quic -I src/os/unix -I /usr/local/src/ngx_waf/inc -I /usr/local/src/uthash/include -I /usr/local/src/ngx_waf/inc/libinjection/src -I objs -I src/http -I src/http/modules
-o objs/addon/src/libinjection_sqli.o
/usr/local/src/ngx_waf/inc/libinjection/src/libinjection_sqli.c
/usr/local/src/ngx_waf/inc/libinjection/src/libinjection_sqli.c: In function libinjection_version’:
/usr/local/src/ngx_waf/inc/libinjection/src/libinjection_sqli.c:1213:12: error: ‘LIBINJECTION_VERSION’ undeclared (first use in this function); did you mean ‘LIBINJECTION_SQLI_H’?
1213 | return LIBINJECTION_VERSION;
| ^~~~~~~~~~~~~~~~~~~~
| LIBINJECTION_SQLI_H
/usr/local/src/ngx_waf/inc/libinjection/src/libinjection_sqli.c:1213:12: note: each undeclared identifier is reported only once for each function it appears in
/usr/local/src/ngx_waf/inc/libinjection/src/libinjection_sqli.c:1214:1: error: control reaches end of non-void function [-Werror=return-type]
1214 | }
| ^
cc1: all warnings being treated as errors
make[1]: *** [objs/Makefile:1349: objs/addon/src/libinjection_sqli.o] Error 1
make[1]: Leaving directory '/usr/local/src/nginx-1.25.1'
make: *** [Makefile:10: build] Error 2

<!-- gh-comment-id:1605955761 --> @dne1203 commented on GitHub (Jun 25, 2023): 我似乎遇到了類似的問題,請問您怎麽解決的 cc -c -fPIC -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -fstack-protector-strong -Wno-sign-compare -I src/core -I src/event -I src/event/modules -I src/event/quic -I src/os/unix -I /usr/local/src/ngx_waf/inc -I /usr/local/src/uthash/include -I /usr/local/src/ngx_waf/inc/libinjection/src -I objs -I src/http -I src/http/modules \ -o objs/addon/src/libinjection_sqli.o \ /usr/local/src/ngx_waf/inc/libinjection/src/libinjection_sqli.c /usr/local/src/ngx_waf/inc/libinjection/src/libinjection_sqli.c: In function libinjection_version’: /usr/local/src/ngx_waf/inc/libinjection/src/libinjection_sqli.c:1213:12: error: ‘LIBINJECTION_VERSION’ undeclared (first use in this function); did you mean ‘LIBINJECTION_SQLI_H’? 1213 | return LIBINJECTION_VERSION; | ^~~~~~~~~~~~~~~~~~~~ | LIBINJECTION_SQLI_H /usr/local/src/ngx_waf/inc/libinjection/src/libinjection_sqli.c:1213:12: note: each undeclared identifier is reported only once for each function it appears in /usr/local/src/ngx_waf/inc/libinjection/src/libinjection_sqli.c:1214:1: error: control reaches end of non-void function [-Werror=return-type] 1214 | } | ^ cc1: all warnings being treated as errors make[1]: *** [objs/Makefile:1349: objs/addon/src/libinjection_sqli.o] Error 1 make[1]: Leaving directory '/usr/local/src/nginx-1.25.1' make: *** [Makefile:10: build] Error 2
Author
Owner

@liang-hiwin commented on GitHub (Jul 24, 2023):

您的意思是“LIBINJECTION_SQLI_H”吗? 1213 | 1213 返回 LIBINJECTION_VERSION; | ^~~~~~~~~~~~~~~~~~~~ | LIBINJECTION_SQLI_H /usr/local/src/ngx_waf/inc/libinjection/src/libinjection_sqli.c:1213:12:注意:每个未声明的标识符对于出现在 /usr/local/src/ngx_waf/inc/libinjection/src/libinjection_sqli.c:1214:1 中的每个函数仅报告一次: 错误:控制到达非 void 函数的末尾 1214 | [-Werror=返回类型] } | ^ cc1:所有警告均被视为错误 make[1]: *** [objs/Makefile:1349: objs/addon/src/libinjection_sqli.o] 错误 1 ​​make[ 1]: 离开目录 '/usr/local/src/nginx-1.25.1' make: *** [Makefile:10: build] 错误 2

根据一楼的方法可以解决,具体看截图,找到1的文件,将3的代码改为2,

即1198行代码改为 const char* libinjection_version()

替换这个文件就好了,路径在/xxx/ngx_waf/inc/libinjection/src/

libinjection_sqli.zip

<!-- gh-comment-id:1648170948 --> @liang-hiwin commented on GitHub (Jul 24, 2023): > 您的意思是“LIBINJECTION_SQLI_H”吗? 1213 | 1213 返回 LIBINJECTION_VERSION; | ^~~~~~~~~~~~~~~~~~~~ | LIBINJECTION_SQLI_H /usr/local/src/ngx_waf/inc/libinjection/src/libinjection_sqli.c:1213:12:注意:每个未声明的标识符对于出现在 /usr/local/src/ngx_waf/inc/libinjection/src/libinjection_sqli.c:1214:1 中的每个函数仅报告一次: 错误:控制到达非 void 函数的末尾 1214 | [-Werror=返回类型] } | ^ cc1:所有警告均被视为错误 make[1]: *** [objs/Makefile:1349: objs/addon/src/libinjection_sqli.o] 错误 1 ​​make[ 1]: 离开目录 '/usr/local/src/nginx-1.25.1' make: *** [Makefile:10: build] 错误 2 根据一楼的方法可以解决,具体看截图,找到1的文件,将3的代码改为2, 即1198行代码改为 const char* libinjection_version() 替换这个文件就好了,路径在/xxx/ngx_waf/inc/libinjection/src/ [libinjection_sqli.zip](https://github.com/ADD-SP/ngx_waf/files/12208653/libinjection_sqli.zip)
Author
Owner

@2837linlinlin commented on GitHub (Nov 10, 2023):

这个问题还没修复吗

<!-- gh-comment-id:1805515128 --> @2837linlinlin commented on GitHub (Nov 10, 2023): 这个问题还没修复吗
Author
Owner

@ADD-SP commented on GitHub (Nov 12, 2023):

@2837linlinlin 为什么一翻邮件就有人拷打我(

<!-- gh-comment-id:1807007451 --> @ADD-SP commented on GitHub (Nov 12, 2023): @2837linlinlin 为什么一翻邮件就有人拷打我(
Author
Owner

@osevan commented on GitHub (Dec 27, 2024):

https://github.com/libinjection/libinjection/blob/main/src/libinjection_sqli.c

libinjection code is different now..

we need full working code on par with latest libinjection repository , else nginx doesnt compile.

nginx compile only with above code posted inside zip.

could you update new libinjection_sqli.c file?

i can replace above file, but , this is not actual state of libinjection_sqli.c

<!-- gh-comment-id:2563827462 --> @osevan commented on GitHub (Dec 27, 2024): https://github.com/libinjection/libinjection/blob/main/src/libinjection_sqli.c libinjection code is different now.. we need full working code on par with latest libinjection repository , else nginx doesnt compile. nginx compile only with above code posted inside zip. could you update new libinjection_sqli.c file? i can replace above file, but , this is not actual state of libinjection_sqli.c
Author
Owner

@ADD-SP commented on GitHub (Jan 25, 2025):

This issue has been fixed in LTS version (v6.1.10). Fixes for current version is coming soon.


此问题已经在 LTS 版本修复,current 版本的修复也正在进行。

<!-- gh-comment-id:2613748824 --> @ADD-SP commented on GitHub (Jan 25, 2025): This issue has been fixed in `LTS` version (v6.1.10). Fixes for `current` version is coming soon. *** 此问题已经在 LTS 版本修复,`current` 版本的修复也正在进行。
Author
Owner

@ADD-SP commented on GitHub (Jan 25, 2025):

This issues doesn't exists in the current version, closed this issue.

<!-- gh-comment-id:2613767350 --> @ADD-SP commented on GitHub (Jan 25, 2025): This issues doesn't exists in the `current` version, closed this issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ngx_waf#93
No description provided.