From: Tom Yu Date: Thu, 24 Jun 2004 20:10:05 +0000 (+0000) Subject: use host-based service name for kadmin client X-Git-Tag: krb5-1.4-beta1~282 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ad63c45bd47c783309e6f75ec3690cf224ceec7c;p=krb5.git use host-based service name for kadmin client * kadmin.c (kadmin_startup): Use host-based service name from kadm5_get_admin_service_name() for SEAM compatibility when old AUTH_GSSAPI not requested. ticket: new component: krb5-admin git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16510 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kadmin/cli/ChangeLog b/src/kadmin/cli/ChangeLog index 4bfa42652..28502c6ab 100644 --- a/src/kadmin/cli/ChangeLog +++ b/src/kadmin/cli/ChangeLog @@ -1,3 +1,9 @@ +2004-06-24 Tom Yu + + * kadmin.c (kadmin_startup): Use host-based service name from + kadm5_get_admin_service_name() for SEAM compatibility when old + AUTH_GSSAPI not requested. + 2004-06-15 Tom Yu * kadmin.c (kadmin_startup): Add option to force old AUTH_GSSAPI diff --git a/src/kadmin/cli/kadmin.c b/src/kadmin/cli/kadmin.c index 3eef8529b..06d23b813 100644 --- a/src/kadmin/cli/kadmin.c +++ b/src/kadmin/cli/kadmin.c @@ -183,6 +183,8 @@ char *kadmin_startup(argc, argv) krb5_ccache cc; krb5_principal princ; kadm5_config_params params; + char svcnamebuf[MAXHOSTNAMELEN + 8]; + char *svcname; memset((char *) ¶ms, 0, sizeof(params)); @@ -261,6 +263,17 @@ char *kadmin_startup(argc, argv) params.mask |= KADM5_CONFIG_REALM; params.realm = def_realm; + retval = kadm5_get_admin_service_name(context, def_realm, svcnamebuf, + sizeof(svcnamebuf)); + if (retval) { + fprintf(stderr, "%s: failed to get admin service name", whoami); + exit(1); + } + if (params.mask & KADM5_CONFIG_OLD_AUTH_GSSAPI) + svcname = KADM5_ADMIN_SERVICE; + else + svcname = svcnamebuf; + /* * Set cc to an open credentials cache, either specified by the -c * argument or the default. @@ -404,7 +417,7 @@ char *kadmin_startup(argc, argv) printf("Authenticating as principal %s with existing credentials.\n", princstr); retval = kadm5_init_with_creds(princstr, cc, - KADM5_ADMIN_SERVICE, + svcname, ¶ms, KADM5_STRUCT_VERSION, KADM5_API_VERSION_2, @@ -417,7 +430,7 @@ char *kadmin_startup(argc, argv) printf("Authenticating as principal %s with default keytab.\n", princstr); retval = kadm5_init_with_skey(princstr, keytab_name, - KADM5_ADMIN_SERVICE, + svcname, ¶ms, KADM5_STRUCT_VERSION, KADM5_API_VERSION_2, @@ -426,7 +439,7 @@ char *kadmin_startup(argc, argv) printf("Authenticating as principal %s with password.\n", princstr); retval = kadm5_init_with_password(princstr, password, - KADM5_ADMIN_SERVICE, + svcname, ¶ms, KADM5_STRUCT_VERSION, KADM5_API_VERSION_2,