From: Mark Eichin Date: Fri, 21 Apr 1995 17:14:52 +0000 (+0000) Subject: From Ian Taylor . Makes kadmind use -r for both X-Git-Tag: krb5-1.0-beta5~319 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=11efa711bd334c200b9e6a28b4c55c77af628777;p=krb5.git From Ian Taylor . Makes kadmind use -r for both the database name and the service name, eliminating an installation hassle. * adm_extern.h: declare realm. * adm_server.c: define realm. (process_args): change db_realm to realm. * adm_network.c (setup_network): use the preset realm, not the default realm. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5427 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kadmin/server/ChangeLog b/src/kadmin/server/ChangeLog index 949b0cdb0..6ffcb95eb 100644 --- a/src/kadmin/server/ChangeLog +++ b/src/kadmin/server/ChangeLog @@ -1,3 +1,14 @@ +Fri Apr 21 13:11:00 1995 Mark Eichin + + From Ian Taylor . Makes kadmind use -r for both + the database name and the service name, eliminating an + installation hassle. + * adm_extern.h: declare realm. + * adm_server.c: define realm. + (process_args): change db_realm to realm. + * adm_network.c (setup_network): use the preset realm, not the + default realm. + Thu Apr 20 18:05:00 1995 Mark Eichin Changes from Ian Taylor to support testsuite. diff --git a/src/kadmin/server/adm_extern.c b/src/kadmin/server/adm_extern.c index ed0709218..24b2b39a9 100644 --- a/src/kadmin/server/adm_extern.c +++ b/src/kadmin/server/adm_extern.c @@ -37,6 +37,7 @@ krb5_principal master_princ; volatile int signal_requests_exit = 0; /* gets set when signal hits */ char *dbm_db_name = DEFAULT_KDB_FILE; +char *realm = NULL; krb5_keyblock tgs_key; krb5_kvno tgs_kvno; diff --git a/src/kadmin/server/adm_extern.h b/src/kadmin/server/adm_extern.h index 5fc11d219..017689643 100644 --- a/src/kadmin/server/adm_extern.h +++ b/src/kadmin/server/adm_extern.h @@ -55,6 +55,7 @@ extern krb5_db_entry master_entry; extern volatile int signal_requests_exit; extern char *dbm_db_name; +extern char *realm; extern krb5_keyblock tgs_key; extern krb5_kvno tgs_kvno; diff --git a/src/kadmin/server/adm_network.c b/src/kadmin/server/adm_network.c index f211f4f43..545784f73 100644 --- a/src/kadmin/server/adm_network.c +++ b/src/kadmin/server/adm_network.c @@ -126,7 +126,6 @@ setup_network(context, prog) { krb5_error_code retval; char server_host_name[MAXHOSTNAMELEN]; - char *lrealm; krb5_sigtype doexit(), do_child(); struct servent *service_servent; struct hostent *service_hostent; @@ -146,17 +145,8 @@ setup_network(context, prog) return ENOMEM; } - - if (retval = krb5_get_default_realm(context, &lrealm)) { - free(client_server_info.name_of_service); - com_err( "setup_network", 0, - "adm_network: Unable to get Default Realm"); - return retval; - } - (void) sprintf(client_server_info.name_of_service, "%s%s%s%s%s", - CPWNAME, "/", lrealm, "", ""); - free(lrealm); + CPWNAME, "/", realm, "@", realm); #ifdef DEBUG fprintf(stderr, "client_server_info.name_of_service = %s\n", diff --git a/src/kadmin/server/adm_server.c b/src/kadmin/server/adm_server.c index 394fbbfe1..0b4905191 100644 --- a/src/kadmin/server/adm_server.c +++ b/src/kadmin/server/adm_server.c @@ -117,7 +117,6 @@ process_args(context, argc, argv) int c; krb5_boolean manual = FALSE; int keytypedone = 0; - char *db_realm = 0; char *mkey_name = 0; char *local_realm; krb5_enctype etype; @@ -182,7 +181,7 @@ process_args(context, argc, argv) break; case 'r': - db_realm = optarg; + realm = optarg; break; case 'D': @@ -201,14 +200,14 @@ process_args(context, argc, argv) } - if (!db_realm) { + if (!realm) { /* no realm specified, use default realm */ if (retval = krb5_get_default_realm(context, &local_realm)) { com_err(argv[0], retval, "while attempting to retrieve default realm"); exit(1); } - db_realm = local_realm; + realm = local_realm; } if (!mkey_name) { @@ -221,7 +220,7 @@ process_args(context, argc, argv) /* assemble & parse the master key name */ if (retval = krb5_db_setup_mkey_name(context, mkey_name, - db_realm, + realm, (char **) 0, &master_princ)) { com_err(argv[0], retval, "while setting up master key name");