mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-22 19:44:21 +01:00
network/opensmtpd: Apply OpenBSD 6.4 patch 20.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
parent
2ccb4f74c6
commit
66062b50d0
2 changed files with 31 additions and 1 deletions
27
network/opensmtpd/openbsd64-020-smtpd.patch
Normal file
27
network/opensmtpd/openbsd64-020-smtpd.patch
Normal file
|
@ -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);
|
||||
|
|
@ -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 \
|
||||
|
|
Loading…
Reference in a new issue