From: John Kohl Date: Thu, 26 Apr 1990 17:14:57 +0000 (+0000) Subject: getopt test vs EOF, not zero X-Git-Tag: krb5-1.0-alpha2~805 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6790d12b750381afb998b57c33468a6357c84300;p=krb5.git getopt test vs EOF, not zero move master_encblock initialization into process_args git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@591 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kdc/main.c b/src/kdc/main.c index ba33f13cc..1a3e898e0 100644 --- a/src/kdc/main.c +++ b/src/kdc/main.c @@ -133,7 +133,7 @@ char **argv; extern char *optarg; - while (c = getopt(argc, argv, "r:d:mM:k:")) { + while ((c = getopt(argc, argv, "r:d:mM:k:")) != EOF) { switch(c) { case 'r': /* realm name for db */ db_realm = optarg; @@ -179,9 +179,16 @@ char **argv; exit(1); } +#ifdef PROVIDE_DES_CBC_CRC + master_encblock.crypto_entry = &mit_des_cryptosystem_entry; +#else +#error You gotta figure out what cryptosystem to use in the KDC. +#endif + if (retval = krb5_db_fetch_mkey(master_princ, &master_encblock, manual, &master_keyblock)) { com_err(argv[0], retval, "while fetching master key"); + exit(1); } return; } @@ -203,12 +210,6 @@ krb5_keyblock *masterkeyblock; if (retval = krb5_db_init()) return(retval); -#ifdef PROVIDE_DES_CBC_CRC - master_encblock.crypto_entry = &mit_des_cryptosystem_entry; -#else -#error You gotta figure out what cryptosystem to use in the KDC. -#endif - if (retval = krb5_db_verify_master_key(masterkeyname, masterkeyblock, &master_encblock)) { master_encblock.crypto_entry = 0; @@ -279,6 +280,9 @@ char *argv[]; { krb5_error_code retval; + if (rindex(argv[0], '/')) + argv[0] = rindex(argv[0], '/')+1; + setup_com_err(); process_args(argc, argv); /* includes reading master key */