aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/opensmtpd-extras/0003-table-ldap-reconnect.patch54
-rw-r--r--testing/opensmtpd-extras/0004-Add-ldap-reconnection-logic-to-lookup-function-reord.patch127
-rw-r--r--testing/opensmtpd-extras/APKBUILD12
-rw-r--r--testing/opensmtpd-extras/fix-opensmtpd-5.9+-compat.patch177
4 files changed, 3 insertions, 367 deletions
diff --git a/testing/opensmtpd-extras/0003-table-ldap-reconnect.patch b/testing/opensmtpd-extras/0003-table-ldap-reconnect.patch
deleted file mode 100644
index 985e766b9c..0000000000
--- a/testing/opensmtpd-extras/0003-table-ldap-reconnect.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 04e4c521b34d1987af915ff97dcb0d87daf122b0 Mon Sep 17 00:00:00 2001
-From: ID Fake <idfake@gmx.net>
-Date: Thu, 27 Jul 2017 23:55:12 +0200
-Subject: [PATCH] table-ldap reconnect
-
-Patch-Source: https://github.com/OpenSMTPD/OpenSMTPD-extras/commit/04e4c521b34d1987af915ff97dcb0d87daf122b0
- https://github.com/OpenSMTPD/OpenSMTPD-extras/commit/07764840916e4d0ca0925dcc8722dd20d8347e95
----
- extras/tables/table-ldap/table_ldap.c | 16 +++++++++++++++-
- 1 file changed, 15 insertions(+), 1 deletion(-)
-
-diff --git a/extras/tables/table-ldap/table_ldap.c b/extras/tables/table-ldap/table_ldap.c
-index 5b54c86..5e9152f 100644
---- a/extras/tables/table-ldap/table_ldap.c
-+++ b/extras/tables/table-ldap/table_ldap.c
-@@ -77,13 +77,22 @@ table_ldap_update(void)
- static int
- table_ldap_check(int service, struct dict *params, const char *key)
- {
-+ int ret;
-+
- switch(service) {
- case K_ALIAS:
- case K_DOMAIN:
- case K_CREDENTIALS:
- case K_USERINFO:
- case K_MAILADDR:
-- return ldap_run_query(service, key, NULL, 0);
-+ if ((ret = ldap_run_query(service, key, NULL, 0)) >= 0) {
-+ return ret;
-+ }
-+ log_debug("debug: table-ldap: reconnecting");
-+ if (!(ret = ldap_open())) {
-+ log_warnx("warn: table-ldap: failed to connect");
-+ }
-+ return ret;
- default:
- return -1;
- }
-@@ -306,6 +315,11 @@ ldap_open(void)
- {
- struct aldap_message *amsg = NULL;
-
-+ if (aldap) {
-+ aldap_close(aldap);
-+ log_info("info: table-ldap: closed previous connection");
-+ }
-+
- aldap = ldap_connect(url);
- if (aldap == NULL) {
- log_warnx("warn: ldap_connect error");
---
-2.18.0
-
diff --git a/testing/opensmtpd-extras/0004-Add-ldap-reconnection-logic-to-lookup-function-reord.patch b/testing/opensmtpd-extras/0004-Add-ldap-reconnection-logic-to-lookup-function-reord.patch
deleted file mode 100644
index d85a69402a..0000000000
--- a/testing/opensmtpd-extras/0004-Add-ldap-reconnection-logic-to-lookup-function-reord.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-From a29785e9177f5801317fcb3db297cbdafa4f3d93 Mon Sep 17 00:00:00 2001
-From: "Paul B. Henson" <henson@acm.org>
-Date: Sat, 26 May 2018 18:09:25 -0700
-Subject: [PATCH] Add ldap reconnection logic to lookup function; reorder a
- bit to avoid implicit function declaration errors.
-
-Patch-Source: https://github.com/OpenSMTPD/OpenSMTPD-extras/commit/a29785e9177f5801317fcb3db297cbdafa4f3d93
----
- extras/tables/table-ldap/table_ldap.c | 88 +++++++++++++++------------
- 1 file changed, 49 insertions(+), 39 deletions(-)
-
-diff --git a/extras/tables/table-ldap/table_ldap.c b/extras/tables/table-ldap/table_ldap.c
-index 88c9ffd..090cfb4 100644
---- a/extras/tables/table-ldap/table_ldap.c
-+++ b/extras/tables/table-ldap/table_ldap.c
-@@ -74,45 +74,6 @@ table_ldap_update(void)
- return 1;
- }
-
--static int
--table_ldap_check(int service, struct dict *params, const char *key)
--{
-- int ret;
--
-- switch(service) {
-- case K_ALIAS:
-- case K_DOMAIN:
-- case K_CREDENTIALS:
-- case K_USERINFO:
-- case K_MAILADDR:
-- if ((ret = ldap_run_query(service, key, NULL, 0)) >= 0) {
-- return ret;
-- }
-- log_debug("debug: table-ldap: reconnecting");
-- if (!(ret = ldap_open())) {
-- log_warnx("warn: table-ldap: failed to connect");
-- }
-- return ret;
-- default:
-- return -1;
-- }
--}
--
--static int
--table_ldap_lookup(int service, struct dict *params, const char *key, char *dst, size_t sz)
--{
-- switch(service) {
-- case K_ALIAS:
-- case K_DOMAIN:
-- case K_CREDENTIALS:
-- case K_USERINFO:
-- case K_MAILADDR:
-- return ldap_run_query(service, key, dst, sz);
-- default:
-- return -1;
-- }
--}
--
- static int
- table_ldap_fetch(int service, struct dict *params, char *dst, size_t sz)
- {
-@@ -361,6 +322,31 @@ err:
- return 0;
- }
-
-+static int
-+table_ldap_lookup(int service, struct dict *params, const char *key, char *dst, size_t sz)
-+{
-+ int ret;
-+
-+ switch(service) {
-+ case K_ALIAS:
-+ case K_DOMAIN:
-+ case K_CREDENTIALS:
-+ case K_USERINFO:
-+ case K_MAILADDR:
-+ if ((ret = ldap_run_query(service, key, dst, sz)) > 0) {
-+ return ret;
-+ }
-+ log_debug("debug: table-ldap: reconnecting");
-+ if (!(ret = ldap_open())) {
-+ log_warnx("warn: table-ldap: failed to connect");
-+ return ret;
-+ }
-+ return ldap_run_query(service, key, dst, sz);
-+ default:
-+ return -1;
-+ }
-+}
-+
- static int
- ldap_query(const char *filter, char **attributes, char ***outp, size_t n)
- {
-@@ -498,6 +484,30 @@ end:
- return ret;
- }
-
-+static int
-+table_ldap_check(int service, struct dict *params, const char *key)
-+{
-+ int ret;
-+
-+ switch(service) {
-+ case K_ALIAS:
-+ case K_DOMAIN:
-+ case K_CREDENTIALS:
-+ case K_USERINFO:
-+ case K_MAILADDR:
-+ if ((ret = ldap_run_query(service, key, NULL, 0)) >= 0) {
-+ return ret;
-+ }
-+ log_debug("debug: table-ldap: reconnecting");
-+ if (!(ret = ldap_open())) {
-+ log_warnx("warn: table-ldap: failed to connect");
-+ }
-+ return ret;
-+ default:
-+ return -1;
-+ }
-+}
-+
- int
- main(int argc, char **argv)
- {
---
-2.18.0
-
diff --git a/testing/opensmtpd-extras/APKBUILD b/testing/opensmtpd-extras/APKBUILD
index fb13944950..b4f8cd461f 100644
--- a/testing/opensmtpd-extras/APKBUILD
+++ b/testing/opensmtpd-extras/APKBUILD
@@ -1,8 +1,8 @@
# Contributor: Shiz <hi@shiz.me>
# Maintainer: Shiz <hi@shiz.me>
pkgname=opensmtpd-extras
-pkgver=201703132115
-pkgrel=5
+pkgver=6.4.0
+pkgrel=0
pkgdesc="OpenSMTPD addons"
url="https://opensmtpd.org/"
arch="all"
@@ -14,9 +14,6 @@ subpackages="$pkgname-doc"
source="https://www.opensmtpd.org/archives/$pkgname-$pkgver.tar.gz
0001-uint8_t-is-defined-in-stdint.h-at-least-on-Linux.patch
0002-wrap-stdint.h-in-autoconf-variables.patch
- 0003-table-ldap-reconnect.patch
- 0004-Add-ldap-reconnection-logic-to-lookup-function-reord.patch
- fix-opensmtpd-5.9+-compat.patch
remove-decls.patch
"
builddir="$srcdir/$pkgname-$pkgver"
@@ -74,10 +71,7 @@ _package_extra() {
mv "$pkgdir"/usr/lib/opensmtpd/$name "$subpkgdir"/usr/lib/opensmtpd/
}
-sha512sums="d841c63445ca674b368a5aa6012ae90e46b0c31b650067bdcea5badca3d818b1b732be880b2a18421fb39d07291dd413455944b178597bc13ae6ff5c75ac9aed opensmtpd-extras-201703132115.tar.gz
+sha512sums="097223884841ec3939d3f3d86ba9d23f9c62a37825a8e5b94c2ac5fd16584879780305685706b9bd8ed9a49dfece3ff5ed8f7f143494ca92a8c2c249aff9c28d opensmtpd-extras-6.4.0.tar.gz
2e12845233437bef691ef92a2b4ffcc307b7cd72ec61b2063604034e28266550940ed432ef66a871fe82030df68b01cdd50ac97a255bf7724ab62a43d45ca4e5 0001-uint8_t-is-defined-in-stdint.h-at-least-on-Linux.patch
df6f52669e1df3d2b134fa8ec99795b0cef3f6aa38ccb5f85def240370b487988d6576fb769dee7d3eba30cfb291298b1c5a22433f4e6243307c589a7bbdb538 0002-wrap-stdint.h-in-autoconf-variables.patch
-bc356eca9e74b926979b3fafe14472aa4035a4ad47b9295a24d03906e33b115dbd890a038af563edf8f8d866bb2ab68ccb94a66ce9c5e2b05541e2b086276882 0003-table-ldap-reconnect.patch
-202017bfd952acde8fa8edc0e6ae4c38c178c1cba7643bb87cb3d311b1f8a3cacd9d73f9a5617430abd3dd93ba755a37a96fbf4f5a40d794d232752ef847abcd 0004-Add-ldap-reconnection-logic-to-lookup-function-reord.patch
-e14990a94c9114958b1070467ca1119162b24a8ef9c4fee1ff6deb8b18bdc2a532e952e65fce1f6e5346c3bb784d623773a237d48384143c2cdcce80f60a5d4a fix-opensmtpd-5.9+-compat.patch
36efd3b6cf75728cc8b75b3d9d6bf464d1e949ccfbe6151ed53dbba0f9ee1e50eb61afcca05af302ab359bc9ea1136e7750a15e5f5b824899141298d3060782a remove-decls.patch"
diff --git a/testing/opensmtpd-extras/fix-opensmtpd-5.9+-compat.patch b/testing/opensmtpd-extras/fix-opensmtpd-5.9+-compat.patch
deleted file mode 100644
index ec87bc1492..0000000000
--- a/testing/opensmtpd-extras/fix-opensmtpd-5.9+-compat.patch
+++ /dev/null
@@ -1,177 +0,0 @@
-From 5cd4a2022b30a70dc02d030e4b7bc90d5afe61cb Mon Sep 17 00:00:00 2001
-From: Jakub Jirutka <jakub@jirutka.cz>
-Date: Sat, 28 Jul 2018 16:02:00 +0200
-Subject: [PATCH] fix compatibility with opensmtpd 5.9+
-
-This mirrors changes done in [1].
-
-When a table from extras is used (tested with passwd and postgres),
-opensmtpd failes to start (on Alpine Linux):
-
- passwd[7508]: warn: table-proc: bogus data
- passwd[7508]: fatal: table-proc: exiting
- warn: table-proc: pipe closed
- fatal: table-proc: exiting
-
-The error is printed by the table process and it's cased by mismatch
-between expected and actual size of the struct table_open_params.
-
-Note: I've originally tried to port even changes of includes from [1],
-but that would need to add many new includes to most of the extras.
-Thus I've eventually decided that it's probably not the right approach.
-
-Fixes: https://github.com/OpenSMTPD/OpenSMTPD/issues/816
-
-[1]: https://github.com/OpenSMTPD/OpenSMTPD/commit/5dfecad33e1301343473f7e9a6e425cdd11b9c3f
-
-Upstream-Issue: https://github.com/OpenSMTPD/OpenSMTPD-extras/pull/53
----
- api/filter_api.c | 6 +++---
- api/queue_api.c | 2 +-
- api/queue_utils.c | 2 +-
- api/smtpd-api.h | 3 ++-
- api/smtpd-defines.h | 5 -----
- api/to.c | 4 ++--
- extras/tables/table-mysql/table_mysql.c | 6 +++---
- 7 files changed, 12 insertions(+), 16 deletions(-)
-
-diff --git a/api/filter_api.c b/api/filter_api.c
-index e3743c8..659a5fc 100644
---- a/api/filter_api.c
-+++ b/api/filter_api.c
-@@ -652,8 +652,8 @@ filter_io_in(struct io *io, int evt)
- case IO_DATAIN:
- nextline:
- line = iobuf_getline(&s->pipe.ibuf, &len);
-- if ((line == NULL && iobuf_len(&s->pipe.ibuf) >= SMTPD_MAXLINESIZE) ||
-- (line && len >= SMTPD_MAXLINESIZE)) {
-+ if ((line == NULL && iobuf_len(&s->pipe.ibuf) >= LINE_MAX) ||
-+ (line && len >= LINE_MAX)) {
- s->pipe.error = 1;
- break;
- }
-@@ -1210,7 +1210,7 @@ filter_api_sockaddr_to_text(const struct sockaddr *sa)
- const char *
- filter_api_mailaddr_to_text(const struct mailaddr *maddr)
- {
-- static char buffer[SMTPD_MAXLINESIZE];
-+ static char buffer[LINE_MAX];
-
- strlcpy(buffer, maddr->user, sizeof buffer);
- if (maddr->domain[0] == '\0')
-diff --git a/api/queue_api.c b/api/queue_api.c
-index 4c6de84..3c1ea8d 100644
---- a/api/queue_api.c
-+++ b/api/queue_api.c
-@@ -111,7 +111,7 @@ queue_msg_dispatch(void)
- uint64_t evpid;
- uint32_t msgid, version;
- size_t n, m;
-- char buffer[8192], path[SMTPD_MAXPATHLEN];
-+ char buffer[8192], path[PATH_MAX];
- int r, fd;
- FILE *ifile, *ofile;
-
-diff --git a/api/queue_utils.c b/api/queue_utils.c
-index 45dced5..7eafd1b 100644
---- a/api/queue_utils.c
-+++ b/api/queue_utils.c
-@@ -59,7 +59,7 @@ int
- mktmpfile(void)
- {
- static char *tempdir = "/temporary";
-- char path[SMTPD_MAXPATHLEN];
-+ char path[PATH_MAX];
- int fd;
- mode_t omode;
-
-diff --git a/api/smtpd-api.h b/api/smtpd-api.h
-index 3416989..2595d68 100644
---- a/api/smtpd-api.h
-+++ b/api/smtpd-api.h
-@@ -27,6 +27,7 @@
- #include <stdio.h>
- #include <netinet/in.h>
- #include <netdb.h>
-+#include <limits.h>
-
- #include <event.h>
- #include <imsg.h>
-@@ -229,7 +230,7 @@ struct scheduler_info {
-
- struct table_open_params {
- uint32_t version;
-- char name[SMTPD_MAXLINESIZE];
-+ char name[LINE_MAX];
- };
-
- enum table_service {
-diff --git a/api/smtpd-defines.h b/api/smtpd-defines.h
-index 2ced70e..f34eda8 100644
---- a/api/smtpd-defines.h
-+++ b/api/smtpd-defines.h
-@@ -61,11 +61,6 @@ enum smtp_proc_type {
- #define SMTPD_MAXLOCALPARTSIZE (255 + 1)
- #define SMTPD_MAXDOMAINPARTSIZE (255 + 1)
-
--#define SMTPD_MAXLOGNAME 32
--#define SMTPD_MAXPATHLEN 1024
--#define SMTPD_MAXHOSTNAMELEN 256
--#define SMTPD_MAXLINESIZE 2048
--
- #define SMTPD_USER "_smtpd"
- #define PATH_CHROOT "/var/empty"
- #define SMTPD_QUEUE_USER "_smtpq"
-diff --git a/api/to.c b/api/to.c
-index e048341..2f0d294 100644
---- a/api/to.c
-+++ b/api/to.c
-@@ -92,7 +92,7 @@ text_to_mailaddr(struct mailaddr *maddr, const char *email)
- {
- char *username;
- char *hostname;
-- char buffer[SMTPD_MAXLINESIZE];
-+ char buffer[LINE_MAX];
-
- if (strlcpy(buffer, email, sizeof buffer) >= sizeof buffer)
- return 0;
-@@ -129,7 +129,7 @@ text_to_mailaddr(struct mailaddr *maddr, const char *email)
- const char *
- mailaddr_to_text(const struct mailaddr *maddr)
- {
-- static char buffer[SMTPD_MAXLINESIZE];
-+ static char buffer[LINE_MAX];
-
- (void)strlcpy(buffer, maddr->user, sizeof buffer);
- (void)strlcat(buffer, "@", sizeof buffer);
-diff --git a/extras/tables/table-mysql/table_mysql.c b/extras/tables/table-mysql/table_mysql.c
-index 449a693..2c32060 100644
---- a/extras/tables/table-mysql/table_mysql.c
-+++ b/extras/tables/table-mysql/table_mysql.c
-@@ -68,7 +68,7 @@ static void config_free(struct config *);
- #define DEFAULT_REFRESH 1000
-
- static MYSQL_BIND results[SQL_MAX_RESULT];
--static char results_buffer[SQL_MAX_RESULT][SMTPD_MAXLINESIZE];
-+static char results_buffer[SQL_MAX_RESULT][LINE_MAX];
- static char *conffile;
- static struct config *config;
-
-@@ -333,7 +333,7 @@ table_mysql_query(const char *key, int service)
- MYSQL_STMT *stmt;
- MYSQL_BIND param[1];
- unsigned long keylen;
-- char buffer[SMTPD_MAXLINESIZE];
-+ char buffer[LINE_MAX];
- int i;
-
- retry:
-@@ -586,7 +586,7 @@ main(int argc, char **argv)
- for (i = 0; i < SQL_MAX_RESULT; i++) {
- results[i].buffer_type = MYSQL_TYPE_STRING;
- results[i].buffer = results_buffer[i];
-- results[i].buffer_length = SMTPD_MAXLINESIZE;
-+ results[i].buffer_length = LINE_MAX;
- results[i].is_null = 0;
- }
-