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

Compiling issue when adding module #127

Open
Jiahao-Liu-Jeff opened this issue Apr 8, 2022 · 6 comments
Open

Compiling issue when adding module #127

Jiahao-Liu-Jeff opened this issue Apr 8, 2022 · 6 comments

Comments

@Jiahao-Liu-Jeff
Copy link

Here are the error details.

../spnego-http-auth-nginx-module/ngx_http_auth_spnego_module.c:761:9: error: variable 'kcontext' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
if (!delegated_creds.data) {
^~~~~~~~~~~~~~~~~~~~~
../spnego-http-auth-nginx-module/ngx_http_auth_spnego_module.c:838:9: note: uninitialized use occurs here
if (kcontext)
^~~~~~~~
../spnego-http-auth-nginx-module/ngx_http_auth_spnego_module.c:761:5: note: remove the 'if' if its condition is always false
if (!delegated_creds.data) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../spnego-http-auth-nginx-module/ngx_http_auth_spnego_module.c:754:26: note: initialize the variable 'kcontext' to silence this warning
krb5_context kcontext;
^
= NULL
../spnego-http-auth-nginx-module/ngx_http_auth_spnego_module.c:1531:28: error: implicit declaration of function 'gss_localname' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
major_status = gss_localname(&minor_status, client_name, mech_type,
^
2 errors generated.
make[1]: *** [objs/addon/spnego-http-auth-nginx-module/ngx_http_auth_spnego_module.o] Error 1
make: *** [modules] Error 2

@oranki
Copy link

oranki commented Apr 12, 2022

I believe this commit fixes the warnings:
arduent@c58216b

@Jiahao-Liu-Jeff
Copy link
Author

I believe this commit fixes the warnings: arduent@c58216b

Right, this commit fixes the variable warning but compiling error of 'gss_localname' still exist. Thank you for you reply though.

@oranki
Copy link

oranki commented Apr 12, 2022

gss_localname() is included from <gssapi/gssapi_ext.h>, via <gssapi/gssapi_krb5.h>

@Jiahao-Liu-Jeff
Copy link
Author

gss_localname() is included from <gssapi/gssapi_ext.h>, via <gssapi/gssapi_krb5.h>

I tried to compile this module at MacOS and relative gss_localname() error occurs. But it seems to be right when I used same command in CentOS docker container. I don't know if the environment matters.

@oranki
Copy link

oranki commented Apr 13, 2022

gss_localname() is defined in gssapi headers. Since you're not getting errors from missing headers, it seems likely your version of the headers do not have gss_localname() function. You probably need to either update them somehow, or install another Kerberos library to link against.

@Jiahao-Liu-Jeff
Copy link
Author

gss_localname() is defined in gssapi headers. Since you're not getting errors from missing headers, it seems likely your version of the headers do not have gss_localname() function. You probably need to either update them somehow, or install another Kerberos library to link against.

Thank you for you reply. Now I am working on resolving web browser access to page which protected by Kerberos. I configured Nginx with spnege module and set the conf file like below:

'
llocation / {
auth_gss on;
auth_gss_realm EXAMPLE.ORG;
auth_gss_service_name "HTTP/test.example.org";
auth_gss_keytab /etc/krb5.keytab;
return 301 xxxxx;
}
'
But it still return 403. Is it possible to access protected page like this way?

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

2 participants