Skip to content

Fix incorrect logging in krb5_parse_name() error handling #156

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

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ngx_http_auth_spnego_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,6 @@ ngx_int_t ngx_http_auth_spnego_basic(ngx_http_request_t *r,
krb5_principal server = NULL;
krb5_creds creds;
krb5_get_init_creds_opt *gic_options = NULL;
int kret = 0;
char *name = NULL;
char *p = NULL;

Expand Down Expand Up @@ -915,9 +914,9 @@ ngx_int_t ngx_http_auth_spnego_basic(ngx_http_request_t *r,
&host_name, &alcf->realm);
}

kret = krb5_parse_name(kcontext, (const char *)service.data, &server);
code = krb5_parse_name(kcontext, (const char *)service.data, &server);

if (kret) {
if (code) {
spnego_log_error("Kerberos error: Unable to parse service name");
spnego_log_krb5_error(kcontext, code);
spnego_error(NGX_ERROR);
Expand Down