From 799209396bd818e9545044392beaf037e5d1e16e Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Tue, 13 Sep 2022 12:23:22 -0500 Subject: [PATCH] cf: Skip RRA_LIB_GSSAPI if krb5/gss is disabled Currently, we always run RRA_LIB_GSSAPI during configure, even if we already detected that there is no libkrb5 available or --without-gssapi was given. This means that no matter what options the user passes, 'configure' throws an error if we can't find a usable gssapi library. Our logic in gss.m4 is structured similarly to krb5.m4, which assumes that the probing macro (RRA_LIB_KRB5_OPTIONAL / RRA_LIB_GSSAPI) does effectively nothing if the relevant library is not available. But RRA_LIB_GSSAPI behaves like RRA_LIB_KRB5, not RRA_LIB_KRB5_OPTIONAL, in that it throws an error and stops 'configure' if it cannot find a usable gssapi library. (Currently, there is no RRA_LIB_GSSAPI_OPTIONAL macro like there is for krb5.) To fix this, just skip RRA_LIB_GSSAPI if we've already detected that there is no krb5 library available, or if gss has been explicitly disabled with --without-gssapi. Based on a commit by cwills@sinenomine.net. Change-Id: I08951a9b78f5edb88018cd3991b0213561ff94b2 Reviewed-on: https://gerrit.openafs.org/15138 Tested-by: BuildBot Reviewed-by: Cheyenne Wills Reviewed-by: Benjamin Kaduk --- src/cf/gss.m4 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/cf/gss.m4 b/src/cf/gss.m4 index 002685e05b..896b1edee7 100644 --- a/src/cf/gss.m4 +++ b/src/cf/gss.m4 @@ -1,6 +1,16 @@ AC_DEFUN([OPENAFS_GSS], + [ dnl Probe for GSSAPI - [RRA_LIB_GSSAPI +dnl +dnl Don't do this if we don't have krb5. Otherwise, if someone runs configure +dnl with no arguments on a system without krb5 libs, RRA_LIB_GSSAPI will fail, +dnl preventing the build from moving forwards. +dnl +dnl Also don't probe for GSSAPI if --without-gssapi was given, so we don't +dnl accidentally autodetect gss libs and use them. + AS_IF([test x"$BUILD_KRB5" = xyes && test x"$with_gssapi" != xno], + [RRA_LIB_GSSAPI]) + dnl Check for the characteristics of whatever GSSAPI we found, if we found one BUILD_GSSAPI=no AS_IF([test x"$GSSAPI_LIBS" != x],