diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2018-07-28 18:38:43 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2018-07-28 18:42:56 +0200 |
commit | af307d090391717fedcbbb4db7a33115d31786ec (patch) | |
tree | 79b4b5c9cbe2111ee6867a4d71c2793732c59639 /testing/opensmtpd-extras | |
parent | 44e80ac21d375f4d3f5d01a3d6a00bba7d3669c3 (diff) | |
download | aports-af307d090391717fedcbbb4db7a33115d31786ec.tar.bz2 aports-af307d090391717fedcbbb4db7a33115d31786ec.tar.xz |
testing/opensmtpd-extras: backport some patches from master
Diffstat (limited to 'testing/opensmtpd-extras')
5 files changed, 246 insertions, 0 deletions
diff --git a/testing/opensmtpd-extras/0001-uint8_t-is-defined-in-stdint.h-at-least-on-Linux.patch b/testing/opensmtpd-extras/0001-uint8_t-is-defined-in-stdint.h-at-least-on-Linux.patch new file mode 100644 index 0000000000..2adcb7dd42 --- /dev/null +++ b/testing/opensmtpd-extras/0001-uint8_t-is-defined-in-stdint.h-at-least-on-Linux.patch @@ -0,0 +1,28 @@ +From 77b38f10b8e45efb4066f199a5123ead35d3df75 Mon Sep 17 00:00:00 2001 +From: Jonas Maurus <jonas-github@maurus.net> +Date: Wed, 2 Nov 2016 11:51:29 +0100 +Subject: [PATCH] uint8_t is defined in stdint.h, at least on Linux + +Signed-off-by: Jonas Maurus <jonas-github@maurus.net> + +Patch-Source: https://github.com/OpenSMTPD/OpenSMTPD-extras/commit/77b38f10b8e45efb4066f199a5123ead35d3df75 +--- + api/rfc2822.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/api/rfc2822.h b/api/rfc2822.h +index 30b878b..0c35830 100644 +--- a/api/rfc2822.h ++++ b/api/rfc2822.h +@@ -19,6 +19,8 @@ + #ifndef _RFC2822_H_ + #define _RFC2822_H_ + ++#include <stdint.h> ++ + #define RFC2822_MAX_LINE_SIZE 4096 + + struct rfc2822_line { +-- +2.18.0 + diff --git a/testing/opensmtpd-extras/0002-wrap-stdint.h-in-autoconf-variables.patch b/testing/opensmtpd-extras/0002-wrap-stdint.h-in-autoconf-variables.patch new file mode 100644 index 0000000000..c173626d51 --- /dev/null +++ b/testing/opensmtpd-extras/0002-wrap-stdint.h-in-autoconf-variables.patch @@ -0,0 +1,29 @@ +From b517268af8b467ed2937bd2ee0b47c07347c89b2 Mon Sep 17 00:00:00 2001 +From: Jonas Maurus <jonas-github@maurus.net> +Date: Wed, 2 Nov 2016 22:50:35 +0100 +Subject: [PATCH] wrap stdint.h in autoconf variables + +Signed-off-by: Jonas Maurus <jonas-github@maurus.net> + +Patch-Source: https://github.com/OpenSMTPD/OpenSMTPD-extras/commit/b517268af8b467ed2937bd2ee0b47c07347c89b2 +--- + api/rfc2822.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/api/rfc2822.h b/api/rfc2822.h +index 0c35830..8bb0a8b 100644 +--- a/api/rfc2822.h ++++ b/api/rfc2822.h +@@ -19,7 +19,9 @@ + #ifndef _RFC2822_H_ + #define _RFC2822_H_ + ++#ifdef HAVE_STDINT_H + #include <stdint.h> ++#endif + + #define RFC2822_MAX_LINE_SIZE 4096 + +-- +2.18.0 + diff --git a/testing/opensmtpd-extras/0003-table-ldap-reconnect.patch b/testing/opensmtpd-extras/0003-table-ldap-reconnect.patch new file mode 100644 index 0000000000..985e766b9c --- /dev/null +++ b/testing/opensmtpd-extras/0003-table-ldap-reconnect.patch @@ -0,0 +1,54 @@ +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 new file mode 100644 index 0000000000..d85a69402a --- /dev/null +++ b/testing/opensmtpd-extras/0004-Add-ldap-reconnection-logic-to-lookup-function-reord.patch @@ -0,0 +1,127 @@ +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 e8d616af1f..17406a4461 100644 --- a/testing/opensmtpd-extras/APKBUILD +++ b/testing/opensmtpd-extras/APKBUILD @@ -12,6 +12,10 @@ makedepends="libressl-dev libevent-dev python2-dev mariadb-connector-c-dev postg hiredis-dev sqlite-dev" 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 " @@ -82,5 +86,9 @@ _package_extra() { } sha512sums="d841c63445ca674b368a5aa6012ae90e46b0c31b650067bdcea5badca3d818b1b732be880b2a18421fb39d07291dd413455944b178597bc13ae6ff5c75ac9aed opensmtpd-extras-201703132115.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" |