From 71871ac0791c3435dc9af92ddc4bb80fbf5694a5 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Tue, 14 Apr 2009 21:07:49 +0000 Subject: [PATCH] verify return code from krb5_db_set_mkey_list pull up r22100 from trunk ------------------------------------------------------------------------ r22100 | tsitkova | 2009-03-16 14:00:06 -0400 (Mon, 16 Mar 2009) | 2 lines Changed paths: M /trunk/src/kdc/kdc_util.c M /trunk/src/kdc/main.c Verify return code from krb5_db_set_mkey_list. ticket: 6464 tags: pullup target_version: 1.7 version_fixed: 1.7 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-7@22230 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 d51365af4..b7642f52e 100644 --- a/src/kdc/kdc_util.c +++ b/src/kdc/kdc_util.c @@ -456,7 +456,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; @@ -471,10 +473,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 262d9bb1b..81f143031 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