Skip to content

Commit dee8c6d

Browse files
committed
PHPC-1185: Revert support for building with GSSAPI
libmongoc does not actually support GSSAPI (CDRIVER-2170), so we should not allow building with it. This also reverts preference for the GSS framework on macOS (PHPC-1142).
1 parent 9f5f19c commit dee8c6d

File tree

1 file changed

+9
-41
lines changed

1 file changed

+9
-41
lines changed
Lines changed: 9 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
PHP_ARG_WITH([mongodb-sasl],
22
[whether to enable SASL for Kerberos authentication],
3-
[AS_HELP_STRING([--with-mongodb-sasl=@<:@auto/no/cyrus/gssapi@:>@],
3+
[AS_HELP_STRING([--with-mongodb-sasl=@<:@auto/no/cyrus@:>@],
44
[MongoDB: Enable SASL for Kerberos authentication [default=auto]])],
55
[auto],
66
[no])
77

8-
AS_IF([test "$os_darwin" = "yes" -a \( "$PHP_MONGODB_SASL" = "gssapi" -o "$PHP_MONGODB_SASL" = "auto" \)],[
9-
dnl PHP_FRAMEWORKS is only used for SAPI builds, so use MONGODB_SHARED_LIBADD for shared builds
10-
if test "$ext_shared" = "yes"; then
11-
MONGODB_SHARED_LIBADD="-framework GSS $MONGODB_SHARED_LIBADD"
12-
else
13-
PHP_ADD_FRAMEWORK([GSS])
14-
fi
15-
PHP_MONGODB_SASL="gssapi"
16-
])
17-
188
AS_IF([test "$PHP_MONGODB_SASL" = "cyrus" -o "$PHP_MONGODB_SASL" = "auto"],[
199
found_cyrus="no"
2010
@@ -45,54 +35,32 @@ AS_IF([test "$PHP_MONGODB_SASL" = "cyrus" -o "$PHP_MONGODB_SASL" = "auto"],[
4535
fi
4636
])
4737

48-
AS_IF([test "$PHP_MONGODB_SASL" = "gssapi" -o "$PHP_MONGODB_SASL" = "auto"],[
49-
found_gssapi="no"
50-
51-
PKG_CHECK_MODULES([PHP_MONGODB_SASL],[krb5-gssapi],[
52-
PHP_MONGODB_MONGOC_CFLAGS="$PHP_MONGODB_MONGOC_CFLAGS $PHP_MONGODB_SASL_CFLAGS"
53-
PHP_EVAL_LIBLINE([$PHP_MONGODB_SASL_LIBS],[MONGODB_SHARED_LIBADD])
54-
PHP_MONGODB_SASL="gssapi"
55-
found_gssapi="yes"
56-
])
57-
58-
if test "$PHP_MONGODB_SASL" = "gssapi" -a "$found_gssapi" != "yes"; then
59-
AC_MSG_ERROR([GSSAPI libraries and development headers could not be found])
60-
fi
61-
])
62-
6338
AS_IF([test "$PHP_MONGODB_SASL" = "auto"],[
6439
PHP_MONGODB_SASL="no"
6540
])
6641

6742
dnl Warn for unsupported values (e.g. Cyrus SASL search path)
68-
if test ! \( "$PHP_MONGODB_SASL" = "cyrus" -o "$PHP_MONGODB_SASL" = "gssapi" -o "$PHP_MONGODB_SASL" = "no" \); then
43+
if test ! \( "$PHP_MONGODB_SASL" = "cyrus" -o "$PHP_MONGODB_SASL" = "no" \); then
6944
AC_MSG_WARN([unsupported --with-mongodb-sasl value: $PHP_MONGODB_SASL])
7045
fi
7146

7247
AC_MSG_CHECKING([which SASL library to use])
7348
AC_MSG_RESULT([$PHP_MONGODB_SASL])
7449

75-
dnl Disable Windows SSPI
50+
dnl Disable Windows SSPI and GSSAPI
7651
AC_SUBST(MONGOC_ENABLE_SASL_SSPI, 0)
52+
AC_SUBST(MONGOC_ENABLE_SASL_GSSAPI, 0)
7753

78-
if test "$PHP_MONGODB_SASL" = "cyrus" -o "$PHP_MONGODB_SASL" = "gssapi"; then
54+
if test "$PHP_MONGODB_SASL" = "cyrus"; then
7955
AC_SUBST(MONGOC_ENABLE_SASL, 1)
80-
if test "$PHP_MONGODB_SASL" = "cyrus" ; then
81-
AC_SUBST(MONGOC_ENABLE_SASL_CYRUS, 1)
82-
AC_SUBST(MONGOC_ENABLE_SASL_GSSAPI, 0)
83-
if test "x$have_sasl_client_done" = "xyes"; then
84-
AC_SUBST(MONGOC_HAVE_SASL_CLIENT_DONE, 1)
85-
else
86-
AC_SUBST(MONGOC_HAVE_SASL_CLIENT_DONE, 0)
87-
fi
88-
elif test "$PHP_MONGODB_SASL" = "gssapi"; then
89-
AC_SUBST(MONGOC_ENABLE_SASL_CYRUS, 0)
90-
AC_SUBST(MONGOC_ENABLE_SASL_GSSAPI, 1)
56+
AC_SUBST(MONGOC_ENABLE_SASL_CYRUS, 1)
57+
if test "x$have_sasl_client_done" = "xyes"; then
58+
AC_SUBST(MONGOC_HAVE_SASL_CLIENT_DONE, 1)
59+
else
9160
AC_SUBST(MONGOC_HAVE_SASL_CLIENT_DONE, 0)
9261
fi
9362
else
9463
AC_SUBST(MONGOC_ENABLE_SASL, 0)
9564
AC_SUBST(MONGOC_ENABLE_SASL_CYRUS, 0)
96-
AC_SUBST(MONGOC_ENABLE_SASL_GSSAPI, 0)
9765
AC_SUBST(MONGOC_HAVE_SASL_CLIENT_DONE, 0)
9866
fi

0 commit comments

Comments
 (0)