mail-mta/sendmail: fix for glibc-2.30, bug #700108
authorSergei Trofimovich <slyfox@gentoo.org>
Thu, 12 Mar 2020 00:08:59 +0000 (00:08 +0000)
committerSergei Trofimovich <slyfox@gentoo.org>
Thu, 12 Mar 2020 00:25:30 +0000 (00:25 +0000)
Patch by John Covici.

Reported-by: Hanno Böck
Fixed-by: John Covici
Closes: https://bugs.gentoo.org/700108
Package-Manager: Portage-2.3.93, Repoman-2.3.20
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
mail-mta/sendmail/files/sendmail-8.15.2-glibc-2.30.patch [new file with mode: 0644]
mail-mta/sendmail/sendmail-8.15.2-r2.ebuild

diff --git a/mail-mta/sendmail/files/sendmail-8.15.2-glibc-2.30.patch b/mail-mta/sendmail/files/sendmail-8.15.2-glibc-2.30.patch
new file mode 100644 (file)
index 0000000..03281d1
--- /dev/null
@@ -0,0 +1,52 @@
+https://bugs.gentoo.org/700108
+
+--- sendmail-8.15.2-r1/libmilter/sm_gethost.c.orig     2014-03-04 19:59:45.000000000 -0500
++++ sendmail-8.15.2-r1/libmilter/sm_gethost.c  2019-11-15 09:32:25.812406080 -0500
+@@ -51,18 +51,21 @@
+ {
+       bool resv6 = true;
+       struct hostent *h;
+-
++#ifdef RES_USE_INET6
+       if (family == AF_INET6)
+       {
+               /* From RFC2133, section 6.1 */
+               resv6 = bitset(RES_USE_INET6, _res.options);
+               _res.options |= RES_USE_INET6;
+       }
++#endif
+       SM_SET_H_ERRNO(0);
+       h = gethostbyname(name);
++#ifdef RES_USE_INET6
+       if (family == AF_INET6 && !resv6)
+               _res.options &= ~RES_USE_INET6;
++#endif
+       /* the function is supposed to return only the requested family */
+       if (h != NULL && h->h_addrtype != family)
+       {
+--- sendmail-8.15.2-r2/sendmail/conf.c.orig    2019-11-14 17:36:41.262218822 -0500
++++ sendmail-8.15.2-r2/sendmail/conf.c 2019-11-15 09:57:43.550284580 -0500
+@@ -4243,18 +4243,21 @@
+ # else /* HAS_GETHOSTBYNAME2 */
+       bool resv6 = true;
+-
++#ifdef RES_USE_INET6
+       if (family == AF_INET6)
+       {
+               /* From RFC2133, section 6.1 */
+               resv6 = bitset(RES_USE_INET6, _res.options);
+               _res.options |= RES_USE_INET6;
+       }
++#endif
+       SM_SET_H_ERRNO(0);
+       h = gethostbyname(name);
++#ifdef RES_USE_INET6
+       if (!resv6)
+               _res.options &= ~RES_USE_INET6;
++#endif
+       /* the function is supposed to return only the requested family */
+       if (h != NULL && h->h_addrtype != family)
+       {
index d3fd92fa5bb7b11ca9083d027b7f273ec3feb551..b8ea40322512d7bbf371797771feb8b569054c4c 100644 (file)
@@ -59,6 +59,7 @@ src_prepare() {
        eapply "${FILESDIR}"/libmilter-sharedlib.patch
        eapply -p0 "${FILESDIR}"/sendmail-starttls-multi-crl.patch
        eapply "${FILESDIR}"/${P}-openssl-1.1.0-fix.patch
+       eapply "${FILESDIR}"/${P}-glibc-2.30.patch
 
        local confCC="$(tc-getCC)"
        local confCCOPTS="${CFLAGS}"