From: Tom Yu Date: Thu, 24 Jun 2004 20:08:30 +0000 (+0000) Subject: * alt_prof.c (kadm5_get_admin_service_name): Fix call to X-Git-Tag: krb5-1.4-beta1~283 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=95958185e42ef7b83836bae66536433b31c34316;p=krb5.git * alt_prof.c (kadm5_get_admin_service_name): Fix call to kadm5_get_config_params(). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16509 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kadm5/ChangeLog b/src/lib/kadm5/ChangeLog index 7a72491ef..5beaa3a98 100644 --- a/src/lib/kadm5/ChangeLog +++ b/src/lib/kadm5/ChangeLog @@ -1,3 +1,8 @@ +2004-06-24 Tom Yu + + * alt_prof.c (kadm5_get_admin_service_name): Fix call to + kadm5_get_config_params(). + 2004-06-16 Ken Raeburn * Makefile.in (clean-mac): Target deleted. diff --git a/src/lib/kadm5/alt_prof.c b/src/lib/kadm5/alt_prof.c index 23258c9a9..bb87f8881 100644 --- a/src/lib/kadm5/alt_prof.c +++ b/src/lib/kadm5/alt_prof.c @@ -781,11 +781,18 @@ kadm5_get_admin_service_name(krb5_context ctx, memset(¶ms_in, 0, sizeof(params_in)); memset(¶ms_out, 0, sizeof(params_out)); - params_in.mask |= KADM5_CONFIG_ADMIN_SERVER; - ret = kadm5_get_config_params(ctx, NULL, NULL, ¶ms_in, ¶ms_out); + params_in.mask |= KADM5_CONFIG_REALM; + params_in.realm = realm_in; + ret = kadm5_get_config_params(ctx, DEFAULT_PROFILE_PATH, + "KRB5_CONFIG", ¶ms_in, ¶ms_out); if (ret) return ret; + if (!(params_out.mask & KADM5_CONFIG_ADMIN_SERVER)) { + ret = KADM5_MISSING_KRB5_CONF_PARAMS; + goto err_params; + } + hp = gethostbyname(params_out.admin_server); if (hp == NULL) { ret = errno; @@ -798,7 +805,7 @@ kadm5_get_admin_service_name(krb5_context ctx, sprintf(admin_name, "kadmin/%s", hp->h_name); err_params: - free(params_out.admin_server); + kadm5_free_config_params(ctx, ¶ms_out); return ret; }