From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Zimmerman Subject: [PATCH] opensmtpd: Fix crash during authentication Date: Wed, 6 Jun 2018 15:15:58 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------806B1D20F5FEA1A4BCA4DF26" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQgir-00057Z-V5 for guix-devel@gnu.org; Wed, 06 Jun 2018 18:16:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQgio-0002gV-0E for guix-devel@gnu.org; Wed, 06 Jun 2018 18:16:05 -0400 Received: from dusk.digitalpirate.ca ([104.37.196.77]:48278) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fQgin-0002fp-Iq for guix-devel@gnu.org; Wed, 06 Jun 2018 18:16:01 -0400 Received: from localhost (localhost [127.0.0.1]) by dusk.digitalpirate.ca (OpenSMTPD) with ESMTP id 0d72aa58 for ; Wed, 6 Jun 2018 22:15:58 +0000 (UTC) Received: from [192.168.1.101] (d75-157-70-79.bchsia.telus.net [75.157.70.79]) by dusk.digitalpirate.ca (OpenSMTPD) with ESMTPSA id 76431ccf (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Wed, 6 Jun 2018 22:15:58 +0000 (UTC) Content-Language: en-GB List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org This is a multi-part message in MIME format. --------------806B1D20F5FEA1A4BCA4DF26 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Hi all, I'm running a mail server that I recently migrated to GuixSD, and I found this issue when trying to get opensmtpd set up. When using authentication from a table, opensmtpd would crash whenever I tried to authenticate. I found this patch which fixes the issue. It's already been merged into the opensmtpd master branch[1], and will be fixed in the next release which apparently will be around October/November this year. [1] https://github.com/OpenSMTPD/OpenSMTPD/pull/835 I also noticed another issue which I'm not 100% sure how to solve properly. When rebooting the server, opensmtpd fails to start. I think the reason is that the shepherd service only has '(loopback) listed in its requirements, and I think it might be trying to start the server before the network comes up. When I ssh into the server and start it manually, it works fine. My first thought was to change the requirements to '(networking), but could that cause issues for people who only use opensmtpd as a local delivery server? - Adam --------------806B1D20F5FEA1A4BCA4DF26 Content-Type: text/x-patch; name="0001-gnu-opensmtpd-Add-patch-to-fix-crash-on-authenticati.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0001-gnu-opensmtpd-Add-patch-to-fix-crash-on-authenticati.pa"; filename*1="tch" =46rom 42b7717b167553c10adbed1a0ef405b1accfc87e Mon Sep 17 00:00:00 2001 From: Adam Zimmerman Date: Wed, 6 Jun 2018 14:47:46 -0700 Subject: [PATCH] gnu: opensmtpd: Add patch to fix crash on authentication= * gnu/packages/mail.scm (opensmtpd): Add patch to fix crash --- gnu/packages/mail.scm | 3 +- gnu/packages/patches/opensmtpd-fix-crash.patch | 44 ++++++++++++++++++++= ++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/opensmtpd-fix-crash.patch diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index f6dfb3397..c0f4bfbdf 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -1995,7 +1995,8 @@ transfer protocols.") name "-" version ".tar.gz")) (sha256 (base32 - "10bsfsnlg9d9i6l2izdnxp05s3ri8fvwzqxvx1jmarc852382619"))= )) + "10bsfsnlg9d9i6l2izdnxp05s3ri8fvwzqxvx1jmarc852382619"))= + (patches (search-patches "opensmtpd-fix-crash.patch")))) (build-system gnu-build-system) (inputs `(("bdb" ,bdb) diff --git a/gnu/packages/patches/opensmtpd-fix-crash.patch b/gnu/package= s/patches/opensmtpd-fix-crash.patch new file mode 100644 index 000000000..003016753 --- /dev/null +++ b/gnu/packages/patches/opensmtpd-fix-crash.patch @@ -0,0 +1,44 @@ +From 9b5f70b93e038df5446bd37a4adac5a0380748e7 Mon Sep 17 00:00:00 2001 +From: johannes +Date: Wed, 21 Feb 2018 23:57:11 +0100 +Subject: [PATCH] crypt_checkpass: include HAVE_CRYPT_H definition, add N= ULL + 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_che= ckpass.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 */ +=20 ++#include "includes.h" + #include + #ifdef HAVE_CRYPT_H + #include +@@ -10,6 +11,8 @@ + int + crypt_checkpass(const char *pass, const char *goodhash) + { ++ char *c; ++ + if (goodhash =3D=3D NULL) + goto fail; +=20 +@@ -17,7 +20,11 @@ crypt_checkpass(const char *pass, const char *goodhas= h) + if (strlen(goodhash) =3D=3D 0 && strlen(pass) =3D=3D 0) + return 0; +=20 +- if (strcmp(crypt(pass, goodhash), goodhash) =3D=3D 0) ++ c =3D crypt(pass, goodhash); ++ if (c =3D=3D NULL) ++ goto fail; ++ ++ if (strcmp(c, goodhash) =3D=3D 0) + return 0; +=20 + fail: + --=20 2.14.1 --------------806B1D20F5FEA1A4BCA4DF26--