]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Markus Moeller <huaraz@moeller.plus.com>
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 5 Dec 2010 00:25:25 +0000 (17:25 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 5 Dec 2010 00:25:25 +0000 (17:25 -0700)
Updated Kerberos header includes

Better heimdal support as new heimdal version have gssapi_krb5 header
files which were in the past only in older MIT releases available.

To use kerberos_ldap_group on freebsd config.test has to be changed as
FreeBSD installs additional packages in /usr/local.

On FreeBSD 7 the krb5.h file does not work with C++. Checks for it.

acinclude/krb5.m4
configure.in
helpers/external_acl/kerberos_ldap_group/config.test
helpers/external_acl/kerberos_ldap_group/support.h

index f572b3da99a2be2038c7f0fb546e6f09bae3f385..22c151de39af7bec9dc1c2b4a0b530dbe4d5b2b5 100644 (file)
@@ -51,6 +51,42 @@ int i;
 ]) dnl SQUID_CHECK_KRB5_SOLARIS_BROKEN_KRB5_H
 
 
+AC_DEFUN([SQUID_CHECK_KRB5_HEIMDAL_BROKEN_KRB5_H], [
+  AC_CACHE_CHECK([for broken Heimdal krb5.h],squid_cv_broken_heimdal_krb5_h, [
+    AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <krb5.h>
+int
+main(void)
+{
+        krb5_context context;
+
+        krb5_init_context(&context);
+
+        return 0;
+}
+]])], [ squid_cv_broken_heimdal_krb5_h=no ], [
+    AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#if defined(__cplusplus)
+extern "C" {
+#endif
+#include <krb5.h>
+#if defined(__cplusplus)
+}
+#endif
+int
+main(void)
+{
+        krb5_context context;
+
+        krb5_init_context(&context);
+
+        return 0;
+}
+]])], [ squid_cv_broken_heimdal_krb5_h=yes ], [ squid_cv_broken_heimdal_krb5_h=no ])
+    ])
+  ])
+]) dnl SQUID_CHECK_KRB5_HEIMDAL_BROKEN_KRB5_H
+
 dnl check the max skew in the krb5 context, and sets squid_cv_max_skew_context
 AC_DEFUN([SQUID_CHECK_MAX_SKEW_IN_KRB5_CONTEXT],[
   AC_CACHE_CHECK([for max_skew in struct krb5_context],
@@ -195,7 +231,13 @@ AC_DEFUN([SQUID_CHECK_WORKING_KRB5],[
 KRB5INT_BEGIN_DECLS
 #endif
 #endif
+#if HAVE_BROKEN_HEIMDAL_KRB5_H
+extern "C" {
 #include <krb5.h>
+}
+#else
+#include <krb5.h>
+#endif
 #endif
 
 int
index d557f397b0ab15d6a9a1bf6edddef4a3cec30015..7b8f10bdd567aa9fc621945b2664a51b77218ce0 100644 (file)
@@ -776,7 +776,7 @@ AC_ARG_ENABLE(delay-pools,
 [ if test "x$enableval" = "xyes" ; then
     AC_MSG_NOTICE([Delay pools enabled])
     AC_DEFINE([USE_DELAY_POOLS],1,[Traffic management via "delay pools".])
-    AM_CONDITIONAL(ENABLE_DELAY_POOLS, true,)
+    AM_CONDITIONAL(ENABLE_DELAY_POOLS, true)
   fi
 ])
 
@@ -1835,12 +1835,16 @@ if test "x$ac_krb5_config" = "xyes" ; then
 
   SQUID_CHECK_KRB5_SOLARIS_BROKEN_KRB5_H
   if test "x$squid_cv_broken_krb5_h" = "xyes"; then
-    AC_DEFINE(HAVE_BROKEN_SOLARIS_KRB5_H, 1, [Define to 1 if krb5.h is broken for C++])
+    AC_DEFINE(HAVE_BROKEN_SOLARIS_KRB5_H, 1, [Define to 1 if Solaris krb5.h is broken for C++])
     AC_MSG_WARN([You have a broken Solaris <krb5.h> system include.])
     AC_MSG_WARN([Please see http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6837512])
     AC_MSG_WARN([If you need Kerberos support you'll have to patch])
     AC_MSG_WARN([your system. See contrib/solaris/solaris-krb5-include.patch])
   fi
+  SQUID_CHECK_KRB5_HEIMDAL_BROKEN_KRB5_H
+  if test "x$squid_cv_broken_heimdal_krb5_h" = "xyes"; then
+    AC_DEFINE(HAVE_BROKEN_HEIMDAL_KRB5_H, 1, [Define to 1 if Heimdal krb5.h is broken for C++])
+  fi
   AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h)
 
   ac_com_error_message=no
index 4c1c762e9f7757b061fb1a3091f61ee7de6ffbf9..88528172f6edf5fa917367bf0cd8043d3024a80a 100644 (file)
@@ -2,13 +2,16 @@
 # Don't build without gssapi.h
 if [ -f /usr/include/ldap.h -o -f /usr/local/include/ldap.h ]; then
        # Won't link without SASL as well
-       if [ -f /usr/include/sasl.h -o -f /usr/include/sasl/sasl.h ]; then
+       if [ -f /usr/include/sasl.h -o -f /usr/include/sasl/sasl.h -o -f /usr/local/include/sasl.h -o -f /usr/local/include/sasl/sasl.h ]; then
                if [ -f /usr/lib/libsasl.a -o -f /usr/lib/libsasl2.a ]; then
                        exit 0
                fi
                if [ -f /usr/lib/libsasl.la -o -f /usr/lib/libsasl2.la ]; then
                        exit 0
                fi
+               if [ -f  /usr/local/lib/libsasl.so -o -f  /usr/local/lib/libsasl2.so ]; then
+                       exit 0
+               fi
        fi
 fi
 exit 1
index 996b7525267ae88ed99a2e645a7f149b8f542ec1..46b141676a4d0c7c0db1c98ac7a789fe20c58b47 100644 (file)
 #include <string.h>
 #endif
 
-#if HAVE_HEIMDAL_KERBEROS
 #if HAVE_GSSAPI_GSSAPI_H
 #include <gssapi/gssapi.h>
 #elif HAVE_GSSAPI_H
 #include <gssapi.h>
 #endif /* HAVE_GSSAPI_GSSAPI_H/HAVE_GSSAPI_H */
-#if HAVE_KRB5_H
-#if HAVE_BROKEN_SOLARIS_KRB5_H
-#warn "Warning! You have a broken Solaris <krb5.h> fsystem header"
-#warn "http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6837512"
-#endif /* HAVE_BROKEN_SOLARIS_KRB5_H */
-#include <krb5.h>
-#endif /* HAVE_KRB5_H */
-#if HAVE_COM_ERR_H
-#include <com_err.h>
-#else
-#define error_message(code) krb5_get_err_text(kparam.context,code)
-#endif /* HAVE_COM_ERR_H */
-#else /*MIT */
-#ifdef HAVE_GSSAPI_GSSAPI_H
-#include <gssapi/gssapi.h>
-#elif defined(HAVE_GSSAPI_H)
-#include <gssapi.h>
-#endif
-#ifdef HAVE_GSSAPI_GSSAPI_KRB5_H
+
+#if !HAVE_HEIMDAL_KERBEROS
+#if HAVE_GSSAPI_GSSAPI_KRB5_H
 #include <gssapi/gssapi_krb5.h>
 #endif
-#ifdef HAVE_GSSAPI_GSSAPI_GENERIC_H
+#if HAVE_GSSAPI_GSSAPI_GENERIC_H
 #include <gssapi/gssapi_generic.h>
 #endif
-#ifdef HAVE_GSSAPI_GSSAPI_EXT_H
+#if HAVE_GSSAPI_GSSAPI_EXT_H
 #include <gssapi/gssapi_ext.h>
 #endif
-#ifdef HAVE_KRB5_H
+#endif
+
+#if HAVE_KRB5_H
 #if HAVE_BROKEN_SOLARIS_KRB5_H
+#warn "Warning! You have a broken Solaris <krb5.h> system header"
+#warn "http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6837512"
 #if defined(__cplusplus)
 #define KRB5INT_BEGIN_DECLS     extern "C" {
 #define KRB5INT_END_DECLS
 KRB5INT_BEGIN_DECLS
 #endif
-#endif
+#endif /* HAVE_BROKEN_SOLARIS_KRB5_H */
+#if HAVE_BROKEN_HEIMDAL_KRB5_H
+extern "C" {
+#include <krb5.h>
+}
+#else
 #include <krb5.h>
 #endif
-#ifdef HAVE_COM_ERR_H
+#endif /* HAVE_KRB5_H */
+
+#if HAVE_COM_ERR_H
 #include <com_err.h>
-#endif
-#endif
+#elif HAVE_HEIMDAL_KERBEROS
+#define error_message(code) krb5_get_err_text(kparam.context,code)
+#endif /* HAVE_COM_ERR_H */
+
 #ifndef gss_nt_service_name
 #define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE
 #endif