[arch-commits] Commit in opensmtpd/trunk (PKGBUILD fix-crash-on-authentication.patch)

Bruno Pagani archange at archlinux.org
Fri May 25 11:55:55 UTC 2018


    Date: Friday, May 25, 2018 @ 11:55:54
  Author: archange
Revision: 329346

Fix FS#58127

Added:
  opensmtpd/trunk/fix-crash-on-authentication.patch
Modified:
  opensmtpd/trunk/PKGBUILD

-----------------------------------+
 PKGBUILD                          |   10 +++++---
 fix-crash-on-authentication.patch |   43 ++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-05-25 10:17:06 UTC (rev 329345)
+++ PKGBUILD	2018-05-25 11:55:54 UTC (rev 329346)
@@ -4,7 +4,7 @@
 
 pkgname=opensmtpd
 pkgver=6.0.3p1
-pkgrel=1
+pkgrel=2
 pkgdesc='Free implementation of the server-side SMTP protocol'
 arch=('x86_64')
 url='https://www.opensmtpd.org/'
@@ -17,14 +17,18 @@
 source=("https://www.opensmtpd.org/archives/$pkgname-$pkgver.tar.gz"
         'opensmtpd.sysusers'
         'smtpd.service'
-        'smtpd.socket')
+        'smtpd.socket'
+        'fix-crash-on-authentication.patch')
 sha256sums=('291881862888655565e8bbe3cfb743310f5dc0edb6fd28a889a9a547ad767a81'
             'b38b64f1457b7227d55585edc711cce525e089516d16b093e6c44387380e6b13'
             'abf5baeb2a87c60d668ad18ea41cc08cab7a4f76339dd6df05de15cdaadaf922'
-            '32d46de5562d01de445d04c93bcc9f94bf103539b676e449c32e3603a3866cf8')
+            '32d46de5562d01de445d04c93bcc9f94bf103539b676e449c32e3603a3866cf8'
+            '0f4a8729bb46413d3b4a043ef41ed4949ff8e35d22c293c4b9fde10f9d44ba41')
 
 prepare() {
   sed -ri 's,/etc/mail,/etc/smtpd,g' "$pkgname-$pkgver/smtpd/smtpd.conf"
+  cd $pkgname-$pkgver
+  patch -p1 -i ../fix-crash-on-authentication.patch
 }
 
 build() {

Added: fix-crash-on-authentication.patch
===================================================================
--- fix-crash-on-authentication.patch	                        (rev 0)
+++ fix-crash-on-authentication.patch	2018-05-25 11:55:54 UTC (rev 329346)
@@ -0,0 +1,43 @@
+From 9b5f70b93e038df5446bd37a4adac5a0380748e7 Mon Sep 17 00:00:00 2001
+From: johannes <johannes.brechtmann at 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:



More information about the arch-commits mailing list