]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Refactored more krb5 checks out of the main configure.in
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 4 Jan 2010 22:22:07 +0000 (23:22 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 4 Jan 2010 22:22:07 +0000 (23:22 +0100)
acinclude/krb5.m4
configure.in

index a67e4761d390b26591eacd8aac080fb3edfe538c..9364feaaf66dfebac4306045226f19ae65a644b6 100644 (file)
@@ -102,8 +102,8 @@ main()
 
 dnl checks that gssapi is ok, and sets squid_cv_working_gssapi accordingly
 AC_DEFUN([SQUID_CHECK_WORKING_GSSAPI], [
-       AC_CACHE_CHECK([for working gssapi], squid_cv_working_gssapi, [
-               AC_RUN_IFELSE([AC_LANG_SOURCE([[
+  AC_CACHE_CHECK([for working gssapi], squid_cv_working_gssapi, [
+    AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #ifdef HAVE_GSSAPI_GSSAPI_H
 #include <gssapi/gssapi.h>
 #elif HAVE_GSSAPI_H
@@ -131,14 +131,14 @@ main(void)
 
         return 0;
 }
-       ]])],  [ squid_cv_working_gssapi=yes ], [ squid_cv_working_gssapi=no ])])
+  ]])],  [ squid_cv_working_gssapi=yes ], [ squid_cv_working_gssapi=no ])])
 ])
 
 
 dnl check for a working spnego, and set squid_cv_have_spnego
 AC_DEFUN([SQUID_CHECK_SPNEGO_SUPPORT], [
-       AC_CACHE_CHECK([for spnego support], squid_cv_have_spnego, [
-               AC_RUN_IFELSE([AC_LANG_SOURCE([[
+  AC_CACHE_CHECK([for spnego support], squid_cv_have_spnego, [
+    AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #ifdef HAVE_HEIMDAL_KERBEROS
 #ifdef HAVE_GSSAPI_GSSAPI_H
 #include <gssapi/gssapi.h>
@@ -177,6 +177,33 @@ gss_OID gss_mech_spnego = &_gss_mech_spnego;
 
  return 1;
 }
-       ]])],  
-       [ squid_cv_have_spnego=yes ], [ squid_cv_have_spnego=no ])])
+  ]])],  
+  [ squid_cv_have_spnego=yes ], [ squid_cv_have_spnego=no ])])
+])
+
+dnl checks that krb5 is functional. Sets squid_cv_working_krb5
+AC_DEFUN([SQUID_CHECK_WORKING_KRB5],[
+  AC_CACHE_CHECK([for working krb5], squid_cv_working_krb5, [
+    AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#ifdef HAVE_KRB5_H
+#if HAVE_BROKEN_SOLARIS_KRB5_H
+#if defined(__cplusplus)
+#define KRB5INT_BEGIN_DECLS     extern "C" {
+#define KRB5INT_END_DECLS
+KRB5INT_BEGIN_DECLS
+#endif
+#endif
+#include <krb5.h>
+#endif
+
+int
+main(void)
+{
+        krb5_context context;
+
+        krb5_init_context(&context);
+
+        return 0;
+}
+  ]])], [ squid_cv_working_krb5=yes ], [ squid_cv_working_krb5=no ])])
 ])
index b3290e8e87823f395b6291027347459997301a4c..99791871f6dc92341aa2edec8e011c2741a5035d 100644 (file)
@@ -1747,7 +1747,6 @@ done
 AC_MSG_NOTICE([Log daemon helpers built: $LOG_DAEMON_HELPERS])
 AC_SUBST(LOG_DAEMON_HELPERS)
 
-dnl KK FIXME: this is pretty complex
 dnl
 dnl Check Kerberos/GSSAPI/SPNEGO
 dnl
@@ -1870,50 +1869,30 @@ if test "$ac_krb5_config" = "yes" ; then
      AC_DEFINE(HAVE_SPNEGO,1, [Define to 1 if you have SPNEGO support])
     fi
 
-dnl ########## KK HERE ######
-    AC_CACHE_CHECK([for working krb5], squid_cv_working_krb5, [
-        AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#ifdef HAVE_KRB5_H
-#if HAVE_BROKEN_SOLARIS_KRB5_H
-#if defined(__cplusplus)
-#define KRB5INT_BEGIN_DECLS     extern "C" {
-#define KRB5INT_END_DECLS
-KRB5INT_BEGIN_DECLS
-#endif
-#endif
-#include <krb5.h>
-#endif
-
-int
-main(void)
-{
-        krb5_context context;
-
-        krb5_init_context(&context);
-
-        return 0;
-}
-]])], [ squid_cv_working_krb5=yes ], [ squid_cv_working_krb5=no ])])
+    SQUID_CHECK_WORKING_KRB5
     if test "$squid_cv_working_krb5" = "yes" ; then
         AC_DEFINE(HAVE_KRB5, 1, [KRB5 support])
     fi
 
-   SQUID_STATE_ROLLBACK([krbsave])
    AC_SUBST(KRB5INCS)
    AC_SUBST(KRB5LIBS)
 fi
+SQUID_STATE_ROLLBACK([krbsave])
 AM_CONDITIONAL(HAVE_SPNEGO, test x"$squid_cv_have_spnego" = x"yes" )
 
 dnl Enable "NTLM fail open"
 AC_ARG_ENABLE(ntlm-fail-open,
-  AS_HELP_STRING([--enable-ntlm-fail-open],[Enable NTLM fail open, where a helper that fails one of the
+  AS_HELP_STRING([--enable-ntlm-fail-open],
+                      [Enable NTLM fail open, where a helper that fails one of the
                   Authentication steps can allow squid to still authenticate
-                  the user.]),
-[ if test "$enableval" = "yes" ; then
-    AC_DEFINE(NTLM_FAIL_OPEN,1,[Define if NTLM is allowed to fail gracefully when a helper has problems. WARNING: This has security implications. DO NOT enable unless you KNOW you need it.])
+                  the user. This has security implications.]), [ 
+  if test "$enableval" = "yes" ; then
+    AC_DEFINE(NTLM_FAIL_OPEN,1,
+          [Define if NTLM is allowed to fail gracefully when a helper has problems.])
   fi
 ])
 
+########### KK HERE ##########
 dnl Select external_acl helpers to build
 EXTERNAL_ACL_HELPERS=all
 AC_ARG_ENABLE(external-acl-helpers,