1 |
commit: 04ac4d11d8c0bd7a9a5b7deb35de4592cc55744b |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 17 19:20:37 2019 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 17 19:20:50 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=04ac4d11 |
7 |
|
8 |
dev-libs/cyrus-sasl: fix build on systems lacking memmem |
9 |
|
10 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
11 |
Package-Manager: Portage-2.3.51, Repoman-2.3.11 |
12 |
|
13 |
dev-libs/cyrus-sasl/cyrus-sasl-2.1.27-r1.ebuild | 1 + |
14 |
.../files/cyrus-sasl-2.1.27-memmem.patch | 53 ++++++++++++++++++++++ |
15 |
2 files changed, 54 insertions(+) |
16 |
|
17 |
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 |
18 |
index 707e90d46a2..1b0e7ee417d 100644 |
19 |
--- a/dev-libs/cyrus-sasl/cyrus-sasl-2.1.27-r1.ebuild |
20 |
+++ b/dev-libs/cyrus-sasl/cyrus-sasl-2.1.27-r1.ebuild |
21 |
@@ -52,6 +52,7 @@ PATCHES=( |
22 |
"${FILESDIR}/${PN}-2.1.27-gss_c_nt_hostbased_service.patch" |
23 |
"${FILESDIR}/${PN}-2.1.26-missing-size_t.patch" |
24 |
"${FILESDIR}/${PN}-2.1.27-doc_build_fix.patch" |
25 |
+ "${FILESDIR}/${PN}-2.1.27-memmem.patch" |
26 |
) |
27 |
|
28 |
pkg_setup() { |
29 |
|
30 |
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 |
31 |
new file mode 100644 |
32 |
index 00000000000..158529dcb5f |
33 |
--- /dev/null |
34 |
+++ b/dev-libs/cyrus-sasl/files/cyrus-sasl-2.1.27-memmem.patch |
35 |
@@ -0,0 +1,53 @@ |
36 |
+auth_rimap: provide naive memmem implementation if missing |
37 |
+ |
38 |
+read_response uses memmem, which is not available on e.g. Solaris 10 |
39 |
+ |
40 |
+Bug: https://github.com/cyrusimap/cyrus-sasl/pull/551 |
41 |
+Signed-off-by: Fabian Groffen <grobian@g.o> |
42 |
+ |
43 |
+--- a/saslauthd/auth_rimap.c |
44 |
++++ b/saslauthd/auth_rimap.c |
45 |
+@@ -367,6 +367,32 @@ |
46 |
+ /* END FUNCTION: process_login_reply */ |
47 |
+ |
48 |
+ |
49 |
++#ifndef HAVE_MEMMEM |
50 |
++static void *memmem( |
51 |
++ const void *big, size_t big_len, |
52 |
++ const void *little, size_t little_len) |
53 |
++{ |
54 |
++ const char *bp = (const char *)big; |
55 |
++ const char *lp = (const char *)little; |
56 |
++ size_t l; |
57 |
++ |
58 |
++ if (big_len < little_len || little_len == 0 || big_len == 0) |
59 |
++ return NULL; |
60 |
++ |
61 |
++ while (big_len > 0) { |
62 |
++ for (l = 0; l < little_len; l++) { |
63 |
++ if (bp[l] != lp[l]) |
64 |
++ break; |
65 |
++ } |
66 |
++ if (l == little_len) |
67 |
++ return (void *)bp; |
68 |
++ bp++; |
69 |
++ } |
70 |
++ |
71 |
++ return NULL; |
72 |
++} |
73 |
++#endif |
74 |
++ |
75 |
+ static int read_response(int s, char *rbuf, int buflen, const char *tag) |
76 |
+ { |
77 |
+ int rc = 0; |
78 |
+--- a/configure.ac |
79 |
++++ b/configure.ac |
80 |
+@@ -1292,7 +1292,7 @@ |
81 |
+ |
82 |
+ #AC_FUNC_MEMCMP |
83 |
+ #AC_FUNC_VPRINTF |
84 |
+-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) |
85 |
++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) |
86 |
+ |
87 |
+ if test $ac_cv_func_getspnam = yes; then |
88 |
+ AC_MSG_CHECKING(if getpwnam_r/getspnam_r take 5 arguments) |