forked from infinyon/rust-sasl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sasl2-sys: don't fail cross compiling on SPNEGO check
Also rework how patches are handled, since we've accumulated quite a few now.
- Loading branch information
Showing
9 changed files
with
224 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,6 @@ indent_size = 4 | |
|
||
[*.yml] | ||
indent_size = 2 | ||
|
||
[*.patch] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Despite how this looks, this *disables* maintainer mode by default, which has | ||
the desired effect of avoiding automatic rebuilds of autotools scripts. | ||
(Checking autotools scripts into Git, like we do in this repository, will often | ||
causes the outputs to look out of date relative to the inputs even when they are | ||
not, and we don't want to force the autotools dependency on our users.) | ||
|
||
diff --git a/configure.ac b/configure.ac | ||
index 388f5d0..b3db52c 100644 | ||
--- a/configure.ac | ||
+++ b/configure.ac | ||
@@ -69,6 +69,8 @@ AC_CANONICAL_TARGET | ||
|
||
AM_INIT_AUTOMAKE([1.11 tar-ustar dist-bzip2 foreign -Wno-portability subdir-objects]) | ||
|
||
+AM_MAINTAINER_MODE | ||
+ | ||
DIRS="" | ||
|
||
AC_ARG_ENABLE(cmulocal, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
TODO(benesch): determine why this patch was landed upstream. | ||
|
||
commit 811efe35b8d8961061525e47c6a2d393813384b2 | ||
Author: Nikhil Benesch <[email protected]> | ||
Date: Tue Apr 28 16:06:30 2020 -0400 | ||
|
||
Revert "Fixes https://github.com/cyrusimap/cyrus-sasl/issues/440" | ||
|
||
This reverts commit 19185d278cdbf02a43b1f8da1f76a97ca274e12f. Upstream | ||
provided no justification for this patch, and parts of it are necessary | ||
for building libkrb5 statically. | ||
|
||
diff --git a/m4/sasl2.m4 b/m4/sasl2.m4 | ||
index 56e0504..59b1349 100644 | ||
--- a/m4/sasl2.m4 | ||
+++ b/m4/sasl2.m4 | ||
@@ -116,9 +116,12 @@ if test "$gssapi" != no; then | ||
fi | ||
|
||
if test "$gss_impl" = "auto" -o "$gss_impl" = "mit"; then | ||
+ # check for libkrb5support first | ||
+ AC_CHECK_LIB(krb5support,krb5int_getspecific,K5SUP=-lkrb5support K5SUPSTATIC=$gssapi_dir/libkrb5support.a,,${LIB_SOCKET}) | ||
+ | ||
gss_failed=0 | ||
AC_CHECK_LIB(gssapi_krb5,gss_unwrap,gss_impl="mit",gss_failed=1, | ||
- ${GSSAPIBASE_LIBS} -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${LIB_SOCKET}) | ||
+ ${GSSAPIBASE_LIBS} -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${K5SUP} ${LIB_SOCKET}) | ||
if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then | ||
gss_impl="failed" | ||
fi | ||
@@ -170,8 +173,8 @@ if test "$gssapi" != no; then | ||
fi | ||
|
||
if test "$gss_impl" = "mit"; then | ||
- GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err" | ||
- GSSAPIBASE_STATIC_LIBS="$GSSAPIBASE_LIBS $gssapi_dir/libgssapi_krb5.a $gssapi_dir/libkrb5.a $gssapi_dir/libk5crypto.a $gssapi_dir/libcom_err.a" | ||
+ GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${K5SUP}" | ||
+ GSSAPIBASE_STATIC_LIBS="$GSSAPIBASE_LIBS $gssapi_dir/libgssapi_krb5.a $gssapi_dir/libkrb5.a $gssapi_dir/libk5crypto.a $gssapi_dir/libcom_err.a ${K5SUPSTATIC}" | ||
elif test "$gss_impl" = "heimdal"; then | ||
CPPFLAGS="$CPPFLAGS" | ||
GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
commit a489bd545a6f48f666a22f9668649c7ba9076633 | ||
Author: Nikhil Benesch <[email protected]> | ||
Date: Tue Apr 28 16:14:26 2020 -0400 | ||
|
||
Link against resolv and dl when testing for libkrb5 | ||
|
||
These are required for the link to succeed if krb5 has been built | ||
statically. | ||
|
||
diff --git a/m4/sasl2.m4 b/m4/sasl2.m4 | ||
index 59b1349..456d121 100644 | ||
--- a/m4/sasl2.m4 | ||
+++ b/m4/sasl2.m4 | ||
@@ -121,7 +121,7 @@ if test "$gssapi" != no; then | ||
|
||
gss_failed=0 | ||
AC_CHECK_LIB(gssapi_krb5,gss_unwrap,gss_impl="mit",gss_failed=1, | ||
- ${GSSAPIBASE_LIBS} -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${K5SUP} ${LIB_SOCKET}) | ||
+ ${GSSAPIBASE_LIBS} -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${K5SUP} -lresolv -ldl ${LIB_SOCKET}) | ||
if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then | ||
gss_impl="failed" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
commit e022829b6ef295bc9c86437476fc3369596f13ca | ||
Author: Nikhil Benesch <[email protected]> | ||
Date: Tue Apr 28 16:24:18 2020 -0400 | ||
|
||
Don't fail cross compilation on SPNEGO check | ||
|
||
Also allow overriding the default with a cache value. | ||
|
||
diff --git a/m4/sasl2.m4 b/m4/sasl2.m4 | ||
index 456d121..5c06b21 100644 | ||
--- a/m4/sasl2.m4 | ||
+++ b/m4/sasl2.m4 | ||
@@ -318,7 +318,7 @@ if test "$gssapi" != no; then | ||
LIBS="$LIBS $GSSAPIBASE_LIBS" | ||
|
||
AC_MSG_CHECKING([for SPNEGO support in GSSAPI libraries]) | ||
- AC_TRY_RUN([ | ||
+ AC_CACHE_VAL(sasl_cv_have_gss_spnego, AC_TRY_RUN([ | ||
#ifdef HAVE_GSSAPI_H | ||
#include <gssapi.h> | ||
#else | ||
@@ -342,7 +342,8 @@ int main(void) | ||
], | ||
[ AC_DEFINE(HAVE_GSS_SPNEGO,,[Define if your GSSAPI implementation supports SPNEGO]) | ||
AC_MSG_RESULT(yes) ], | ||
- AC_MSG_RESULT(no)) | ||
+ AC_MSG_RESULT(no), | ||
+ AC_MSG_WARN(cannot check when cross compiling so conservatively assuming no))) | ||
LIBS="$cmu_save_LIBS" | ||
|
||
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
Upstream incorrectly uses `ifdef PIC` to mean "building a shared library" | ||
and the inverse to mean "building a static library." Rust requires that | ||
we build static libraries with PIC, so we go fix up all these ifdefs | ||
appropriately. | ||
|
||
diff --git a/lib/dlopen.c b/lib/dlopen.c | ||
index 8284cd8..cea0387 100644 | ||
--- a/lib/dlopen.c | ||
+++ b/lib/dlopen.c | ||
@@ -56,10 +56,8 @@ | ||
#include <sasl.h> | ||
#include "saslint.h" | ||
|
||
-#ifndef PIC | ||
#include <saslplug.h> | ||
#include "staticopen.h" | ||
-#endif | ||
|
||
#ifdef DO_DLOPEN | ||
#if HAVE_DIRENT_H | ||
@@ -414,11 +412,9 @@ int _sasl_load_plugins(const add_plugin_list_t *entrypoints, | ||
DIR *dp; | ||
struct dirent *dir; | ||
#endif | ||
-#ifndef PIC | ||
add_plugin_t *add_plugin; | ||
_sasl_plug_type type; | ||
_sasl_plug_rec *p; | ||
-#endif | ||
|
||
if (! entrypoints | ||
|| ! getpath_cb | ||
@@ -429,7 +425,6 @@ int _sasl_load_plugins(const add_plugin_list_t *entrypoints, | ||
|| ! verifyfile_cb->proc) | ||
return SASL_BADPARAM; | ||
|
||
-#ifndef PIC | ||
/* do all the static plugins first */ | ||
|
||
for(cur_ep = entrypoints; cur_ep->entryname; cur_ep++) { | ||
@@ -456,15 +451,8 @@ int _sasl_load_plugins(const add_plugin_list_t *entrypoints, | ||
result = add_plugin(p->name, p->plug); | ||
} | ||
} | ||
-#endif /* !PIC */ | ||
|
||
-/* only do the following if: | ||
- * | ||
- * we support dlopen() | ||
- * AND we are not staticly compiled | ||
- * OR we are staticly compiled and TRY_DLOPEN_WHEN_STATIC is defined | ||
- */ | ||
-#if defined(DO_DLOPEN) && (defined(PIC) || (!defined(PIC) && defined(TRY_DLOPEN_WHEN_STATIC))) | ||
+#if defined(TRY_DLOPEN_WHEN_STATIC) | ||
/* get the path to the plugins */ | ||
result = ((sasl_getpath_t *)(getpath_cb->proc))(getpath_cb->context, | ||
&path); | ||
@@ -545,7 +533,7 @@ int _sasl_load_plugins(const add_plugin_list_t *entrypoints, | ||
} | ||
|
||
} while ((c!='=') && (c!=0)); | ||
-#endif /* defined(DO_DLOPEN) && (!defined(PIC) || (defined(PIC) && defined(TRY_DLOPEN_WHEN_STATIC))) */ | ||
+#endif | ||
|
||
return SASL_OK; | ||
} | ||
diff --git a/lib/server.c b/lib/server.c | ||
index 8d4c322..7cbd1cb 100644 | ||
--- a/lib/server.c | ||
+++ b/lib/server.c | ||
@@ -823,7 +823,7 @@ int sasl_server_init(const sasl_callback_t *callbacks, | ||
int ret; | ||
const sasl_callback_t *vf; | ||
const char *pluginfile = NULL; | ||
-#ifdef PIC | ||
+#if false | ||
sasl_getopt_t *getopt; | ||
void *context; | ||
#endif | ||
@@ -894,7 +894,7 @@ int sasl_server_init(const sasl_callback_t *callbacks, | ||
/* load internal plugins */ | ||
sasl_server_add_plugin("EXTERNAL", &external_server_plug_init); | ||
|
||
-#ifdef PIC | ||
+#if false | ||
/* delayed loading of plugins? (DSO only, as it doesn't | ||
* make much [any] sense to delay in the static library case) */ | ||
if (_sasl_getcallback(NULL, SASL_CB_GETOPT, (sasl_callback_ft *)&getopt, &context) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.