From 9515cf76c4fd4b8acb87a77245e1bda72d3d60fb Mon Sep 17 00:00:00 2001 From: Zhanna Tsitkov Date: Mon, 16 Mar 2009 18:00:06 +0000 Subject: [PATCH] Verify return code from krb5_db_set_mkey_list git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22100 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kdc/kdc_util.c | 10 ++++++---- src/kdc/main.c | 7 ++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/kdc/kdc_util.c b/src/kdc/kdc_util.c index 5e1c91c80..4b1e31c78 100644 --- a/src/kdc/kdc_util.c +++ b/src/kdc/kdc_util.c @@ -454,7 +454,9 @@ kdc_get_server_key(krb5_ticket *ticket, unsigned int flags, &master_keyblock, 0, &tmp_mkey_list) == 0) { krb5_dbe_free_key_list(kdc_context, master_keylist); master_keylist = tmp_mkey_list; - krb5_db_set_mkey_list(kdc_context, master_keylist); + retval = krb5_db_set_mkey_list(kdc_context, master_keylist); + if (retval) + goto errout; if ((retval = krb5_dbe_find_mkey(kdc_context, master_keylist, server, &mkey_ptr))) { goto errout; @@ -469,10 +471,10 @@ kdc_get_server_key(krb5_ticket *ticket, unsigned int flags, -1, (krb5_int32)ticket->enc_part.kvno, &server_key); if (retval) - goto errout; + goto errout; if (!server_key) { - retval = KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN; - goto errout; + retval = KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN; + goto errout; } if ((*key = (krb5_keyblock *)malloc(sizeof **key))) { retval = krb5_dbekd_decrypt_key_data(kdc_context, mkey_ptr, diff --git a/src/kdc/main.c b/src/kdc/main.c index 7656dcd8e..8a56f593e 100644 --- a/src/kdc/main.c +++ b/src/kdc/main.c @@ -444,7 +444,12 @@ init_realm(kdc_realm_t *rdp, char *realm, char *def_mpname, "while setting master key for realm %s", realm); goto whoops; } - krb5_db_set_mkey_list(rdp->realm_context, rdp->mkey_list); + kret = krb5_db_set_mkey_list(rdp->realm_context, rdp->mkey_list); + if (kret) { + kdc_err(rdp->realm_context, kret, + "while setting master key list for realm %s", realm); + goto whoops; + } /* Set up the keytab */ if ((kret = krb5_ktkdb_resolve(rdp->realm_context, NULL, -- 2.26.2