From Ian Taylor <ian@cygnus.com>. Makes kadmind use -r for both
authorMark Eichin <eichin@mit.edu>
Fri, 21 Apr 1995 17:14:52 +0000 (17:14 +0000)
committerMark Eichin <eichin@mit.edu>
Fri, 21 Apr 1995 17:14:52 +0000 (17:14 +0000)
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

src/kadmin/server/ChangeLog
src/kadmin/server/adm_extern.c
src/kadmin/server/adm_extern.h
src/kadmin/server/adm_network.c
src/kadmin/server/adm_server.c

index 949b0cdb0dc28f05060da6371d6eed00b2e3841c..6ffcb95eb41eba6147b4212b2f97a044ed671172 100644 (file)
@@ -1,3 +1,14 @@
+Fri Apr 21 13:11:00 1995  Mark Eichin  <eichin@cygnus.com>
+
+       From Ian Taylor <ian@cygnus.com>. 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  <eichin@cygnus.com>
 
        Changes from Ian Taylor <ian@cygnus.com> to support testsuite.
index ed0709218fe1d781ae7c5a0901201cd8ecbb31ba..24b2b39a9df00622ac2aaa608478e21954e5558f 100644 (file)
@@ -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;
index 5fc11d219efe66b5fe14e90ef17d9302a0785267..017689643baf6257d17ec4ef6922980b575d0f5b 100644 (file)
@@ -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;
index f211f4f43ea18028b0f9cfc995365fffb6097b1f..545784f73cde8ef26d7a9bcaa599cbdb984e6636 100644 (file)
@@ -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",
index 394fbbfe1bf71c7cdc7a465532a66fa07d02f2c0..0b490519159b613d6c0829b5b3c29dd27101ab36 100644 (file)
@@ -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");