krb5: Require krb5_get_host_realm and krb5_free_host_realm be available to build...
authorAndrew Bartlett <abartlet@samba.org>
Wed, 4 Jan 2012 23:54:50 +0000 (10:54 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 10 Jan 2012 20:50:07 +0000 (21:50 +0100)
source3/configure.in
source3/libads/kerberos.c
source3/wscript

index fd28a4bb1a395682e951b1959722ebc4e0142aa2..a2f414b4087f7918170273d015f83b38553e53eb 100644 (file)
@@ -4422,6 +4422,18 @@ if test x"$with_ads_support" != x"no"; then
     use_ads=no
   fi
 
+  if test x"$ac_cv_func_ext_krb5_get_host_realm" != x"yes"
+  then
+    AC_MSG_WARN(krb5_get_host_realm not found in -lkrb5)
+    use_ads=no
+  fi
+
+  if test x"$ac_cv_func_ext_krb5_free_host_realm" != x"yes"
+  then
+    AC_MSG_WARN(krb5_free_host_realm not found in -lkrb5)
+    use_ads=no
+  fi
+
   if test x"$ac_cv_func_ext_krb5_principal2salt" != x"yes" -a \
           x"$ac_cv_func_ext_krb5_get_pw_salt" != x"yes"
   then
index f260dcaaf0b6f5b78190dca989fac87e9f3d0e9f..a43c7b167c2a56a1374afaddb6c4fc339c4567cd 100644 (file)
@@ -484,7 +484,6 @@ char *kerberos_get_default_realm_from_ccache(TALLOC_CTX *mem_ctx)
 
 char *kerberos_get_realm_from_hostname(TALLOC_CTX *mem_ctx, const char *hostname)
 {
-#if defined(HAVE_KRB5_GET_HOST_REALM) && defined(HAVE_KRB5_FREE_HOST_REALM)
 #if defined(HAVE_KRB5_REALM_TYPE)
        /* Heimdal. */
        krb5_realm *realm_list = NULL;
@@ -525,9 +524,6 @@ char *kerberos_get_realm_from_hostname(TALLOC_CTX *mem_ctx, const char *hostname
                ctx = NULL;
        }
        return realm;
-#else
-       return NULL;
-#endif
 }
 
 char *kerberos_get_principal_from_service_hostname(TALLOC_CTX *mem_ctx,
index 690ae957e380e6f0cac9f85c5e07b7f1f79cdd87..e7d9dc09c41aa3794633ff386d6d010a8d1a09e1 100644 (file)
@@ -750,6 +750,12 @@ return krb5_kt_resolve(context, "WRFILE:api", &keytab);
         if not conf.CONFIG_SET('HAVE_KRB5_C_ENCTYPE_COMPARE'):
             Logs.warn("krb5_c_enctype_compare not found in -lkrb5")
             use_ads=False
+        if not conf.CONFIG_SET('HAVE_KRB5_GET_HOST_REALM'):
+            Logs.warn("krb5_get_host_realm not found in -lkrb5")
+            use_ads=False
+        if not conf.CONFIG_SET('HAVE_KRB5_FREE_HOST_REALM'):
+            Logs.warn("krb5_free_host_realm not found in -lkrb5")
+            use_ads=False
         if not conf.CONFIG_SET('HAVE_KRB5_PRINCIPAL2SALT') and \
            not conf.CONFIG_SET('HAVE_KRB5_GET_PW_SALT'):
             Logs.warn("no CREATE_KEY_FUNCTIONS detected")