summaryrefslogtreecommitdiff
path: root/network/opensmtpd
diff options
context:
space:
mode:
authorRichard Narron <richard@aaazen.com>2019-08-10 01:09:59 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2019-08-10 01:10:14 +0700
commit66062b50d0b8857cd66eb00a08cef9b543c1c756 (patch)
treec2aec997e42a2dc18284efd6a6b793ac3f2a0eb3 /network/opensmtpd
parent2ccb4f74c6e791736be0de1d355e6b5d405111aa (diff)
downloadslackbuilds-66062b50d0b8857cd66eb00a08cef9b543c1c756.tar.gz
network/opensmtpd: Apply OpenBSD 6.4 patch 20.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/opensmtpd')
-rw-r--r--network/opensmtpd/openbsd64-020-smtpd.patch27
-rw-r--r--network/opensmtpd/opensmtpd.SlackBuild5
2 files changed, 31 insertions, 1 deletions
diff --git a/network/opensmtpd/openbsd64-020-smtpd.patch b/network/opensmtpd/openbsd64-020-smtpd.patch
new file mode 100644
index 0000000000..a1aa51607a
--- /dev/null
+++ b/network/opensmtpd/openbsd64-020-smtpd.patch
@@ -0,0 +1,27 @@
+--- a/smtpd/smtp_session.c 3 Sep 2018 19:01:29 -0000 1.337
++++ b/smtpd/smtp_session.c 1 Aug 2019 21:18:53 -0000
+@@ -1904,15 +1904,21 @@ smtp_reply(struct smtp_session *s, char
+ {
+ va_list ap;
+ int n;
+- char buf[LINE_MAX], tmp[LINE_MAX];
++ char buf[LINE_MAX*2], tmp[LINE_MAX*2];
+
+ va_start(ap, fmt);
+ n = vsnprintf(buf, sizeof buf, fmt, ap);
+ va_end(ap);
+- if (n == -1 || n >= LINE_MAX)
+- fatalx("smtp_reply: line too long");
++ if (n < 0)
++ fatalx("smtp_reply: response format error");
+ if (n < 4)
+ fatalx("smtp_reply: response too short");
++ if (n >= (int)sizeof buf) {
++ /* only first three bytes are used by SMTP logic,
++ * so if _our_ reply does not fit entirely in the
++ * buffer, it's ok to truncate.
++ */
++ }
+
+ log_trace(TRACE_SMTP, "smtp: %p: >>> %s", s, buf);
+
diff --git a/network/opensmtpd/opensmtpd.SlackBuild b/network/opensmtpd/opensmtpd.SlackBuild
index 453822f728..b429cf360a 100644
--- a/network/opensmtpd/opensmtpd.SlackBuild
+++ b/network/opensmtpd/opensmtpd.SlackBuild
@@ -25,7 +25,7 @@
PRGNAM=opensmtpd
VERSION=${VERSION:-6.0.3p1}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -92,6 +92,9 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+# fix reply buffer overflow
+cat $CWD/openbsd64-020-smtpd.patch | patch -p1
+
CFLAGS="$SLKCFLAGS -D_DEFAULT_SOURCE" \
CXXFLAGS="$SLKCFLAGS" \
./configure \