Skip to content

Commit

Permalink
Fix error handling in gssint_mechglue_init()
Browse files Browse the repository at this point in the history
In the unlikely event that one of the functions called by
gssint_mechglue_init() returns an error, return that error to the
caller rather than continuing on and discarding the error status.
Returning success when some of the operations failed could fool the
library finalizer into thinking that initialization completed.
Reported by Spencer Malone.

(cherry picked from commit c120ed5)

ticket: 8864
version_fixed: 1.17.2
  • Loading branch information
greghudson committed Jan 25, 2020
1 parent 90a13e6 commit 45ec4ac
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib/gssapi/mechglue/g_initialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,19 @@ gssint_mechglue_init(void)
add_error_table(&et_ggss_error_table);

err = k5_mutex_finish_init(&g_mechSetLock);
if (err)
return err;
err = k5_mutex_finish_init(&g_mechListLock);
if (err)
return err;

#ifdef _GSS_STATIC_LINK
err = gss_krb5int_lib_init();
if (err)
return err;
err = gss_spnegoint_lib_init();
if (err)
return err;
#endif

err = gssint_mecherrmap_init();
Expand Down

0 comments on commit 45ec4ac

Please sign in to comment.