summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-networking/cyrus-sasl
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2022-05-02 07:33:37 -0700
committerKhem Raj <raj.khem@gmail.com>2022-05-02 17:51:58 -0700
commiteaa0fd9c2f91eac8b2e83e7d1a45119613f9ad14 (patch)
tree1ee39fbfea69d0f9909064475eec45e3c1c7a721 /meta-oe/recipes-networking/cyrus-sasl
parent7be928f107e3c11148bc557db41fd6a4438e2421 (diff)
downloadmeta-openembedded-eaa0fd9c2f91eac8b2e83e7d1a45119613f9ad14.tar.gz
cyrus-sasl: move from meta-networking to meta-oe
Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-networking/cyrus-sasl')
-rw-r--r--meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/0001-sample-Rename-dprintf-to-cyrus_dprintf.patch91
-rw-r--r--meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/CVE-2019-19906.patch35
-rw-r--r--meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch26
-rw-r--r--meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch50
-rw-r--r--meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff28
-rw-r--r--meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/saslauthd.conf11
-rw-r--r--meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/saslauthd.service12
-rw-r--r--meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl_2.1.28.bb98
8 files changed, 351 insertions, 0 deletions
diff --git a/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/0001-sample-Rename-dprintf-to-cyrus_dprintf.patch b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/0001-sample-Rename-dprintf-to-cyrus_dprintf.patch
new file mode 100644
index 000000000..4c6d61dfc
--- /dev/null
+++ b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/0001-sample-Rename-dprintf-to-cyrus_dprintf.patch
@@ -0,0 +1,91 @@
1From ade70f39c4aa5a8830462d9ccf3b8f8dd968c0d8 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 28 Feb 2022 11:10:26 -0800
4Subject: [PATCH] sample: Rename dprintf to cyrus_dprintf
5
6This avoids shadowing the dprintf implementations in glibc
7
8Upstream-Status: Pending
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 sample/client.c | 12 ++++++------
12 sample/common.c | 2 +-
13 sample/common.h | 2 +-
14 3 files changed, 8 insertions(+), 8 deletions(-)
15
16diff --git a/sample/client.c b/sample/client.c
17index e723c6b7..6a04f428 100644
18--- a/sample/client.c
19+++ b/sample/client.c
20@@ -241,9 +241,9 @@ int mysasl_negotiate(FILE *in, FILE *out, sasl_conn_t *conn)
21 int r, c;
22
23 /* get the capability list */
24- dprintf(0, "receiving capability list... ");
25+ cyrus_dprintf(0, "receiving capability list... ");
26 len = recv_string(in, buf, sizeof buf);
27- dprintf(0, "%s\n", buf);
28+ cyrus_dprintf(0, "%s\n", buf);
29
30 if (mech) {
31 /* make sure that 'mech' appears in 'buf' */
32@@ -262,7 +262,7 @@ int mysasl_negotiate(FILE *in, FILE *out, sasl_conn_t *conn)
33 return -1;
34 }
35
36- dprintf(1, "using mechanism %s\n", chosenmech);
37+ cyrus_dprintf(1, "using mechanism %s\n", chosenmech);
38
39 /* we send up to 3 strings;
40 the mechanism chosen, the presence of initial response,
41@@ -276,7 +276,7 @@ int mysasl_negotiate(FILE *in, FILE *out, sasl_conn_t *conn)
42 }
43
44 for (;;) {
45- dprintf(2, "waiting for server reply...\n");
46+ cyrus_dprintf(2, "waiting for server reply...\n");
47
48 c = fgetc(in);
49 switch (c) {
50@@ -303,10 +303,10 @@ int mysasl_negotiate(FILE *in, FILE *out, sasl_conn_t *conn)
51 }
52
53 if (data) {
54- dprintf(2, "sending response length %d...\n", len);
55+ cyrus_dprintf(2, "sending response length %d...\n", len);
56 send_string(out, data, len);
57 } else {
58- dprintf(2, "sending null response...\n");
59+ cyrus_dprintf(2, "sending null response...\n");
60 send_string(out, "", 0);
61 }
62 }
63diff --git a/sample/common.c b/sample/common.c
64index 712549fd..d138e450 100644
65--- a/sample/common.c
66+++ b/sample/common.c
67@@ -127,7 +127,7 @@ int recv_string(FILE *f, char *buf, int buflen)
68
69 int debuglevel = 0;
70
71-int dprintf(int lvl, const char *fmt, ...)
72+int cyrus_dprintf(int lvl, const char *fmt, ...)
73 {
74 va_list ap;
75 int ret = 0;
76diff --git a/sample/common.h b/sample/common.h
77index 819d0101..cd56907a 100644
78--- a/sample/common.h
79+++ b/sample/common.h
80@@ -43,7 +43,7 @@ extern int send_string(FILE *f, const char *s, int l);
81 extern int recv_string(FILE *f, char *buf, int buflen);
82
83 extern int debuglevel;
84-extern int dprintf(int lvl, const char *fmt, ...);
85+extern int cyrus_dprintf(int lvl, const char *fmt, ...);
86
87 extern void saslerr(int why, const char *what);
88 extern void saslfail(int why, const char *what);
89--
902.35.1
91
diff --git a/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/CVE-2019-19906.patch b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/CVE-2019-19906.patch
new file mode 100644
index 000000000..33a9e3f6e
--- /dev/null
+++ b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/CVE-2019-19906.patch
@@ -0,0 +1,35 @@
1From 94fe6eb9ea2691f4a7c32fbf2d0c7c454995b666 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Thu, 27 Feb 2020 11:08:57 +0800
4Subject: [PATCH] Fix #587
5
6Off by one error in common.c, CVE-2019-19906.
7
8Thanks to Stephan Zeisberg for reporting
9
10CVE: CVE-2019-19906
11
12Upstream-Stauts: Backport [https://github.com/cyrusimap/cyrus-sasl
13/commit/dcc9f51cbd4ed622cfb0f9b1c141eb2ffe3b12f1]
14
15Signed-off-by: Changqing Li <changqing.li@windriver.com>
16---
17 lib/common.c | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/lib/common.c b/lib/common.c
21index d9104c8..fef82db 100644
22--- a/lib/common.c
23+++ b/lib/common.c
24@@ -190,7 +190,7 @@ int _sasl_add_string(char **out, size_t *alloclen,
25
26 if (add==NULL) add = "(null)";
27
28- addlen=strlen(add); /* only compute once */
29+ addlen=strlen(add)+1; /* only compute once */
30 if (_buf_alloc(out, alloclen, (*outlen)+addlen+1)!=SASL_OK)
31 return SASL_NOMEM;
32
33--
342.25.1
35
diff --git a/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch
new file mode 100644
index 000000000..f172362f4
--- /dev/null
+++ b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch
@@ -0,0 +1,26 @@
1From 188ad4497947259811ad32faeee95c20f9a44046 Mon Sep 17 00:00:00 2001
2From: "Roy.Li" <rongqing.li@windriver.com>
3Date: Fri, 19 Jul 2013 14:29:31 +0800
4Subject: [PATCH] Fix hardcoded libdir.
5
6Upstream-Status: Pending
7
8Signed-off-by: Roy.Li <rongqing.li@windriver.com>
9
10---
11 plugins/Makefile.am | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/plugins/Makefile.am b/plugins/Makefile.am
15index 2b02a52..929f6a4 100644
16--- a/plugins/Makefile.am
17+++ b/plugins/Makefile.am
18@@ -65,7 +65,7 @@ LIB_MYSQL = @LIB_MYSQL@
19
20 plugindir = @plugindir@
21
22-sasldir = $(prefix)/lib/sasl2
23+sasldir = $(libdir)/sasl2
24 sasl_LTLIBRARIES = @SASL_MECHS@
25 EXTRA_LTLIBRARIES = libplain.la libanonymous.la libkerberos4.la libcrammd5.la \
26 libgs2.la libgssapiv2.la libdigestmd5.la liblogin.la libsrp.la libotp.la \
diff --git a/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch
new file mode 100644
index 000000000..1e6f99603
--- /dev/null
+++ b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch
@@ -0,0 +1,50 @@
1From 288430d3c2d3f36a4c9d40c4fffa85288f44549a Mon Sep 17 00:00:00 2001
2From: "Roy.Li" <rongqing.li@windriver.com>
3Date: Tue, 25 Jun 2013 09:22:59 +0800
4Subject: [PATCH] Avoid to call AC_TRY_RUN
5
6Upstream-Status: Inappropriate [configuration]
7
8Avoid to call AC_TRY_RUN to check if GSSAPI libraries support SPNEGO
9on cross-compile environment by definition AC_ARG_ENABLE enable-spnego
10
11Signed-off-by: Roy.Li <rongqing.li@windriver.com>
12---
13 m4/sasl2.m4 | 14 +++++++++++++-
14 1 file changed, 13 insertions(+), 1 deletion(-)
15
16diff --git a/m4/sasl2.m4 b/m4/sasl2.m4
17index 80371ef..ff70083 100644
18--- a/m4/sasl2.m4
19+++ b/m4/sasl2.m4
20@@ -316,6 +316,18 @@ if test "$gssapi" != no; then
21 AC_CACHE_CHECK([for SPNEGO support in GSSAPI libraries],[ac_cv_gssapi_supports_spnego],[
22 cmu_save_LIBS="$LIBS"
23 LIBS="$LIBS $GSSAPIBASE_LIBS"
24+ AC_ARG_ENABLE([spnego],
25+ [AC_HELP_STRING([--enable-spnego=<DIR>],
26+ [enable SPNEGO support in GSSAPI libraries [no]])],
27+ [spnego=$enableval],
28+ [spnego=no])
29+
30+ if test "$spnego" = no; then
31+ echo "no"
32+ elif test "$spnego" = yes; then
33+ AC_DEFINE(HAVE_GSS_SPNEGO,,[Define if your GSSAPI implementation supports SPNEGO])
34+ else
35+ AC_MSG_CHECKING([for SPNEGO support in GSSAPI libraries])
36 AC_TRY_RUN([
37 #ifdef HAVE_GSSAPI_H
38 #include <gssapi.h>
39@@ -343,7 +355,7 @@ int main(void)
40 AS_IF([test "$ac_cv_gssapi_supports_spnego" = yes],[
41 AC_DEFINE(HAVE_GSS_SPNEGO,,[Define if your GSSAPI implementation supports SPNEGO])
42 ])
43-
44+ fi
45 else
46 AC_MSG_RESULT([disabled])
47 fi
48--
492.25.1
50
diff --git a/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff
new file mode 100644
index 000000000..0479acfb0
--- /dev/null
+++ b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff
@@ -0,0 +1,28 @@
1From 1a5f3004e9081eab6263a29cd5be792f06441e36 Mon Sep 17 00:00:00 2001
2From: Fabian Fagerholm <fabbe@debian.org>
3Date: Wed, 24 Jul 2013 11:38:25 -0400
4Subject: [PATCH] cyrus-sasl: Add patches from Debian to fix linking
5
6Description: This patch makes sure the non-PIC version of libsasldb.a, which
7is created out of non-PIC objects, is not going to overwrite the PIC version,
8which is created out of PIC objects. The PIC version is placed in .libs, and
9the non-PIC version in the current directory. This ensures that both non-PIC
10and PIC versions are available in the correct locations.
11
12---
13 lib/Makefile.am | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/lib/Makefile.am b/lib/Makefile.am
17index a158ca3..3137e19 100644
18--- a/lib/Makefile.am
19+++ b/lib/Makefile.am
20@@ -99,7 +99,7 @@ endif
21
22 libsasl2.a: libsasl2.la $(SASL_STATIC_OBJS)
23 @echo adding static plugins and dependencies
24- $(AR) cru .libs/$@ $(SASL_STATIC_OBJS)
25+ $(AR) cru $@ $(SASL_STATIC_OBJS)
26 @for i in ./libsasl2.la ../common/libplugin_common.la ../sasldb/libsasldb.la ../plugins/lib*.la; do \
27 if test ! -f $$i; then continue; fi; . $$i; \
28 for j in $$dependency_libs foo; do \
diff --git a/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/saslauthd.conf b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/saslauthd.conf
new file mode 100644
index 000000000..a91a9d334
--- /dev/null
+++ b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/saslauthd.conf
@@ -0,0 +1,11 @@
1# Directory in which to place saslauthd's listening socket, pid file, and so
2# on. This directory must already exist.
3SOCKETDIR=@LOCALSTATEDIR@/run/saslauthd
4
5# Mechanism to use when checking passwords. Run "saslauthd -v" to get a list
6# of which mechanism your installation was compiled with the ablity to use.
7MECH=pam
8
9# Additional flags to pass to saslauthd on the command line. See saslauthd(8)
10# for the list of accepted flags.
11FLAGS=
diff --git a/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/saslauthd.service b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/saslauthd.service
new file mode 100644
index 000000000..e63592af6
--- /dev/null
+++ b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/saslauthd.service
@@ -0,0 +1,12 @@
1[Unit]
2Description=SASL authentication daemon.
3After=syslog.target
4
5[Service]
6Type=forking
7PIDFile=/run/saslauthd/saslauthd.pid
8EnvironmentFile=@SYSCONFDIR@/default/saslauthd
9ExecStart=@SBINDIR@/saslauthd -m $SOCKETDIR -a $MECH $FLAGS
10
11[Install]
12WantedBy=multi-user.target
diff --git a/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl_2.1.28.bb b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl_2.1.28.bb
new file mode 100644
index 000000000..98899dfd5
--- /dev/null
+++ b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl_2.1.28.bb
@@ -0,0 +1,98 @@
1SUMMARY = "Generic client/server library for SASL authentication"
2SECTION = "libs"
3HOMEPAGE = "http://asg.web.cmu.edu/sasl/"
4DEPENDS = "openssl db groff-native"
5LICENSE = "BSD-4-Clause"
6LIC_FILES_CHKSUM = "file://COPYING;md5=3f55e0974e3d6db00ca6f57f2d206396"
7
8SRCREV = "7a6b45b177070198fed0682bea5fa87c18abb084"
9
10SRC_URI = "git://github.com/cyrusimap/cyrus-sasl;protocol=https;branch=cyrus-sasl-2.1 \
11 file://avoid-to-call-AC_TRY_RUN.patch \
12 file://debian_patches_0014_avoid_pic_overwrite.diff \
13 file://0001-sample-Rename-dprintf-to-cyrus_dprintf.patch \
14 file://saslauthd.service \
15 file://saslauthd.conf \
16 file://CVE-2019-19906.patch \
17 "
18
19UPSTREAM_CHECK_URI = "https://github.com/cyrusimap/cyrus-sasl/archives"
20
21S = "${WORKDIR}/git"
22
23inherit autotools pkgconfig useradd systemd
24
25EXTRA_OECONF += "--with-dblib=berkeley \
26 --with-plugindir='${libdir}/sasl2' \
27 andrew_cv_runpath_switch=none"
28
29PACKAGECONFIG ??= "\
30 ${@bb.utils.filter('DISTRO_FEATURES', 'ldap pam', d)} \
31"
32PACKAGECONFIG[gssapi] = "--enable-gssapi=yes,--enable-gssapi=no,krb5,"
33PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,"
34PACKAGECONFIG[opie] = "--with-opie,--without-opie,opie,"
35PACKAGECONFIG[des] = "--with-des,--without-des,,"
36PACKAGECONFIG[ldap] = "--with-ldap=${STAGING_LIBDIR} --enable-ldapdb,--without-ldap --disable-ldapdb,openldap,"
37PACKAGECONFIG[ntlm] = "--enable-ntlm=yes,--enable-ntlm=no,,"
38
39CFLAGS += "-fPIC"
40
41do_configure:prepend () {
42 # make it be able to work with db 5.0 version
43 local sed_files="sasldb/db_berkeley.c utils/dbconverter-2.c"
44 for sed_file in $sed_files; do
45 sed -i 's#DB_VERSION_MAJOR == 4.*#(&) || DB_VERSION_MAJOR == 5#' ${S}/$sed_file
46 done
47}
48
49do_compile:prepend () {
50 cd include
51 ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} ${S}/include/makemd5.c -o makemd5
52 touch makemd5.o makemd5.lo makemd5
53 cd ..
54}
55
56do_install:append() {
57 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
58 install -d ${D}${systemd_unitdir}/system
59 install -m 0644 ${WORKDIR}/saslauthd.service ${D}${systemd_unitdir}/system
60
61 sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/saslauthd.service
62 sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${systemd_unitdir}/system/saslauthd.service
63 sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/saslauthd.service
64
65 install -d ${D}${sysconfdir}/tmpfiles.d
66 echo "d /run/saslauthd/ - - - -" > ${D}${sysconfdir}/tmpfiles.d/saslauthd.conf
67
68 install -d ${D}${sysconfdir}/default/
69 install -m 0644 ${WORKDIR}/saslauthd.conf ${D}${sysconfdir}/default/saslauthd
70 sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${sysconfdir}/default/saslauthd
71 fi
72}
73
74USERADD_PACKAGES = "${PN}-bin"
75USERADD_PARAM:${PN}-bin = "--system --home=/var/spool/mail -g mail cyrus"
76
77SYSTEMD_PACKAGES = "${PN}-bin"
78SYSTEMD_SERVICE:${PN}-bin = "saslauthd.service"
79SYSTEMD_AUTO_ENABLE = "disable"
80
81SRC_URI[md5sum] = "a7f4e5e559a0e37b3ffc438c9456e425"
82SRC_URI[sha256sum] = "8fbc5136512b59bb793657f36fadda6359cae3b08f01fd16b3d406f1345b7bc3"
83
84PACKAGES =+ "${PN}-bin"
85
86FILES:${PN} += "${libdir}/sasl2/*.so*"
87FILES:${PN}-bin += "${bindir} \
88 ${sysconfdir}/default/saslauthd \
89 ${systemd_unitdir}/system/saslauthd.service \
90 ${sysconfdir}/tmpfiles.d/saslauthd.conf"
91FILES:${PN}-dev += "${libdir}/sasl2/*.la"
92FILES:${PN}-dbg += "${libdir}/sasl2/.debug"
93FILES:${PN}-staticdev += "${libdir}/sasl2/*.a"
94
95INSANE_SKIP:${PN} += "dev-so"
96
97# CVE-2020-8032 affects only openSUSE
98CVE_CHECK_IGNORE += "CVE-2020-8032"