struct addrlist *, enum locate_service_type svc,
int sockettype, int family);
+krb5_error_code
+krb5int_get_fallback_host_realm (krb5_context, krb5_data *hdata,
+ char **realmp);
+
/* new encryption provider api */
struct krb5_enc_provider {
krb5_principal client, server, supplied_server, out_supplied_server;
krb5_creds tgtq, cc_tgt, *tgtptr, *referral_tgts[KRB5_REFERRAL_MAXHOPS];
krb5_boolean old_use_conf_ktypes;
- char **hrealms;
+ char *hrealm;
unsigned int referral_count, i;
/*
*/
if (krb5_is_referral_realm(&supplied_server->realm)) {
if (server->length >= 2) {
- retval=krb5_get_fallback_host_realm(context, &server->data[1],
- &hrealms);
+ retval=krb5int_get_fallback_host_realm(context, &server->data[1],
+ &hrealm);
if (retval) goto cleanup;
#if 0
DPRINTF(("gc_from_kdc: using fallback realm of %s\n",
- hrealms[0]));
+ hrealm));
#endif
krb5_free_data_contents(context,&in_cred->server->realm);
- server->realm.data=hrealms[0];
- server->realm.length=strlen(hrealms[0]);
- free(hrealms);
+ server->realm.data=hrealm;
+ server->realm.length=strlen(hrealm);
}
else {
/*
* Problem case: Realm tagged for referral but apparently not
* in a <type>/<host> format that
- * krb5_get_fallback_host_realm can deal with.
+ * krb5int_get_fallback_host_realm can deal with.
*/
DPRINTF(("gc_from_kdc: referral specified "
"but no fallback realm avaiable!\n"));
*/
krb5_error_code KRB5_CALLCONV
-krb5_get_fallback_host_realm(krb5_context context, krb5_data *hdata, char ***realmsp)
+krb5int_get_fallback_host_realm(krb5_context context, krb5_data *hdata,
+ char **realmp)
{
- char **retrealms;
char *realm, *cp;
krb5_error_code retval;
char local_host[MAXDNAME+1], host[MAXDNAME+1];
return retval;
}
- if (!(retrealms = (char **)calloc(2, sizeof(*retrealms)))) {
- if (realm != (char *)NULL)
- free(realm);
- return ENOMEM;
- }
-
- retrealms[0] = realm;
- retrealms[1] = 0;
-
- *realmsp = retrealms;
+ *realmp = realm;
return 0;
}