From d2d51aee1fe75c42a04c285e493e87a756364262 Mon Sep 17 00:00:00 2001 From: Mark Eichin Date: Tue, 5 Mar 1996 07:33:42 +0000 Subject: [PATCH] * kdb5_edit.c: new command line option -f stashfile. * kdb5_edit.M: document stashfile option. (also fixed some indentation, diff -w shows no difference.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7593 dc483132-0cff-0310-8789-dd5450dbe970 --- src/admin/edit/ChangeLog | 5 +++++ src/admin/edit/kdb5_edit.M | 11 +++++++++++ src/admin/edit/kdb5_edit.c | 32 +++++++++++++++++--------------- 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/src/admin/edit/ChangeLog b/src/admin/edit/ChangeLog index 82f7d55fd..9c2a77fde 100644 --- a/src/admin/edit/ChangeLog +++ b/src/admin/edit/ChangeLog @@ -1,3 +1,8 @@ +Mon Feb 26 22:42:09 1996 Mark Eichin + + * kdb5_edit.c: new command line option -f stashfile. + * kdb5_edit.M: document stashfile option. + Mon Feb 26 22:13:45 1996 Mark Eichin * dump.c (process_k5beta_record): since V4 salt type has no data diff --git a/src/admin/edit/kdb5_edit.M b/src/admin/edit/kdb5_edit.M index 3ca7623c7..8405c01cd 100644 --- a/src/admin/edit/kdb5_edit.M +++ b/src/admin/edit/kdb5_edit.M @@ -47,6 +47,9 @@ kdb5_edit \- edit a Kerberos V5 principal database ] [ .B \-s .I script +] [ +.B \-f +.I stashfile ] .br .SH DESCRIPTION @@ -90,6 +93,14 @@ option specifies the key type of the master key in the database; the default is the string representation of DEFAULT_KDC_KEYTYPE (defined in ). .PP The +.B \-f +.I stashfile +option specifies the filename of the stashed V5 master key. The default is +defined as DEFAULT_KEYFILE_STUB in and is +typically $(prefix)/lib/krb5kdc/.k5.REALMNAME. (In previous +releases, this would have been /.k5.REALMNAME.) +.PP +The .B \-M .I mkeyname option specifies the principal name for the master key in the database; diff --git a/src/admin/edit/kdb5_edit.c b/src/admin/edit/kdb5_edit.c index c145f8634..50bf99d48 100644 --- a/src/admin/edit/kdb5_edit.c +++ b/src/admin/edit/kdb5_edit.c @@ -82,7 +82,7 @@ usage(who, status) fprintf(stderr, "usage: %s [-d dbpathname] [-r realmname] [-R request ]\n", who); - fprintf(stderr, "\t [-k enctype] [-M mkeyname]\n"); + fprintf(stderr, "\t [-k enctype] [-M mkeyname] [-f stashfile]\n"); exit(status); } @@ -129,7 +129,7 @@ char *kdb5_edit_Init(argc, argv) progname = argv[0]; - while ((optchar = getopt(argc, argv, "P:d:r:R:k:M:e:ms:")) != EOF) { + while ((optchar = getopt(argc, argv, "P:d:r:R:k:M:e:ms:f:")) != EOF) { switch(optchar) { case 'P': /* Only used for testing!!! */ mkey_password = optarg; @@ -171,6 +171,9 @@ char *kdb5_edit_Init(argc, argv) exit(1); } break; + case 'f': + stash_file = optarg; + break; case '?': default: usage(progname, 1); @@ -256,17 +259,17 @@ char *kdb5_edit_Init(argc, argv) } if (master_keyblock.enctype != ENCTYPE_UNKNOWN) { - if (!valid_enctype(master_keyblock.enctype)) { - char tmp[32]; - if (krb5_enctype_to_string(master_keyblock.enctype, - tmp, sizeof(tmp))) - com_err(argv[0], KRB5_PROG_KEYTYPE_NOSUPP, - "while setting up enctype %d", master_keyblock.enctype); - else - com_err(argv[0], KRB5_PROG_KEYTYPE_NOSUPP, tmp); - exit(1); - } - krb5_use_enctype(edit_context, &master_encblock, + if (!valid_enctype(master_keyblock.enctype)) { + char tmp[32]; + if (krb5_enctype_to_string(master_keyblock.enctype, + tmp, sizeof(tmp))) + com_err(argv[0], KRB5_PROG_KEYTYPE_NOSUPP, + "while setting up enctype %d", master_keyblock.enctype); + else + com_err(argv[0], KRB5_PROG_KEYTYPE_NOSUPP, tmp); + exit(1); + } + krb5_use_enctype(edit_context, &master_encblock, master_keyblock.enctype); } @@ -878,7 +881,7 @@ void extract_v4_srvtab(argc, argv) if ((retval = krb5_dbekd_decrypt_key_data(edit_context, &master_encblock, - pkey, + pkey, &key, NULL))) { com_err(argv[0], retval, "while decrypting key for '%s'", pname); exit_status++; @@ -891,7 +894,6 @@ void extract_v4_srvtab(argc, argv) krb5_xfree(key.contents); continue; } -/*XXX handle host*/ fwrite(argv[i], strlen(argv[i]) + 1, 1, fout); /* p.name */ fwrite(argv[1], strlen(argv[1]) + 1, 1, fout); /* p.instance */ fwrite(cur_realm, strlen(cur_realm) + 1, 1, fout); /* p.realm */ -- 2.26.2