summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2019-01-17 20:20:37 +0100
committerFabian Groffen <grobian@gentoo.org>2019-01-17 20:20:50 +0100
commit04ac4d11d8c0bd7a9a5b7deb35de4592cc55744b (patch)
tree1076798f3c91831ce0a80b0653c3d2bd16eaf80d
parentmedia-sound/aeolus: amd64 stable wrt bug #673662 (diff)
downloadgentoo-04ac4d11d8c0bd7a9a5b7deb35de4592cc55744b.tar.gz
gentoo-04ac4d11d8c0bd7a9a5b7deb35de4592cc55744b.tar.bz2
gentoo-04ac4d11d8c0bd7a9a5b7deb35de4592cc55744b.zip
dev-libs/cyrus-sasl: fix build on systems lacking memmem
Signed-off-by: Fabian Groffen <grobian@gentoo.org> Package-Manager: Portage-2.3.51, Repoman-2.3.11
-rw-r--r--dev-libs/cyrus-sasl/cyrus-sasl-2.1.27-r1.ebuild1
-rw-r--r--dev-libs/cyrus-sasl/files/cyrus-sasl-2.1.27-memmem.patch53
2 files changed, 54 insertions, 0 deletions
diff --git a/dev-libs/cyrus-sasl/cyrus-sasl-2.1.27-r1.ebuild b/dev-libs/cyrus-sasl/cyrus-sasl-2.1.27-r1.ebuild
index 707e90d46a2..1b0e7ee417d 100644
--- a/dev-libs/cyrus-sasl/cyrus-sasl-2.1.27-r1.ebuild
+++ b/dev-libs/cyrus-sasl/cyrus-sasl-2.1.27-r1.ebuild
@@ -52,6 +52,7 @@ PATCHES=(
"${FILESDIR}/${PN}-2.1.27-gss_c_nt_hostbased_service.patch"
"${FILESDIR}/${PN}-2.1.26-missing-size_t.patch"
"${FILESDIR}/${PN}-2.1.27-doc_build_fix.patch"
+ "${FILESDIR}/${PN}-2.1.27-memmem.patch"
)
pkg_setup() {
diff --git a/dev-libs/cyrus-sasl/files/cyrus-sasl-2.1.27-memmem.patch b/dev-libs/cyrus-sasl/files/cyrus-sasl-2.1.27-memmem.patch
new file mode 100644
index 00000000000..158529dcb5f
--- /dev/null
+++ b/dev-libs/cyrus-sasl/files/cyrus-sasl-2.1.27-memmem.patch
@@ -0,0 +1,53 @@
+auth_rimap: provide naive memmem implementation if missing
+
+read_response uses memmem, which is not available on e.g. Solaris 10
+
+Bug: https://github.com/cyrusimap/cyrus-sasl/pull/551
+Signed-off-by: Fabian Groffen <grobian@gentoo.org>
+
+--- a/saslauthd/auth_rimap.c
++++ b/saslauthd/auth_rimap.c
+@@ -367,6 +367,32 @@
+ /* END FUNCTION: process_login_reply */
+
+
++#ifndef HAVE_MEMMEM
++static void *memmem(
++ const void *big, size_t big_len,
++ const void *little, size_t little_len)
++{
++ const char *bp = (const char *)big;
++ const char *lp = (const char *)little;
++ size_t l;
++
++ if (big_len < little_len || little_len == 0 || big_len == 0)
++ return NULL;
++
++ while (big_len > 0) {
++ for (l = 0; l < little_len; l++) {
++ if (bp[l] != lp[l])
++ break;
++ }
++ if (l == little_len)
++ return (void *)bp;
++ bp++;
++ }
++
++ return NULL;
++}
++#endif
++
+ static int read_response(int s, char *rbuf, int buflen, const char *tag)
+ {
+ int rc = 0;
+--- a/configure.ac
++++ b/configure.ac
+@@ -1292,7 +1292,7 @@
+
+ #AC_FUNC_MEMCMP
+ #AC_FUNC_VPRINTF
+-AC_CHECK_FUNCS(gethostname getdomainname getpwnam getspnam gettimeofday inet_aton memcpy mkdir select socket strchr strdup strerror strspn strstr strtol jrand48 getpassphrase asprintf strlcat strlcpy)
++AC_CHECK_FUNCS(gethostname getdomainname getpwnam getspnam gettimeofday inet_aton memcpy memmem mkdir select socket strchr strdup strerror strspn strstr strtol jrand48 getpassphrase asprintf strlcat strlcpy)
+
+ if test $ac_cv_func_getspnam = yes; then
+ AC_MSG_CHECKING(if getpwnam_r/getspnam_r take 5 arguments)