diff options
author | Tom Yu <tlyu@mit.edu> | 2008-07-17 15:44:43 +0000 |
---|---|---|
committer | Tom Yu <tlyu@mit.edu> | 2008-07-17 15:44:43 +0000 |
commit | 2e4c764eeb97fc6a61e2e8dabe36560dc4a9750d (patch) | |
tree | 7044deb915d963c95525b52e58ef21aa72fa3e62 /src/kadmin/dbutil/kdb5_util.c | |
parent | f452cb9821e2ee9034fc83b5ec98347fab647488 (diff) | |
download | krb5-2e4c764eeb97fc6a61e2e8dabe36560dc4a9750d.zip krb5-2e4c764eeb97fc6a61e2e8dabe36560dc4a9750d.tar.gz krb5-2e4c764eeb97fc6a61e2e8dabe36560dc4a9750d.tar.bz2 |
Apply patch from Mark Phalan to correctly use progname instead of
argv[0].
ticket: 6030
tags: pullup
target_version: 1.6.4
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20532 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kadmin/dbutil/kdb5_util.c')
-rw-r--r-- | src/kadmin/dbutil/kdb5_util.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/kadmin/dbutil/kdb5_util.c b/src/kadmin/dbutil/kdb5_util.c index 7da89c8..cfc3d08 100644 --- a/src/kadmin/dbutil/kdb5_util.c +++ b/src/kadmin/dbutil/kdb5_util.c @@ -247,7 +247,7 @@ int main(argc, argv) } } else if (strcmp(*argv, "-k") == 0 && ARG_VAL) { if (krb5_string_to_enctype(koptarg, &global_params.enctype)) - com_err(argv[0], 0, "%s is an invalid enctype", koptarg); + com_err(progname, 0, "%s is an invalid enctype", koptarg); else global_params.mask |= KADM5_CONFIG_ENCTYPE; } else if (strcmp(*argv, "-M") == 0 && ARG_VAL) { @@ -289,7 +289,7 @@ int main(argc, argv) retval = kadm5_get_config_params(util_context, 1, &global_params, &global_params); if (retval) { - com_err(argv[0], retval, "while retreiving configuration parameters"); + com_err(progname, retval, "while retreiving configuration parameters"); exit(1); } @@ -302,7 +302,7 @@ int main(argc, argv) master_keyblock.enctype = global_params.enctype; if ((master_keyblock.enctype != ENCTYPE_UNKNOWN) && (!krb5_c_valid_enctype(master_keyblock.enctype))) { - com_err(argv[0], KRB5_PROG_KEYTYPE_NOSUPP, + com_err(progname, KRB5_PROG_KEYTYPE_NOSUPP, "while setting up enctype %d", master_keyblock.enctype); } @@ -341,13 +341,13 @@ void set_dbname(argc, argv) if (argc < 3) { com_err(argv[0], 0, "Too few arguments"); - com_err(argv[0], 0, "Usage: %s dbpathname realmname", argv[0]); + com_err(progname, 0, "Usage: %s dbpathname realmname", argv[0]); exit_status++; return; } if (dbactive) { if ((retval = krb5_db_fini(util_context)) && retval!= KRB5_KDB_DBNOTINITED) { - com_err(argv[0], retval, "while closing previous database"); + com_err(progname, retval, "while closing previous database"); exit_status++; return; } @@ -360,7 +360,7 @@ void set_dbname(argc, argv) dbactive = FALSE; } - (void) set_dbname_help(argv[0], argv[1]); + (void) set_dbname_help(progname, argv[1]); return; } #endif @@ -432,6 +432,7 @@ static int open_db_and_mkey() retval = krb5_principal2salt(util_context, master_princ, &scratch); if (retval) { com_err(progname, retval, "while calculated master key salt"); + exit_status++; return(1); } @@ -449,6 +450,7 @@ static int open_db_and_mkey() if (retval) { com_err(progname, retval, "while transforming master key from password"); + exit_status++; return(1); } free(scratch.data); @@ -526,7 +528,7 @@ add_random_key(argc, argv) krb5_int32 num_keysalts = 0; int free_keysalts; - char *me = argv[0]; + char *me = progname; char *ks_str = NULL; char *pr_str; |