From 5607082286693c1817d1aff87cfbd28ef8b646ac Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Wed, 10 Dec 2025 16:37:44 +1300 Subject: [PATCH 1/3] Polish SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE macro --- acinclude/krb5.m4 | 47 +++++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/acinclude/krb5.m4 b/acinclude/krb5.m4 index 156c6a25980..29fc696a38c 100644 --- a/acinclude/krb5.m4 +++ b/acinclude/krb5.m4 @@ -5,6 +5,27 @@ ## Please see the COPYING and CONTRIBUTORS files for details. ## +dnl check whether the Kerberos context has a memory cache +AC_DEFUN([SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE],[ + AC_REQUIRE([SQUID_STATE_SAVE]) + AC_REQUIRE([SQUID_STATE_ROLLBACK]) + AC_REQUIRE([SQUID_DEFINE_BOOL]) + AC_CACHE_CHECK([for Kerberos context memory cache],squid_cv_krb5_memory_cache,[ + SQUID_STATE_SAVE(squid_krb5_test) + CPPFLAGS="-I${srcdir:-.} $CPPFLAGS" + AC_RUN_IFELSE([ + AC_LANG_SOURCE([[#include "compat/krb5.h"]],[[ + krb5_context c; + krb5_ccache cc; + krb5_init_context(&c); + return krb5_cc_resolve(c, "MEMORY:test_cache", &cc); + ]]) + ],[squid_cv_krb5_memory_cache=yes],[squid_cv_krb5_memory_cache=no],[:]) + SQUID_STATE_ROLLBACK(squid_krb5_test) + ]) + SQUID_DEFINE_BOOL(HAVE_KRB5_MEMORY_CACHE,$squid_cv_krb5_memory_cache,[kerberos has MEMORY: cache support]) +]) + AC_DEFUN([SQUID_CHECK_SOLARIS_KRB5],[ # no pkg-config for solaris native Kerberos AS_IF([test "$cross_compiling" = "no" -a "x$with_mit_krb5" != "xyes" -a "x$with_mit_krb5" != "xno"],[ @@ -42,29 +63,6 @@ AC_DEFUN([SQUID_CHECK_SOLARIS_KRB5],[ ]) ]) -dnl check whether the kerberos context has a memory cache. Sets -dnl squid_cv_memory_cache if that's the case. -AC_DEFUN([SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE],[ - AC_CACHE_CHECK([for memory cache], squid_cv_memory_cache, [ - SQUID_STATE_SAVE(squid_krb5_test) - CPPFLAGS="-I${srcdir:-.} $CPPFLAGS" - AC_RUN_IFELSE([ - AC_LANG_SOURCE([[ -#include "compat/krb5.h" -int main(int argc, char *argv[]) -{ - krb5_context context; - krb5_ccache cc; - - krb5_init_context(&context); - return krb5_cc_resolve(context, "MEMORY:test_cache", &cc); -} - ]]) - ], [ squid_cv_memory_cache=yes ], [ squid_cv_memory_cache=no ], [:]) - SQUID_STATE_ROLLBACK(squid_krb5_test) - ]) -]) - dnl check whether the kerberos context has a memory keytab. Sets dnl squid_cv_memory_keytab if that's the case. AC_DEFUN([SQUID_CHECK_KRB5_CONTEXT_MEMORY_KEYTAB],[ @@ -275,9 +273,6 @@ AC_DEFUN([SQUID_CHECK_KRB5_FUNCS],[ SQUID_STATE_ROLLBACK(squid_krb5_test) SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE - SQUID_DEFINE_BOOL(HAVE_KRB5_MEMORY_CACHE,$squid_cv_memory_cache, - [Define if kerberos has MEMORY: cache support]) - SQUID_CHECK_KRB5_CONTEXT_MEMORY_KEYTAB SQUID_DEFINE_BOOL(HAVE_KRB5_MEMORY_KEYTAB,$squid_cv_memory_keytab, [Define if kerberos has MEMORY: keytab support]) From 31d6c73f0557bdf3aadff62001a4f5e130bc6619 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Wed, 10 Dec 2025 16:56:29 +1300 Subject: [PATCH 2/3] Add missing dnl trailer --- acinclude/krb5.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acinclude/krb5.m4 b/acinclude/krb5.m4 index 29fc696a38c..5ff653ea988 100644 --- a/acinclude/krb5.m4 +++ b/acinclude/krb5.m4 @@ -24,7 +24,7 @@ AC_DEFUN([SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE],[ SQUID_STATE_ROLLBACK(squid_krb5_test) ]) SQUID_DEFINE_BOOL(HAVE_KRB5_MEMORY_CACHE,$squid_cv_krb5_memory_cache,[kerberos has MEMORY: cache support]) -]) +]) dnl SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE AC_DEFUN([SQUID_CHECK_SOLARIS_KRB5],[ # no pkg-config for solaris native Kerberos From b3d06e9142d43b4b3b4707d43c6026d233785c91 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Wed, 10 Dec 2025 17:34:40 +1300 Subject: [PATCH 3/3] Fix copy-n-paste typo --- acinclude/krb5.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acinclude/krb5.m4 b/acinclude/krb5.m4 index 5ff653ea988..a09cabd6454 100644 --- a/acinclude/krb5.m4 +++ b/acinclude/krb5.m4 @@ -14,7 +14,7 @@ AC_DEFUN([SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE],[ SQUID_STATE_SAVE(squid_krb5_test) CPPFLAGS="-I${srcdir:-.} $CPPFLAGS" AC_RUN_IFELSE([ - AC_LANG_SOURCE([[#include "compat/krb5.h"]],[[ + AC_LANG_PROGRAM([[#include "compat/krb5.h"]],[[ krb5_context c; krb5_ccache cc; krb5_init_context(&c);