diff options
author | Andreas Schneider <asn@samba.org> | 2011-11-30 17:58:30 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2012-09-13 11:19:46 +0200 |
commit | 6606982b313f1e7e0129b854a361c1f67b82ccd0 (patch) | |
tree | d3aeaca94399f7d63b36fa98b1f749f80147c662 /source3/libsmb | |
parent | 4151f94afcfbf09e5d5277050dda3a282db7adaa (diff) | |
download | samba-6606982b313f1e7e0129b854a361c1f67b82ccd0.tar.gz |
s3-libsmb: Remove obsolete smb_krb5_locate_kdc.
Signed-off-by: Günther Deschner <gd@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Fix bug #9111 - Fix compilation with newer MIT kerberos which hides internal
symbols.
(cherry picked from commit bc593e2ddfb33d88d2b58a0e721d448bbd30426c)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clikrb5.c | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/source3/libsmb/clikrb5.c b/source3/libsmb/clikrb5.c index b0743e4d6a7..795820555ed 100644 --- a/source3/libsmb/clikrb5.c +++ b/source3/libsmb/clikrb5.c @@ -488,95 +488,6 @@ bool unwrap_pac(TALLOC_CTX *mem_ctx, DATA_BLOB *auth_data, DATA_BLOB *unwrapped_ #endif } -#if !defined(HAVE_KRB5_LOCATE_KDC) - -/* krb5_locate_kdc is an internal MIT symbol. MIT are not yet willing to commit - * to a public interface for this functionality, so we have to be able to live - * without it if the MIT libraries are hiding their internal symbols. - */ - -#if defined(KRB5_KRBHST_INIT) -/* Heimdal */ - krb5_error_code smb_krb5_locate_kdc(krb5_context ctx, const krb5_data *realm, struct sockaddr **addr_pp, int *naddrs, int get_masters) -{ - krb5_krbhst_handle hnd; - krb5_krbhst_info *hinfo; - krb5_error_code rc; - int num_kdcs, i; - struct sockaddr *sa; - struct addrinfo *ai; - - *addr_pp = NULL; - *naddrs = 0; - - rc = krb5_krbhst_init(ctx, realm->data, KRB5_KRBHST_KDC, &hnd); - if (rc) { - DEBUG(0, ("smb_krb5_locate_kdc: krb5_krbhst_init failed (%s)\n", error_message(rc))); - return rc; - } - - for ( num_kdcs = 0; (rc = krb5_krbhst_next(ctx, hnd, &hinfo) == 0); num_kdcs++) - ; - - krb5_krbhst_reset(ctx, hnd); - - if (!num_kdcs) { - DEBUG(0, ("smb_krb5_locate_kdc: zero kdcs found !\n")); - krb5_krbhst_free(ctx, hnd); - return -1; - } - - sa = SMB_MALLOC_ARRAY( struct sockaddr, num_kdcs ); - if (!sa) { - DEBUG(0, ("smb_krb5_locate_kdc: malloc failed\n")); - krb5_krbhst_free(ctx, hnd); - naddrs = 0; - return -1; - } - - memset(sa, '\0', sizeof(struct sockaddr) * num_kdcs ); - - for (i = 0; i < num_kdcs && (rc = krb5_krbhst_next(ctx, hnd, &hinfo) == 0); i++) { - -#if defined(HAVE_KRB5_KRBHST_GET_ADDRINFO) - rc = krb5_krbhst_get_addrinfo(ctx, hinfo, &ai); - if (rc) { - DEBUG(0,("krb5_krbhst_get_addrinfo failed: %s\n", error_message(rc))); - continue; - } -#endif - if (hinfo->ai && hinfo->ai->ai_family == AF_INET) - memcpy(&sa[i], hinfo->ai->ai_addr, sizeof(struct sockaddr)); - } - - krb5_krbhst_free(ctx, hnd); - - *naddrs = num_kdcs; - *addr_pp = sa; - return 0; -} - -#else /* ! defined(KRB5_KRBHST_INIT) */ - - krb5_error_code smb_krb5_locate_kdc(krb5_context ctx, const krb5_data *realm, - struct sockaddr **addr_pp, int *naddrs, int get_masters) -{ - DEBUG(0, ("unable to explicitly locate the KDC on this platform\n")); - return KRB5_KDC_UNREACH; -} - -#endif /* KRB5_KRBHST_INIT */ - -#else /* ! HAVE_KRB5_LOCATE_KDC */ - - krb5_error_code smb_krb5_locate_kdc(krb5_context ctx, const krb5_data *realm, - struct sockaddr **addr_pp, int *naddrs, int get_masters) -{ - return krb5_locate_kdc(ctx, realm, addr_pp, naddrs, get_masters); -} - -#endif /* HAVE_KRB5_LOCATE_KDC */ - #if !defined(HAVE_KRB5_FREE_UNPARSED_NAME) void krb5_free_unparsed_name(krb5_context context, char *val) { |