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 *hrealm;
+ char **hrealms;
unsigned int referral_count, i;
/*
*/
if (krb5_is_referral_realm(&supplied_server->realm)) {
if (server->length >= 2) {
- retval=krb5int_get_fallback_host_realm(context, &server->data[1],
- &hrealm);
+ retval=krb5_get_fallback_host_realm(context, &server->data[1],
+ &hrealms);
if (retval) goto cleanup;
#if 0
DPRINTF(("gc_from_kdc: using fallback realm of %s\n",
- hrealm));
+ hrealms[0]));
#endif
krb5_free_data_contents(context,&in_cred->server->realm);
- server->realm.data=hrealm;
- server->realm.length=strlen(hrealm);
+ server->realm.data=hrealms[0];
+ server->realm.length=strlen(hrealms[0]);
+ free(hrealms);
}
else {
/*
* Problem case: Realm tagged for referral but apparently not
* in a <type>/<host> format that
- * krb5int_get_fallback_host_realm can deal with.
+ * krb5_get_fallback_host_realm can deal with.
*/
DPRINTF(("gc_from_kdc: referral specified "
"but no fallback realm avaiable!\n"));
*/
krb5_error_code KRB5_CALLCONV
-krb5int_get_fallback_host_realm(krb5_context context, krb5_data *hdata,
- char **realmp)
+krb5_get_fallback_host_realm(krb5_context context, krb5_data *hdata, char ***realmsp)
{
+ char **retrealms;
char *realm, *cp;
krb5_error_code retval;
char local_host[MAXDNAME+1], host[MAXDNAME+1];
return retval;
}
- *realmp = realm;
+ if (!(retrealms = (char **)calloc(2, sizeof(*retrealms)))) {
+ if (realm != (char *)NULL)
+ free(realm);
+ return ENOMEM;
+ }
+
+ retrealms[0] = realm;
+ retrealms[1] = 0;
+
+ *realmsp = retrealms;
return 0;
}