one step closer to *really* only depending on krb5.conf. (I don't know
authorMark Eichin <eichin@mit.edu>
Sat, 24 Feb 1996 00:29:47 +0000 (00:29 +0000)
committerMark Eichin <eichin@mit.edu>
Sat, 24 Feb 1996 00:29:47 +0000 (00:29 +0000)
of any others, but this was a big one.)

Sat Feb 10 02:46:27 1996  Mark Eichin  <eichin@cygnus.com>

* main.c (initialize_realms): look for [kdc] profile=path for
default alternate kdc profile (environment variable still
overrides it.)

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7507 dc483132-0cff-0310-8789-dd5450dbe970

src/kdc/ChangeLog
src/kdc/main.c

index 168b6f270a029f140f4da734b2a8dd8ac1e23ef5..6b62634e6eaf1e2764c235b15c3013a74b835d19 100644 (file)
@@ -1,3 +1,9 @@
+Sat Feb 10 02:46:27 1996  Mark Eichin  <eichin@cygnus.com>
+
+       * main.c (initialize_realms): look for [kdc] profile=path for
+       default alternate kdc profile (environment variable still
+       overrides it.)
+
 Wed Feb 21 23:28:33 1996  Richard Basch  <basch@lehman.com>
 
        * kerberos_v4.c: Improve checking of DES keys
index c05f2ee0a81181b1a1d0cba50f08cc3e906be1c2..6391bd74d20dcfedd9e1feb6defb91ef1a16bdc2 100644 (file)
@@ -729,8 +729,25 @@ initialize_realms(kcontext, argc, argv)
     krb5_pointer       aprof;
     const char         *hierarchy[3];
     extern char *optarg;
+    char               *db_prof;
+
+    {
+      /* handle kdc file config */
+      const char* conf_names[3];
+      char **conf_val = 0;
+      conf_names[0] = "kdc";
+      conf_names[1] = "profile";
+      conf_names[2] = 0;
+
+      retval = profile_get_values(kcontext->profile, conf_names, &conf_val);
+      if(!retval && conf_val) {
+       db_prof = strdup(conf_val);
+      } else {
+       db_prof = strdup(DEFAULT_KDC_PROFILE);
+      }
+    }
 
-    if (!krb5_aprof_init(DEFAULT_KDC_PROFILE, KDC_PROFILE_ENV, &aprof)) {
+    if (!krb5_aprof_init(db_prof, KDC_PROFILE_ENV, &aprof)) {
        hierarchy[0] = "kdcdefaults";
        hierarchy[1] = "kdc_ports";
        hierarchy[2] = (char *) NULL;
@@ -830,6 +847,8 @@ initialize_realms(kcontext, argc, argv)
     kdc_active_realm = kdc_realmlist[0];
     if (default_ports)
        free(default_ports);
+
+    free(db_prof);
     return;
 }