Skip to content

Needs to include stdio.h in nginx/auto/feature for this to work #265

Open
@kzcabstone

Description

@kzcabstone

https://github.com/SpiderLabs/ModSecurity-nginx/blob/2497e6ac654d0b117b9534aa735b757c6b11c84f/config#L15

nginx src version: 1.20.2

When I was trying to compile the nginx connector module, nginx configure was complaining about libmodsecurity not found. Command line I was using:

./configure --with-http_ssl_module --with-threads  --with-compat --add-dynamic-module=/usr/local/opt/ModSecurity-nginx/

I checked nginx/objs/autoconf.err and this is in it

----------------------------------------
checking for ModSecurity library in "/usr/local/opt/ModSecurity/src/.libs/" and "/usr/local/opt/ModSecurity/headers/" (specified by the MODSECURITY_LIB and MODSECURITY_INC env)

objs/autotest.c:6:5: error: implicitly declaring library function 'printf' with type 'int (const char *, ...)' [-Werror,-Wimplicit-function-declaration]
    printf("hello");;
    ^
objs/autotest.c:6:5: note: include the header <stdio.h> or explicitly provide a declaration for 'printf'
1 error generated.
----------
#include <sys/types.h>
#include <unistd.h>
#include <modsecurity/modsecurity.h>

int main(void) {
    printf("hello");;
    return 0;
}

So I think you need to either set $NGX_INCLUDE_UNISTD_H or not use printf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions