Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngx_waf編譯時,沒有適配最新的 libinjection #119

Open
jeromeleong opened this issue Jan 9, 2023 · 4 comments
Open

ngx_waf編譯時,沒有適配最新的 libinjection #119

jeromeleong opened this issue Jan 9, 2023 · 4 comments

Comments

@jeromeleong
Copy link

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

fatal error: version.h: No such file or directory
@dne1203
Copy link

dne1203 commented 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

@liang-hiwin
Copy link

liang-hiwin commented 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

@2837linlinlin
Copy link

这个问题还没修复吗

@ADD-SP
Copy link
Owner

ADD-SP commented Nov 12, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants