stnoonan / spnego-http-auth-nginx-module

SPNEGO HTTP Authentication Module for nginx
Other
276 stars 112 forks source link

Broken build after #105 was merged #120

Closed jankonas closed 2 years ago

jankonas commented 2 years ago

Hello, when building nginx (v1.18.0) with this module build fails with following error:

spnego-http-auth-nginx-module/ngx_http_auth_spnego_module.c: In function 'ngx_spnego_authorized_principal':
spnego-http-auth-nginx-module/ngx_http_auth_spnego_module.c:635:9: error: 'for' loop initial declarations are only allowed in C99 mode
         for(size_t i = 0; i < alcf->auth_princs->nelts; i++) {
        ^
spnego-http-auth-nginx-module/ngx_http_auth_spnego_module.c:635:9: note: use option -std=c99 or -std=gnu99 to compile your code
make[1]: *** [objs/addon/spnego-http-auth-nginx-module/ngx_http_auth_spnego_module.o] Error 1

Build means this commands:

cd sources/nginx-1.18.0
git clone https://github.com/stnoonan/spnego-http-auth-nginx-module.git
./configure --prefix=/some/prefix/dir --user=web --group=web --with-http_ssl_module --with-http_v2_module --with-threads --with-file-aio --add-module=spnego-http-auth-nginx-module
make

Should I add some option to use C99 mode or is it a bug in this module? Or would upgrading to latest nginx help? Thank you for any hints :-)

wolfrubin commented 2 years ago

I am seeing the same issue with nginx v1.21.4 on CentOS 7.4

likvidon commented 2 years ago

I have this problem too, nginx 1.10.3, debian 9. @jankonas you need try to downgrade your version of nginx according to the requirements - "Nginx 1.2 through 1.7" or rebase commit to previous

stnoonan commented 2 years ago

Should be fixed. PTAL and reopen if you're still having issues.

Do not downgrade your version of nginx to fix this; that would be silly.

You could upgrade your OS and use a compiler that defaults to a newer standard though :-).