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 <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
This commit is contained in:
Andrew Deason 2022-09-13 12:23:22 -05:00 committed by Benjamin Kaduk
parent f81b01de1a
commit 799209396b

View File

@ -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],