From: Ezra Peisach Date: Wed, 19 Apr 1995 18:03:52 +0000 (+0000) Subject: When default realm specified on command line, call krb5_set_default_realm so X-Git-Tag: krb5-1.0-beta5~357 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=48a313c6b36d668a4aebc6c2950258d3b973a6ec;p=krb5.git When default realm specified on command line, call krb5_set_default_realm so that created keys will have the proper realm. (which may not be the same as the machines default realm) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5379 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/admin/edit/ChangeLog b/src/admin/edit/ChangeLog index 4483235a7..24e60eb06 100644 --- a/src/admin/edit/ChangeLog +++ b/src/admin/edit/ChangeLog @@ -1,3 +1,9 @@ +Wed Apr 19 13:59:47 1995 Ezra Peisach + + * kdb5_edit.c (kdb5_edit_Init): If a default realm is specified + (with -r), use krb5_set_default_realm so that created keys + will have the correct realm. + Thu Mar 23 23:28:26 1995 Theodore Y. Ts'o * kdb5_edit.c (show_principal, parse_princ_args): Add diff --git a/src/admin/edit/kdb5_edit.c b/src/admin/edit/kdb5_edit.c index 584708e44..bc9b36870 100644 --- a/src/admin/edit/kdb5_edit.c +++ b/src/admin/edit/kdb5_edit.c @@ -205,7 +205,13 @@ char *kdb5_edit_Init(argc, argv) exit(1); } krb5_use_cstype(edit_context, &master_encblock, etype); - if (!cur_realm) { + + if (cur_realm) { + if (retval = krb5_set_default_realm(edit_context, cur_realm)) { + com_err(progname, retval, "while setting default realm name"); + exit(1); + } + } else { if (retval = krb5_get_default_realm(edit_context, &defrealm)) { com_err(progname, retval, "while retrieving default realm name"); exit(1); @@ -217,6 +223,7 @@ char *kdb5_edit_Init(argc, argv) } (void) strcpy(cur_realm, defrealm); } + (void) set_dbname_help(progname, dbname); exit_status = 0; /* It's OK if we get errors in set_dbname_help */ return request;