svn rev #22073: trunk/src/ kadmin/dbutil/ lib/kdb/ plugins/kdb/ldap/libkdb_ldap/

wfiveash@MIT.EDU wfiveash at MIT.EDU
Tue Mar 10 16:26:24 EDT 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=22073
Commit By: wfiveash
Log Message:
ticket: 6405
Tags: pullup

Several small fixes to enable the migrate mkey commands to work properly with a LDAP KDB.  See the ticket for more details.



Changed Files:
U   trunk/src/kadmin/dbutil/kdb5_mkey.c
U   trunk/src/lib/kdb/kdb5.c
U   trunk/src/plugins/kdb/ldap/libkdb_ldap/kdb_xdr.c
Modified: trunk/src/kadmin/dbutil/kdb5_mkey.c
===================================================================
--- trunk/src/kadmin/dbutil/kdb5_mkey.c	2009-03-10 14:49:43 UTC (rev 22072)
+++ trunk/src/kadmin/dbutil/kdb5_mkey.c	2009-03-10 20:26:24 UTC (rev 22073)
@@ -185,6 +185,7 @@
                                            mkey_aux_data_head))) {
         goto clean_n_exit;
     }
+    master_entry->mask |= KADM5_KEY_DATA;
 
 clean_n_exit:
     krb5_dbe_free_mkey_aux_list(context, mkey_aux_data_head);
@@ -906,6 +907,8 @@
         goto fail;
     }
 
+    ent->mask |= KADM5_KEY_DATA;
+
     if ((retval = krb5_db_put_principal(util_context, ent, &nentries))) {
         com_err(progname, retval,
                 "while updating principal '%s' key data in the database",
@@ -1422,6 +1425,8 @@
         goto cleanup_return;
     }
 
+    master_entry.mask |= KADM5_KEY_DATA;
+
     if ((retval = krb5_db_put_principal(util_context, &master_entry, &nentries))) {
         (void) krb5_db_fini(util_context);
         com_err(progname, retval, "while adding master key entry to the database");

Modified: trunk/src/lib/kdb/kdb5.c
===================================================================
--- trunk/src/lib/kdb/kdb5.c	2009-03-10 14:49:43 UTC (rev 22072)
+++ trunk/src/lib/kdb/kdb5.c	2009-03-10 20:26:24 UTC (rev 22073)
@@ -2678,8 +2678,8 @@
             krb5_dbe_free_tl_data(context, free_tl_data);
             entry->n_tl_data--;
         } else {
+            prev_tl_data = tl_data;
             tl_data = tl_data->tl_data_next;
-            prev_tl_data = tl_data;
         }
     }
 

Modified: trunk/src/plugins/kdb/ldap/libkdb_ldap/kdb_xdr.c
===================================================================
--- trunk/src/plugins/kdb/ldap/libkdb_ldap/kdb_xdr.c	2009-03-10 14:49:43 UTC (rev 22072)
+++ trunk/src/plugins/kdb/ldap/libkdb_ldap/kdb_xdr.c	2009-03-10 20:26:24 UTC (rev 22073)
@@ -148,52 +148,7 @@
 
     return(0);
 }
-#if 0 /************** Begin IFDEF'ed OUT *******************************/
-krb5_error_code
-krb5_dbe_lookup_mkvno(krb5_context context,
-		      krb5_db_entry *entry,
-		      krb5_kvno *mkvno)
-{
-    krb5_tl_data tl_data;
-    krb5_error_code code;
-    krb5_int16 tmp;
 
-    tl_data.tl_data_type = KRB5_TL_MKVNO;
-
-    if ((code = krb5_dbe_lookup_tl_data(context, entry, &tl_data)))
-	return (code);
-
-    /* XXX need to think about this */
-    if (tl_data.tl_data_length != 2) {
-	*mkvno = 0;
-	return (0);
-    }
-
-    /* XXX this needs to be the inverse of how this is encoded */
-    krb5_kdb_decode_int16(tl_data.tl_data_contents, tmp);
-
-    *mkvno = (krb5_kvno) tmp;
-
-    return (0);
-}
-
-krb5_error_code
-krb5_dbe_update_mkvno(krb5_context    context,
-		      krb5_db_entry * entry,
-		      krb5_kvno       mkvno)
-{
-    krb5_tl_data tl_data;
-    krb5_octet buf[2];		/* this is the encoded size of an int16 */
-
-    tl_data.tl_data_type = KRB5_TL_MKVNO;
-    tl_data.tl_data_length = sizeof(buf);
-    krb5_kdb_encode_int16((krb5_int16) mkvno, buf);
-    tl_data.tl_data_contents = buf;
-
-    return (krb5_dbe_update_tl_data(context, entry, &tl_data));
-}
-#endif /**************** END IFDEF'ed OUT *******************************/
-
 /* it seems odd that there's no function to remove a tl_data, but if
    I need one, I'll add one */
 




More information about the cvs-krb5 mailing list