From: Theodore Tso Date: Tue, 18 Apr 1995 21:46:38 +0000 (+0000) Subject: Set SUPPORT_DESMD5 attribute for the krbtgt entry X-Git-Tag: krb5-1.0-beta5~372 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9d987435291994e88a14d1550393a293429c2227;p=krb5.git Set SUPPORT_DESMD5 attribute for the krbtgt entry git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5364 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/admin/convert/ChangeLog b/src/admin/convert/ChangeLog index 0b82657d0..d9ab869a7 100644 --- a/src/admin/convert/ChangeLog +++ b/src/admin/convert/ChangeLog @@ -1,3 +1,8 @@ +Tue Mar 28 16:41:52 1995 + + * 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 * Makefile.in (ISODELIB): Remove reference to $(ISODELIB). diff --git a/src/admin/convert/kdb5_convert.c b/src/admin/convert/kdb5_convert.c index eccf2282b..862b1ccd9 100644 --- a/src/admin/convert/kdb5_convert.c +++ b/src/admin/convert/kdb5_convert.c @@ -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; +} + +