svn rev #21589: trunk/src/ include/ include/krb5/ lib/krb5/krb/ lib/krb5/os/ ...
ghudson@MIT.EDU
ghudson at MIT.EDU
Wed Dec 24 13:48:03 EST 2008
http://src.mit.edu/fisheye/changelog/krb5/?cs=21589
Commit By: ghudson
Log Message:
Clean up krb5_get_fallback_host_realm in two respects:
1. It isn't exported from libkrb5 (and no one seems to complain about
that). So give it a krb5int_ name and move its declaration to
k5-int.h. Also stop exporting it from the collected client lib.
2. It returned a list of realms, but its only caller assumes that the
list contains exactly one realm. So just make it return a single
realm.
Changed Files:
U trunk/src/include/k5-int.h
U trunk/src/include/krb5/krb5.hin
U trunk/src/lib/krb5/krb/gc_frm_kdc.c
U trunk/src/lib/krb5/os/hst_realm.c
U trunk/src/util/collected-client-lib/libcollected.exports
Modified: trunk/src/include/k5-int.h
===================================================================
--- trunk/src/include/k5-int.h 2008-12-24 16:51:33 UTC (rev 21588)
+++ trunk/src/include/k5-int.h 2008-12-24 18:48:00 UTC (rev 21589)
@@ -538,6 +538,10 @@
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 {
Modified: trunk/src/include/krb5/krb5.hin
===================================================================
--- trunk/src/include/krb5/krb5.hin 2008-12-24 16:51:33 UTC (rev 21588)
+++ trunk/src/include/krb5/krb5.hin 2008-12-24 18:48:00 UTC (rev 21589)
@@ -2099,10 +2099,6 @@
(krb5_context,
const char *,
char *** );
-krb5_error_code KRB5_CALLCONV krb5_get_fallback_host_realm
- (krb5_context,
- krb5_data *,
- char *** );
krb5_error_code KRB5_CALLCONV krb5_free_host_realm
(krb5_context,
char * const * );
Modified: trunk/src/lib/krb5/krb/gc_frm_kdc.c
===================================================================
--- trunk/src/lib/krb5/krb/gc_frm_kdc.c 2008-12-24 16:51:33 UTC (rev 21588)
+++ trunk/src/lib/krb5/krb/gc_frm_kdc.c 2008-12-24 18:48:00 UTC (rev 21589)
@@ -787,7 +787,7 @@
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;
/*
@@ -1021,23 +1021,22 @@
*/
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"));
Modified: trunk/src/lib/krb5/os/hst_realm.c
===================================================================
--- trunk/src/lib/krb5/os/hst_realm.c 2008-12-24 16:51:33 UTC (rev 21588)
+++ trunk/src/lib/krb5/os/hst_realm.c 2008-12-24 18:48:00 UTC (rev 21589)
@@ -335,9 +335,9 @@
*/
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];
@@ -417,16 +417,7 @@
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;
}
Modified: trunk/src/util/collected-client-lib/libcollected.exports
===================================================================
--- trunk/src/util/collected-client-lib/libcollected.exports 2008-12-24 16:51:33 UTC (rev 21588)
+++ trunk/src/util/collected-client-lib/libcollected.exports 2008-12-24 18:48:00 UTC (rev 21589)
@@ -177,7 +177,6 @@
krb5_read_password
krb5_aname_to_localname
krb5_get_host_realm
-krb5_get_fallback_host_realm
krb5_free_host_realm
krb5_auth_con_genaddrs
krb5_set_real_time
More information about the cvs-krb5
mailing list