From: Tom Yu Date: Fri, 25 Jul 1997 19:45:36 +0000 (+0000) Subject: * dump.c: Update to new kdb API X-Git-Tag: krb5-1.1-beta1~1090 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=03743dc8ba40d02244d57cfd5ce0c371e41f04d4;p=krb5.git * dump.c: Update to new kdb API git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10134 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kadmin/cli/ChangeLog b/src/kadmin/cli/ChangeLog index 3bf88a682..1bfeee128 100644 --- a/src/kadmin/cli/ChangeLog +++ b/src/kadmin/cli/ChangeLog @@ -1,3 +1,7 @@ +Fri Jul 25 15:45:24 1997 Tom Yu + + * dump.c: Update to new kdb API. + Fri Jun 27 17:37:07 1997 Tom Yu * keytab.c (add_principal): Don't call kadm5_free_key_data; that's diff --git a/src/kadmin/cli/dump.c b/src/kadmin/cli/dump.c index f52108d2e..9a85a2e99 100644 --- a/src/kadmin/cli/dump.c +++ b/src/kadmin/cli/dump.c @@ -108,6 +108,7 @@ static const char dfile_err_fmt[] = "%s: cannot open %s (%s)\n"; static const char oldoption[] = "-old"; static const char verboseoption[] = "-verbose"; static const char updateoption[] = "-update"; +static const char hashoption[] = "-hash"; static const char dump_tmptrail[] = "~"; /* Can't use krb5_dbe_find_enctype because we have a */ @@ -1309,7 +1310,7 @@ restore_dump(programname, context, dumpfile, f, verbose) /* * Usage is - * load_db [-old] [-verbose] [-update] filename dbname + * load_db [-old] [-verbose] [-update] [-hash] filename dbname */ void load_db(argc, argv) @@ -1332,6 +1333,7 @@ load_db(argc, argv) int)); const char * restore_name; int update, verbose; + krb5_int32 crflags; int aindex; /* @@ -1346,6 +1348,7 @@ load_db(argc, argv) restore_name = standard_fmt_name; update = 0; verbose = 0; + crflags = KRB5_KDB_CREATE_BTREE; exit_status = 0; dbname_tmp = (char *) NULL; for (aindex = 1; aindex < argc; aindex++) { @@ -1359,6 +1362,8 @@ load_db(argc, argv) else if (!strcmp(argv[aindex], updateoption)) { update = 1; } + else if (!strcmp(argv[aindex], hashoption)) { + crflags = KRB5_KDB_CREATE_HASH; else break; } @@ -1405,7 +1410,7 @@ load_db(argc, argv) /* * Create the new database if not an update restoration. */ - if (update || !(kret = krb5_db_create(context, dbname_tmp))) { + if (update || !(kret = krb5_db_create(context, dbname_tmp, crflags))) { /* * Point ourselves at it. */ @@ -1448,7 +1453,7 @@ load_db(argc, argv) */ if (!update) { if (exit_status) { - if ((kret = kdb5_db_destroy(context, dbname))) { + if ((kret = krb5_db_destroy(context, dbname))) { fprintf(stderr, dbdelerr_fmt, programname, dbname_tmp, error_message(kret)); exit_status++;