]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Rename --with-gnugss to --with-gss (#1688)
authorAmos Jeffries <yadij@users.noreply.github.com>
Fri, 23 Feb 2024 17:53:14 +0000 (17:53 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Fri, 23 Feb 2024 17:53:19 +0000 (17:53 +0000)
Updating the library detection to use pkg-config and
bringing relevant macros up to current style.

acinclude/krb5.m4
configure.ac
doc/release-notes/release-7.sgml.in
squid.dox
src/Makefile.am
src/acl/external/kerberos_ldap_group/Makefile.am
src/auth/negotiate/kerberos/Makefile.am
src/auth/negotiate/kerberos/negotiate_kerberos.h
src/auth/negotiate/kerberos/negotiate_kerberos_auth_test.cc

index 2c4e3403cdc065b64107c1db2472614e34b2a313..0215f4722907a3ccbac0b2bf8625f6c7509a0eda 100644 (file)
@@ -131,17 +131,9 @@ 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([[
-#if USE_HEIMDAL_KRB5
-#if HAVE_GSSAPI_GSSAPI_H
-#include <gssapi/gssapi.h>
-#elif HAVE_GSSAPI_H
-#include <gssapi.h>
-#endif
-#elif USE_GNUGSS
 #if HAVE_GSS_H
 #include <gss.h>
 #endif
-#else
 #if USE_APPLE_KRB5
 #define GSSKRB_APPLE_DEPRECATED(x)
 #endif
@@ -156,7 +148,6 @@ AC_DEFUN([SQUID_CHECK_WORKING_GSSAPI], [
 #if HAVE_GSSAPI_GSSAPI_GENERIC_H
 #include <gssapi/gssapi_generic.h>
 #endif
-#endif
 int
 main(void)
 {
@@ -177,17 +168,9 @@ 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([[
-#if USE_HEIMDAL_KRB5
-#if HAVE_GSSAPI_GSSAPI_H
-#include <gssapi/gssapi.h>
-#elif HAVE_GSSAPI_H
-#include <gssapi.h>
-#endif
-#elif USE_GNUGSS
 #if HAVE_GSS_H
 #include <gss.h>
 #endif
-#else
 #if USE_APPLE_KRB5
 #define GSSKRB_APPLE_DEPRECATED(x)
 #endif
@@ -202,7 +185,6 @@ AC_DEFUN([SQUID_CHECK_SPNEGO_SUPPORT], [
 #if HAVE_GSSAPI_GSSAPI_GENERIC_H
 #include <gssapi/gssapi_generic.h>
 #endif
-#endif
 #include <string.h>
 int main(int argc, char *argv[]) {
  OM_uint32 major_status,minor_status;
index 9250d73dc034ae7261af3afb2f36bd79cbfdab6a..e4569726e5f82b15761f7f317cb18ff598e787a8 100644 (file)
@@ -1544,56 +1544,24 @@ AS_IF([test "x$with_heimdal_krb5" != "xno" -a "x$KRB5LIBS" = "x"],[
   SQUID_STATE_ROLLBACK([squid_krb5_save])
 ])
 
-dnl User may specify GNU gss is needed from a non-standard location
-SQUID_AUTO_LIB(gnugss,[GNU gss],[LIB_KRB5])
-AH_TEMPLATE(USE_GNUGSS,[GNU gss support is available])
-AS_IF([test "x$with_gnugss" != "xno" -a "x$KRB5LIBS" = "x"],[
-  CXXFLAGS="$LIB_KRB5_CFLAGS $CXXFLAGS"
-  krb5confpath=
-  SQUID_STATE_SAVE([squid_krb5_save])
-  LIBS="$LIBS $LIB_KRB5_PATH"
-
-  # auto-detect using pkg-config
-  PKG_CHECK_MODULES([LIB_KRB5],[gss],,[
-    ## For some OS pkg-config is broken or unavailable.
-    ## Detect libraries the hard way.
-
-    AC_MSG_NOTICE([Try to find Kerberos libraries in given path])
-    AC_CHECK_LIB(gss, [main], [LIB_KRB5_LIBS="-lgss $LIB_KRB5_LIBS"],[
-      AC_MSG_WARN([library 'com_err' is required for GNU Kerberos])
-    ])
-  ])
-
-  AS_IF([test "x$LIB_KRB5_LIBS" != "x"],[
-    KRB5LIBS="$LIB_KRB5_PATH $LIB_KRB5_LIBS $KRB5LIBS"
-    KRB5INCS="$LIB_KRB5_CFLAGS"
-    AC_DEFINE(USE_GNUGSS,1,[GNU Kerberos support is available])
-    KRB5_FLAVOUR="GNU GSS"
-
-    # check for other specific broken implementations
-    CXXFLAGS="$CXXFLAGS $KRB5INCS"
-    LIBS="$LIBS $KRB5LIBS"
-
-    AC_MSG_NOTICE([Try to find Kerbeors headers in given path])
-    AC_CHECK_HEADERS(gss.h)
-
-    SQUID_CHECK_WORKING_GSSAPI
-    SQUID_DEFINE_BOOL(HAVE_GSSAPI,$squid_cv_working_gssapi,[GSSAPI support])
-
-    SQUID_CHECK_SPNEGO_SUPPORT
-    SQUID_DEFINE_BOOL(HAVE_SPNEGO,$squid_cv_have_spnego,[SPNEGO support])
-
-    SQUID_CHECK_WORKING_KRB5
-    SQUID_DEFINE_BOOL(HAVE_KRB5,$squid_cv_working_krb5,[KRB5 support])
-  ])
+# Kerberos support libraries: GNU GSS
+SQUID_AUTO_LIB(gss,[GNU gss],[LIBGSS])
+SQUID_CHECK_LIB_WORKS(gss,[
   AS_IF([test "x$KRB5LIBS" = "x"],[
-    AS_IF([test "x$with_gnugss" = "xyes"],[
-      AC_MSG_ERROR([Required GNU GSS Kerberos library not found])
-    ],[
-      AC_MSG_WARN([GNU GSS Kerberos library not found])
-    ])
+    SQUID_STATE_SAVE(squid_gss_save)
+    PKG_CHECK_MODULES([LIBGSS],[gss],[
+      CPPFLAGS="$LIBGSS_CFLAGS $CPPFLAGS"
+      AC_CHECK_HEADERS(gss.h)
+      LIBS="$LIBGSS_PATH $LIBS"
+      SQUID_CHECK_WORKING_GSSAPI
+      SQUID_DEFINE_BOOL(HAVE_GSSAPI,$squid_cv_working_gssapi,[GSSAPI support])
+      SQUID_CHECK_SPNEGO_SUPPORT
+      SQUID_DEFINE_BOOL(HAVE_SPNEGO,$squid_cv_have_spnego,[SPNEGO support])
+      SQUID_CHECK_WORKING_KRB5
+      SQUID_DEFINE_BOOL(HAVE_KRB5,$squid_cv_working_krb5,[KRB5 support])
+    ],[:])
+    SQUID_STATE_ROLLBACK(squid_gss_save)
   ])
-  SQUID_STATE_ROLLBACK([squid_krb5_save])
 ])
 
 AS_IF([test "x$KRB5LIBS" != "x"],[with_krb5=yes])
index a130f54417c0456db16061aa2fb975bd175f605d..a839fc679d4e6753ceae0871ab49ab0e38f06544 100644 (file)
@@ -188,6 +188,9 @@ This section gives an account of those changes in three categories:
 <sect1>New options<label id="newoptions">
 <p>
 <descrip>
+       <tag>--without-gss</tag>
+       <p>Renamed from <em>--without-gnugss</em>.
+
        <tag>--without-psapi</tag>
        <p>Disable auto-detection of Windows PSAPI library.
 
@@ -213,6 +216,9 @@ This section gives an account of those changes in three categories:
        <tag>--enable-cachemgr-hostname=</tag>
        <p>The <em>cachemgr.cgi</em> tool this option relates to has been removed.
 
+       <tag>--without-gnugss</tag>
+       <p>Renamed to <em>--without-gss</em>.
+
        <tag>CPPFLAGS=-DHEADERS_LOG</tag>
        <p>The code enabled by this preprocessor macro has not built for many
           years, indicating that the feature is unused.
index 8ab39e030361f47dd0566fd6b54fa587806bf331..52e95b741dc73f462fe0c0778c815ab6ca2eab12 100644 (file)
--- a/squid.dox
+++ b/squid.dox
@@ -2080,7 +2080,6 @@ PREDEFINED             = __cplusplus \
                          USE_ECAP \
                          USE_ERR_LOCALES \
                          USE_EPOLL \
-                         USE_GNUGSS \
                          USE_GNUTLS \
                          USE_HEIMDAL_KRB5 \
                          USE_HEXDUMP \
index 1882e055bb225f2908714daf4033c5801e163285..6a72faa810ef3fcca0f152b8502bbc884ddac059 100644 (file)
@@ -531,6 +531,7 @@ squid_LDADD = \
        $(KRB5LIBS) \
        $(LIBSYSTEMD_LIBS) \
        $(COMPAT_LIB) \
+       $(LIBGSS_LIBS) \
        $(LIBNETTLE_LIBS) \
        $(LIBPSAPI_LIBS) \
        $(XTRA_LIBS)
@@ -1976,6 +1977,7 @@ tests_test_http_range_LDADD = \
        $(LIBCPPUNIT_LIBS) \
        $(LIBSYSTEMD_LIBS) \
        $(COMPAT_LIB) \
+       $(LIBGSS_LIBS) \
        $(LIBNETTLE_LIBS) \
        $(LIBPSAPI_LIBS) \
        $(XTRA_LIBS)
@@ -2359,6 +2361,7 @@ tests_testHttpRequest_LDADD = \
        $(LIBCPPUNIT_LIBS) \
        $(LIBSYSTEMD_LIBS) \
        $(COMPAT_LIB) \
+       $(LIBGSS_LIBS) \
        $(LIBNETTLE_LIBS) \
        $(LIBPSAPI_LIBS) \
        $(XTRA_LIBS)
@@ -2655,6 +2658,7 @@ tests_testCacheManager_LDADD = \
        $(LIBCPPUNIT_LIBS) \
        $(LIBSYSTEMD_LIBS) \
        $(COMPAT_LIB) \
+       $(LIBGSS_LIBS) \
        $(LIBNETTLE_LIBS) \
        $(LIBPSAPI_LIBS) \
        $(XTRA_LIBS)
index 5827be50db41dc9c4d4a515189108c8ad230df3c..a2c7af626c8354d12d2ecafa70b897f5f6c17ec2 100644 (file)
@@ -36,6 +36,7 @@ ext_kerberos_ldap_group_acl_LDFLAGS =
 ext_kerberos_ldap_group_acl_LDADD = \
        $(top_builddir)/lib/libmiscencoding.la \
        $(COMPAT_LIB) \
+       $(LIBGSS_LIBS) \
        $(LIBLDAP_LIBS) \
        $(LIBSASL) \
        $(KRB5LIBS) \
index d9d8acc3893754b716b457759650f20ec49f8fc4..a8740d4440189de893f576ccd6616a1e02ce18dd 100644 (file)
@@ -25,6 +25,7 @@ negotiate_kerberos_auth_SOURCES = \
 negotiate_kerberos_auth_LDADD= \
        $(top_builddir)/lib/libmiscencoding.la \
        $(COMPAT_LIB) \
+       $(LIBGSS_LIBS) \
        $(LIBNETTLE_LIBS) \
        $(KRB5LIBS) \
        $(XTRA_LIBS)
@@ -34,6 +35,7 @@ negotiate_kerberos_auth_test_SOURCES = \
 negotiate_kerberos_auth_test_LDADD= \
        $(top_builddir)/lib/libmiscencoding.la \
        $(COMPAT_LIB) \
+       $(LIBGSS_LIBS) \
        $(LIBNETTLE_LIBS) \
        $(KRB5LIBS) \
        $(XTRA_LIBS)
index 6ea228b24bb43da0e66755807a64f3bb43598f43..c1d5095d37e2066ddc7ba6a74f17d8bd74663b75 100644 (file)
 #include "compat/krb5.h"
 #include "util.h"
 
-#if USE_APPLE_KRB5
-#define GSSKRB_APPLE_DEPRECATED(x)
-#endif
-
-#if USE_HEIMDAL_KRB5
-#if HAVE_GSSAPI_GSSAPI_H
-#include <gssapi/gssapi.h>
-#elif HAVE_GSSAPI_H
-#include <gssapi.h>
-#endif
-#if HAVE_GSSAPI_GSSAPI_KRB5_H
-#include <gssapi/gssapi_krb5.h>
-#endif
-#elif USE_GNUGSS
 #if HAVE_GSS_H
 #include <gss.h>
 #endif
-#else
+
+#if USE_APPLE_KRB5
+#define GSSKRB_APPLE_DEPRECATED(x)
+#endif
 #if HAVE_GSSAPI_GSSAPI_H
 #include <gssapi/gssapi.h>
 #elif HAVE_GSSAPI_H
@@ -83,7 +72,6 @@
 #if HAVE_GSSAPI_GSSAPI_EXT_H
 #include <gssapi/gssapi_ext.h>
 #endif
-#endif
 
 #ifndef gss_nt_service_name
 #define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE
index a9eb6786586bf41ba9aad052ab7faf84644fc891..e604c4b04733f72bef01a5ee68820e3c27b9811f 100644 (file)
 #include "squid.h"
 
 #if HAVE_GSSAPI
-#if USE_APPLE_KRB5
-#define GSSKRB_APPLE_DEPRECATED(x)
-#endif
-
 #include <cerrno>
 #include <cstring>
 #include <ctime>
 #include "base64.h"
 #include "util.h"
 
-#if USE_HEIMDAL_KRB5
-#if HAVE_GSSAPI_GSSAPI_H
-#include <gssapi/gssapi.h>
-#elif HAVE_GSSAPI_H
-#include <gssapi.h>
-#endif
-#elif USE_GNUGSS
 #if HAVE_GSS_H
 #include <gss.h>
 #endif
-#else
+
+#if USE_APPLE_KRB5
+#define GSSKRB_APPLE_DEPRECATED(x)
+#endif
 #if HAVE_GSSAPI_GSSAPI_H
 #include <gssapi/gssapi.h>
 #elif HAVE_GSSAPI_H
@@ -75,7 +67,6 @@
 #if HAVE_GSSAPI_GSSAPI_EXT_H
 #include <gssapi/gssapi_ext.h>
 #endif
-#endif
 
 #ifndef gss_nt_service_name
 #define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE