s3-libsmb: Remove obsolete smb_krb5_locate_kdc.
[ira/wip.git] / source3 / libsmb / clikrb5.c
index 9af3e49d116bb26c8268f7fdc5b9eaf8b4c9bed3..8cea29cc190ca82c37c92f8e272e326f319f0381 100644 (file)
@@ -347,95 +347,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 */
-
  void kerberos_set_creds_enctype(krb5_creds *pcreds, int enctype)
 {
 #if defined(HAVE_KRB5_KEYBLOCK_IN_CREDS)