diff options
author | Tom Yu <tlyu@mit.edu> | 2012-09-21 20:49:29 -0400 |
---|---|---|
committer | Tom Yu <tlyu@mit.edu> | 2012-10-15 19:41:16 -0400 |
commit | 2b03bb01e37faee55b9e60c90cc8076549de0d6d (patch) | |
tree | 1e6e8c8d1c3b93f4f14514c7b9f3a414c934f0c4 /src/kdc/kdc_util.c | |
parent | 3b8b18d6a87f5d2b4f255ee2e7d34ae6b48b4bf6 (diff) | |
download | krb5-2b03bb01e37faee55b9e60c90cc8076549de0d6d.tar.gz krb5-2b03bb01e37faee55b9e60c90cc8076549de0d6d.tar.xz krb5-2b03bb01e37faee55b9e60c90cc8076549de0d6d.zip |
Clean up domain->realm referrals
Clean up domain->realm referrals by breaking prep_reprocess_tgs_req()
into smaller functions. Give the resulting functions more descriptive
names. Also delete an unnecessary and almost exact copy of
krb5_get_host_realm().
Diffstat (limited to 'src/kdc/kdc_util.c')
-rw-r--r-- | src/kdc/kdc_util.c | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/kdc/kdc_util.c b/src/kdc/kdc_util.c index 10ed38314d..387a76cf3c 100644 --- a/src/kdc/kdc_util.c +++ b/src/kdc/kdc_util.c @@ -1881,65 +1881,6 @@ cleanup: return retval; } - -krb5_error_code -krb5int_get_domain_realm_mapping(krb5_context context, - const char *host, char ***realmsp) -{ - char **retrealms; - char *realm, *cp, *temp_realm; - krb5_error_code retval; - char temp_host[MAX_DNS_NAMELEN+1]; - - /* do sanity check and lower-case */ - retval = krb5int_clean_hostname(context, host, temp_host, sizeof temp_host); - if (retval) - return retval; - /* - Search for the best match for the host or domain. - Example: Given a host a.b.c.d, try to match on: - 1) a.b.c.d 2) .b.c.d. 3) b.c.d 4) .c.d 5) c.d 6) .d 7) d - */ - - cp = temp_host; - realm = (char *)NULL; - temp_realm = 0; - while (cp ) { - retval = profile_get_string(context->profile, KRB5_CONF_DOMAIN_REALM, cp, - 0, (char *)NULL, &temp_realm); - if (retval) - return retval; - if (temp_realm != (char *)NULL) - break; /* Match found */ - - /* Setup for another test */ - if (*cp == '.') { - cp++; - } else { - cp = strchr(cp, '.'); - } - } - if (temp_realm != (char*)NULL) { - realm = strdup(temp_realm); - profile_release_string(temp_realm); - if (!realm) { - return ENOMEM; - } - } - retrealms = (char **)calloc(2, sizeof(*retrealms)); - if (!retrealms) { - if (realm != (char *)NULL) - free(realm); - return ENOMEM; - } - - retrealms[0] = realm; - retrealms[1] = 0; - - *realmsp = retrealms; - return 0; -} - /* * Although the KDC doesn't call this function directly, * process_tcp_connection_read() in net-server.c does call it. |