~alpine/aports

1

[alpine-aports] [PATCH 3/3] main/ssmtp: fix usage of getaddrinfo

Details
Message ID
<1438021564-7176-1-git-send-email-soeren+git@soeren-tempel.net>
Sender timestamp
1438021564
DKIM signature
missing
Download raw message
Patch: +24 -2
---
 main/ssmtp/APKBUILD                | 14 ++++++++++++--
 main/ssmtp/inet6-getaddrinfo.patch | 12 ++++++++++++
 2 files changed, 24 insertions(+), 2 deletions(-)
 create mode 100644 main/ssmtp/inet6-getaddrinfo.patch

diff --git a/main/ssmtp/APKBUILD b/main/ssmtp/APKBUILD
index ee40196..c0689b4 100644
--- a/main/ssmtp/APKBUILD
+++ b/main/ssmtp/APKBUILD
@@ -3,7 +3,7 @@

pkgname=ssmtp
pkgver=2.64
pkgrel=5
pkgrel=6
pkgdesc="Extremely simple MTA to get mail off the system to a mail hub"
subpackages="$pkgname-doc"
arch="all"
@@ -15,6 +15,7 @@ install=
source="http://ftp.debian.org/debian/pool/main/s/$pkgname/${pkgname}_${pkgver}.orig.tar.bz2
        generate_config.patch
	libcrypto-underlinking.patch
	inet6-getaddrinfo.patch
	"
_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
@@ -53,4 +54,13 @@ package() {

md5sums="65b4e0df4934a6cd08c506cabcbe584f  ssmtp_2.64.orig.tar.bz2
a9ea0b998975e51b37a8946f5ea977db  generate_config.patch
d782db1a953c6d48b63353d71f0c52f5  libcrypto-underlinking.patch"
d782db1a953c6d48b63353d71f0c52f5  libcrypto-underlinking.patch
85dd1bfff89986cdfbad42052bdd5b76  inet6-getaddrinfo.patch"
sha256sums="22c37dc90c871e8e052b2cab0ad219d010fa938608cd66b21c8f3c759046fa36  ssmtp_2.64.orig.tar.bz2
781da2c58a4daed637d3b19e3c7117a5f984c59d7ddc2351855dec92aeec58e5  generate_config.patch
997b275660baaea64a0d514371946c52d756b880b4c03bce9c38433737ee12be  libcrypto-underlinking.patch
822800f1dc5a4c8381f6d5862cb7f7f6753563160854efef0c69d022bae35025  inet6-getaddrinfo.patch"
sha512sums="911752e744420adf58552b9cf3a6e558d8b39103e5ad33a9ed4429b9a3a2091f7674aac11fe9bbd66747a61cdabe6bd638b80efcaadc86b057c12e2e235cca72  ssmtp_2.64.orig.tar.bz2
a4273d7c5b50984994b35de052c450a872f0014c45c1d3bfe36f2edd4f224281aacea234be61c6e966da2c4d3e033042628b79b2216340001487e6bb3a55b6cd  generate_config.patch
9da89ec5ea66dae8b7a22ffcf196c45005c0403e6505162dba05003feac38eb397f8aff4f140d720f826ea057f92e47302ec3c24bddf5786c10b214ec906e82f  libcrypto-underlinking.patch
92dc128b2f6ce234843e8f1e6ddb72653825652544cd68f693457b3fdc4ee22b0f9861feec0dfd123d012c294c7083dd8d24a9a589a3c2ae5bcdde697d30a290  inet6-getaddrinfo.patch"
diff --git a/main/ssmtp/inet6-getaddrinfo.patch b/main/ssmtp/inet6-getaddrinfo.patch
new file mode 100644
index 0000000..bbc2d90
--- /dev/null
+++ b/main/ssmtp/inet6-getaddrinfo.patch
@@ -0,0 +1,12 @@
diff -up ssmtp.orig/ssmtp.c ssmtp/ssmtp.c
--- ssmtp.orig/ssmtp.c	2009-11-23 10:55:11.000000000 +0100
+++ ssmtp/ssmtp.c	2015-07-27 17:34:12.498140804 +0200
@@ -1157,7 +1157,7 @@ int smtp_open(char *host, int port)
 	snprintf(servname, sizeof(servname), "%d", port);
 
 	/* Check we can reach the host */
-	if (getaddrinfo(host, servname, &hints, &ai0)) {
+	if (getaddrinfo(host, servname, &hints, &ai0) != 0) {
 		log_event(LOG_ERR, "Unable to locate %s", host);
 		return(-1);
 	}
-- 
2.4.6



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Isaac Dunham <ibid.ag@gmail.com>
Details
Message ID
<20150729001206.GB1924@newbook>
In-Reply-To
<1438021564-7176-1-git-send-email-soeren+git@soeren-tempel.net> (view parent)
Sender timestamp
1438128727
DKIM signature
missing
Download raw message
On Mon, Jul 27, 2015 at 08:26:04PM +0200, Sören Tempel wrote:
> diff --git a/main/ssmtp/inet6-getaddrinfo.patch b/main/ssmtp/inet6-getaddrinfo.patch
> +++ b/main/ssmtp/inet6-getaddrinfo.patch
> @@ -0,0 +1,12 @@
> +diff -up ssmtp.orig/ssmtp.c ssmtp/ssmtp.c
> +--- ssmtp.orig/ssmtp.c	2009-11-23 10:55:11.000000000 +0100
> ++++ ssmtp/ssmtp.c	2015-07-27 17:34:12.498140804 +0200
> +@@ -1157,7 +1157,7 @@ int smtp_open(char *host, int port)
> + 	snprintf(servname, sizeof(servname), "%d", port);
> + 
> + 	/* Check we can reach the host */
> +-	if (getaddrinfo(host, servname, &hints, &ai0)) {
> ++	if (getaddrinfo(host, servname, &hints, &ai0) != 0) {
> + 		log_event(LOG_ERR, "Unable to locate %s", host);
> + 		return(-1);
> + 	}

I'm wondering what this is supposed to do.
In C, "if (function(args))" means "if ((function(args)) != 0)",
so the change doesn't mean anything different.

Thanks,
Isaac Dunham


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Reply to thread Export thread (mbox)