verify return code from krb5_db_set_mkey_list
authorTom Yu <tlyu@mit.edu>
Tue, 14 Apr 2009 21:07:49 +0000 (21:07 +0000)
committerTom Yu <tlyu@mit.edu>
Tue, 14 Apr 2009 21:07:49 +0000 (21:07 +0000)
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
src/kdc/main.c

index d51365af4421628598a7f90d3a0dd077d53b7479..b7642f52ec5bf5c327149dc476ac3a6898550147 100644 (file)
@@ -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,
index 262d9bb1b4c8285e35efcc8d511a49223fc1c730..81f143031d546c574894518347d8bce001c7fe17 100644 (file)
@@ -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,