network/opensmtpd: Fix bug.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Richard Narron 2019-08-29 21:37:24 +07:00 committed by Willy Sudiarto Raharjo
parent faf5b05f21
commit cae0cdfc48
No known key found for this signature in database
GPG Key ID: 887B8374D7333381
3 changed files with 56 additions and 6 deletions

View File

@ -19,8 +19,12 @@ This package conflicts with the stock sendmail package included in
Slackware and overwrites some of its files, so remove the sendmail
package before installing opensmtpd.
In the change from version 5.7.3p2 to 5.9.2p1 the ownership and permissions
changed for the /var/spool/offline directory
Alpine hangs when sending mail using the opensmtp sendmail command and the
opensmtpd server is down.
To prevent this, modify the /etc/pine.conf or the user .pinerc to
send the mail directly to the server instead of using the
opensmtpd sendmail command:
smtp-server=localhost
chown -R root:smtpq /var/spool/offline
chmod 770 /var/spool/offline

View File

@ -0,0 +1,43 @@
From 9b5f70b93e038df5446bd37a4adac5a0380748e7 Mon Sep 17 00:00:00 2001
From: johannes <johannes.brechtmann@gmail.com>
Date: Wed, 21 Feb 2018 23:57:11 +0100
Subject: [PATCH] crypt_checkpass: include HAVE_CRYPT_H definition, add NULL
check
---
openbsd-compat/crypt_checkpass.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/openbsd-compat/crypt_checkpass.c b/openbsd-compat/crypt_checkpass.c
index dafd2dae..d10b3a57 100644
--- a/openbsd-compat/crypt_checkpass.c
+++ b/openbsd-compat/crypt_checkpass.c
@@ -1,5 +1,6 @@
/* OPENBSD ORIGINAL: lib/libc/crypt/cryptutil.c */
+#include "includes.h"
#include <errno.h>
#ifdef HAVE_CRYPT_H
#include <crypt.h>
@@ -10,6 +11,8 @@
int
crypt_checkpass(const char *pass, const char *goodhash)
{
+ char *c;
+
if (goodhash == NULL)
goto fail;
@@ -17,7 +20,11 @@ crypt_checkpass(const char *pass, const char *goodhash)
if (strlen(goodhash) == 0 && strlen(pass) == 0)
return 0;
- if (strcmp(crypt(pass, goodhash), goodhash) == 0)
+ c = crypt(pass, goodhash);
+ if (c == NULL)
+ goto fail;
+
+ if (strcmp(c, goodhash) == 0)
return 0;
fail:

View File

@ -25,7 +25,7 @@
PRGNAM=opensmtpd
VERSION=${VERSION:-6.0.3p1}
BUILD=${BUILD:-3}
BUILD=${BUILD:-4}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@ -95,6 +95,9 @@ find -L . \
# fix reply buffer overflow
cat $CWD/openbsd64-020-smtpd.patch | patch -p1
# check null from crypt function
cat $CWD/fix-crash-on-authentication.patch | patch -p1
CFLAGS="$SLKCFLAGS -D_DEFAULT_SOURCE" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
@ -165,7 +168,7 @@ for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; r
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a INSTALL LICENSE README.md THANKS $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README
cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README.slackware
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install