pull up r22073 from trunk
authorTom Yu <tlyu@mit.edu>
Tue, 14 Apr 2009 21:07:13 +0000 (21:07 +0000)
committerTom Yu <tlyu@mit.edu>
Tue, 14 Apr 2009 21:07:13 +0000 (21:07 +0000)
 ------------------------------------------------------------------------
 r22073 | wfiveash | 2009-03-10 16:26:24 -0400 (Tue, 10 Mar 2009) | 5 lines
 Changed paths:
    M /trunk/src/kadmin/dbutil/kdb5_mkey.c
    M /trunk/src/lib/kdb/kdb5.c
    M /trunk/src/plugins/kdb/ldap/libkdb_ldap/kdb_xdr.c

 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.

ticket: 6405
version_fixed: 1.7

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-7@22217 dc483132-0cff-0310-8789-dd5450dbe970

src/kadmin/dbutil/kdb5_mkey.c
src/lib/kdb/kdb5.c
src/plugins/kdb/ldap/libkdb_ldap/kdb_xdr.c

index 1dcc0c655152b9ac60fdf271c03862d1061d2dfc..4916de2cbd658df389f898fdd0517e60075bd96d 100644 (file)
@@ -185,6 +185,7 @@ add_new_mkey(krb5_context context, krb5_db_entry *master_entry,
                                            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 @@ update_princ_encryption_1(void *cb, krb5_db_entry *ent)
         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 @@ kdb5_purge_mkeys(int argc, char *argv[])
         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");
index c7be706d892241b122b4c59b814a3c5c6e411a29..ed85d89a6215638d2aa9099858015f6115ea6afb 100644 (file)
@@ -2678,8 +2678,8 @@ krb5_dbe_delete_tl_data(krb5_context context,
             krb5_dbe_free_tl_data(context, free_tl_data);
             entry->n_tl_data--;
         } else {
-            tl_data = tl_data->tl_data_next;
             prev_tl_data = tl_data;
+            tl_data = tl_data->tl_data_next;
         }
     }
 
index f8e1d4415e4b858427b44f3a43e1433ddb2d16d6..d4c6ac832bc90ca853d780b0aadeeff1082caa3d 100644 (file)
@@ -148,51 +148,6 @@ krb5_dbe_lookup_last_pwd_change(context, entry, stamp)
 
     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 */