* alt_prof.c (kadm5_get_admin_service_name): Fix call to
authorTom Yu <tlyu@mit.edu>
Thu, 24 Jun 2004 20:08:30 +0000 (20:08 +0000)
committerTom Yu <tlyu@mit.edu>
Thu, 24 Jun 2004 20:08:30 +0000 (20:08 +0000)
kadm5_get_config_params().

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

src/lib/kadm5/ChangeLog
src/lib/kadm5/alt_prof.c

index 7a72491ef9d7b997d0c944248dd7c8e76ffbe922..5beaa3a980290cff8ed0718b43055a4d7a4dc1c2 100644 (file)
@@ -1,3 +1,8 @@
+2004-06-24  Tom Yu  <tlyu@mit.edu>
+
+       * alt_prof.c (kadm5_get_admin_service_name): Fix call to
+       kadm5_get_config_params().
+
 2004-06-16  Ken Raeburn  <raeburn@mit.edu>
 
        * Makefile.in (clean-mac): Target deleted.
index 23258c9a9e23510b953eb6a318ab9e4bd7fde9a8..bb87f8881eb7fedb77e2d09d4005d0974065b50e 100644 (file)
@@ -781,11 +781,18 @@ kadm5_get_admin_service_name(krb5_context ctx,
     memset(&params_in, 0, sizeof(params_in));
     memset(&params_out, 0, sizeof(params_out));
 
-    params_in.mask |= KADM5_CONFIG_ADMIN_SERVER;
-    ret = kadm5_get_config_params(ctx, NULL, NULL, &params_in, &params_out);
+    params_in.mask |= KADM5_CONFIG_REALM;
+    params_in.realm = realm_in;
+    ret = kadm5_get_config_params(ctx, DEFAULT_PROFILE_PATH,
+                                 "KRB5_CONFIG", &params_in, &params_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, &params_out);
     return ret;
 }