svn rev #21817: branches/mkey_migrate/src/kadmin/dbutil/

wfiveash@MIT.EDU wfiveash at MIT.EDU
Tue Jan 27 21:18:30 EST 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=21817
Commit By: wfiveash
Log Message:
Make sure nentries == 1 after calling krb5_db_get_principal() in
kdb5_mkey.c.



Changed Files:
U   branches/mkey_migrate/src/kadmin/dbutil/kdb5_mkey.c
Modified: branches/mkey_migrate/src/kadmin/dbutil/kdb5_mkey.c
===================================================================
--- branches/mkey_migrate/src/kadmin/dbutil/kdb5_mkey.c	2009-01-28 01:58:59 UTC (rev 21816)
+++ branches/mkey_migrate/src/kadmin/dbutil/kdb5_mkey.c	2009-01-28 02:18:28 UTC (rev 21817)
@@ -215,8 +215,8 @@
 
     retval = krb5_db_get_principal(util_context, master_princ, &master_entry,
                                    &nentries, &more);
-    if (retval != 0) {
-        com_err(progname, retval, "while setting up master key name");
+    if (retval != 0 || nentries != 1) {
+        com_err(progname, retval, "while getting master key principal %s", mkey_fullname);
         exit_status++;
         return;
     }
@@ -389,10 +389,10 @@
         return;
     }
 
-    retval = krb5_db_get_principal(util_context, master_princ, &master_entry, &nentries,
-        &more);
-    if (retval != 0) {
-        com_err(progname, retval, "while setting up master key name");
+    retval = krb5_db_get_principal(util_context, master_princ, &master_entry,
+                                   &nentries, &more);
+    if (retval != 0 || nentries != 1) {
+        com_err(progname, retval, "while getting master key principal %s", mkey_fullname);
         exit_status++;
         return;
     }
@@ -522,9 +522,9 @@
         return;
     }
 
-    retval = krb5_db_get_principal(util_context, master_princ, &master_entry, &nentries,
-        &more);
-    if (retval != 0) {
+    retval = krb5_db_get_principal(util_context, master_princ, &master_entry,
+                                   &nentries, &more);
+    if (retval != 0 || nentries != 1) {
         com_err(progname, retval, "while getting master key principal %s", mkey_fullname);
         exit_status++;
         return;




More information about the cvs-krb5 mailing list