diff options
Diffstat (limited to 'src/kdc/main.c')
-rw-r--r-- | src/kdc/main.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/kdc/main.c b/src/kdc/main.c index c05f2ee0a..6391bd74d 100644 --- a/src/kdc/main.c +++ b/src/kdc/main.c @@ -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; } |