Set SUPPORT_DESMD5 attribute for the krbtgt entry
authorTheodore Tso <tytso@mit.edu>
Tue, 18 Apr 1995 21:46:38 +0000 (21:46 +0000)
committerTheodore Tso <tytso@mit.edu>
Tue, 18 Apr 1995 21:46:38 +0000 (21:46 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5364 dc483132-0cff-0310-8789-dd5450dbe970

src/admin/convert/ChangeLog
src/admin/convert/kdb5_convert.c

index 0b82657d04f9d471fd0ec1a92a73e4174b1371bb..d9ab869a7e0322201a251d789b049d97d8edb951 100644 (file)
@@ -1,3 +1,8 @@
+Tue Mar 28 16:41:52 1995    <tytso@rsx-11.mit.edu>
+
+       * kdb5_convert.c (fixup_database, main): Set SUPPORT_DESMD5
+               attribute for the krbtgt entry.
+
 Thu Mar  2 12:23:51 1995  Theodore Y. Ts'o  <tytso@dcl>
 
        * Makefile.in (ISODELIB): Remove reference to $(ISODELIB).
index eccf2282bcfab32daa09f7ebbc18051d3e680482..862b1ccd90eddb53b7a4e39bd8a670b48245cec2 100644 (file)
@@ -80,6 +80,7 @@ void v4fini PROTOTYPE((void));
 int v4init PROTOTYPE((char *, char *, int, char *));
 krb5_error_code enter_in_v5_db PROTOTYPE((krb5_context, char *, Principal *));
 krb5_error_code process_v4_dump PROTOTYPE((krb5_context, char *, char *));
+krb5_error_code fixup_database PROTOTYPE((krb5_context, char *));
        
 int create_local_tgt = 0;
 
@@ -388,7 +389,10 @@ master key name '%s'\n",
     putchar('\n');
     if (retval)
        com_err(PROGNAME, retval, "while translating entries to the database");
-
+    else {
+       retval = fixup_database(context, realm);
+    }
+    
     /* clean up; rename temporary database if there were no errors */
     if (retval == 0) {
        if (retval = krb5_db_fini (context))
@@ -804,3 +808,31 @@ char *realm;
     return retval;
 }
 
+krb5_error_code fixup_database(context, realm)
+    krb5_context context;
+    char * realm;
+{
+    krb5_db_entry entry;
+    krb5_error_code retval;
+    int nprincs;
+    krb5_boolean more;
+
+    nprincs = 1;
+    if (retval = krb5_db_get_principal(context, &tgt_princ, &entry, 
+                                      &nprincs, &more))
+       return retval;
+    
+    if (nprincs == 0)
+       return 0;
+    
+    entry.attributes |= KRB5_KDB_SUPPORT_DESMD5;
+    
+    retval = krb5_db_put_principal(context, &entry, &nprincs);
+    
+    if (nprincs)
+       krb5_db_free_principal(context, &entry, nprincs);
+    
+    return retval;
+}
+
+