File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -414,6 +414,21 @@ Include /etc/nginx/owasp-modsecurity-crs/rules/RESPONSE-980-CORRELATION.conf
414414Include /etc/nginx/owasp-modsecurity-crs/rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf
415415" > /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf
416416
417+ # NGINX compiles a small test program to check if an added module works as expected.
418+ #
419+ # ModSecurity-nginx provides 'printf("hello");' as a test, but newer versions of GCC,
420+ # as included in Alpine 3.21, do not allow implicit declaration of function 'printf':
421+ #
422+ # objs/autotest.c:7:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
423+ #
424+ # For this reason we replace 'printf("hello");' by 'msc_init();', which is always available.
425+ #
426+ # This fix is taken from a PR, that has been proposed to the ModSecurity-nginx project:
427+ #
428+ # https://github.com/owasp-modsecurity/ModSecurity-nginx/pull/275
429+ #
430+ sed -i " s/ngx_feature_test='printf(\" hello\" );'/ngx_feature_test='msc_init();'/" $BUILD_PATH /ModSecurity-nginx/config
431+
417432# build nginx
418433cd " $BUILD_PATH /nginx-$NGINX_VERSION "
419434
You can’t perform that action at this time.
0 commit comments