* kdb5_edit.c: new command line option -f stashfile.
authorMark Eichin <eichin@mit.edu>
Tue, 5 Mar 1996 07:33:42 +0000 (07:33 +0000)
committerMark Eichin <eichin@mit.edu>
Tue, 5 Mar 1996 07:33:42 +0000 (07:33 +0000)
* 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
src/admin/edit/kdb5_edit.M
src/admin/edit/kdb5_edit.c

index 82f7d55fd8a57bee5dbb7b625d723a059e6d78aa..9c2a77fdeb8407bab4f6dead690581684e4acef7 100644 (file)
@@ -1,3 +1,8 @@
+Mon Feb 26 22:42:09 1996  Mark Eichin  <eichin@cygnus.com>
+
+       * kdb5_edit.c: new command line option -f stashfile.
+       * kdb5_edit.M: document stashfile option.
+
 Mon Feb 26 22:13:45 1996  Mark Eichin  <eichin@cygnus.com>
 
        * dump.c (process_k5beta_record): since V4 salt type has no data
index 3ca7623c78d2be070cd17512193b122a8fc7b0ee..8405c01cd179fb4408f2a62961e391a2888bb2d4 100644 (file)
@@ -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 <krb5/osconf.h>).
 .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 <krb5/osconf.h> 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;
index c145f86342a406f29498fbedca682686bc44839f..50bf99d48d44a4b7824c6cbec17037ce24055c11 100644 (file)
@@ -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 */