Skip to content

Commit

Permalink
Fix errno in get_ticket_path()
Browse files Browse the repository at this point in the history
krb5_init_context can change the errno value even if the function
succeeded, so we need to set it back to 0 after the call.
  • Loading branch information
denisonbarbosa committed Aug 8, 2024
1 parent 6189bfe commit 3d71626
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/ad/krb5.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ char *get_ticket_path() {
errno = ret;
return NULL;
}
// We need to reset the errno to 0, because krb5_init_context()
// can alter it, even if it succeeds.
errno = 0;
const char* cc_name = krb5_cc_default_name(context);
if (cc_name == NULL) {
Expand Down

0 comments on commit 3d71626

Please sign in to comment.