Date: Wednesday, June 16, 2021 @ 07:44:15
  Author: arojas
Revision: 964250

archrelease: copy trunk to community-x86_64

Added:
  libmilter/repos/community-x86_64/
  libmilter/repos/community-x86_64/PKGBUILD
    (from rev 964249, libmilter/trunk/PKGBUILD)
  libmilter/repos/community-x86_64/fd-passing-libmilter.patch
    (from rev 964249, libmilter/trunk/fd-passing-libmilter.patch)
  libmilter/repos/community-x86_64/sendmail-8.15.2-glibc-2.30.patch
    (from rev 964249, libmilter/trunk/sendmail-8.15.2-glibc-2.30.patch)

----------------------------------+
 PKGBUILD                         |   58 ++++++++++++++++++++++++++
 fd-passing-libmilter.patch       |   80 +++++++++++++++++++++++++++++++++++++
 sendmail-8.15.2-glibc-2.30.patch |   57 ++++++++++++++++++++++++++
 3 files changed, 195 insertions(+)

Copied: libmilter/repos/community-x86_64/PKGBUILD (from rev 964249, 
libmilter/trunk/PKGBUILD)
===================================================================
--- community-x86_64/PKGBUILD                           (rev 0)
+++ community-x86_64/PKGBUILD   2021-06-16 07:44:15 UTC (rev 964250)
@@ -0,0 +1,58 @@
+# Maintainer: Gaetan Bisson <bis...@archlinux.org>
+# Contributor: Sergej Pupykin <pupykin.s+a...@gmail.com>
+# Contributor: mutantmonkey <mutantmon...@gmail.com>
+
+pkgname=libmilter
+_pkgname=sendmail
+pkgver=8.15.2
+pkgrel=3
+pkgdesc='Implementation of the sendmail Mail Filter API'
+url='https://www.proofpoint.com/us/sendmail-open-source'
+arch=('x86_64')
+options=('staticlibs')
+license=('custom:Sendmail open source license')
+validpgpkeys=('30BCA74705FA415455731D7BAAF5B5DE05BDCC53')
+source=("https://ftp.sendmail.org/${_pkgname}.${pkgver}.tar.gz"{,.sig}
+        'fd-passing-libmilter.patch'
+        'sendmail-8.15.2-glibc-2.30.patch')
+sha256sums=('24f94b5fd76705f15897a78932a5f2439a32b1a2fdc35769bb1a5f5d9b4db439'
+            'SKIP'
+            'b856ebc17e39151652bda93f40f79756ac83eb4a0b67e6d55c049f3ebde42983'
+            'f5378261028782c95014b0c91546e87132c13d4a39d81f61fc6039a0738a0c71')
+
+
+prepare() {
+       cd "${srcdir}/${_pkgname}-${pkgver}"
+       patch -p1 -i ../fd-passing-libmilter.patch # FS#49421
+       patch -p0 -i ../sendmail-8.15.2-glibc-2.30.patch
+
+       # From 
http://www.j-chkmail.org/wiki/doku.php/doc/installation/start#libmilter
+       cat >> devtools/Site/site.config.m4 <<EOF
+dnl Include our flags
+APPENDDEF(\`conf_libmilter_ENVDEF',\`${CPPFLAGS} ${CFLAGS}')
+dnl Enable libmilter with a pool of workers
+APPENDDEF(\`conf_libmilter_ENVDEF',\`-D_FFR_WORKERS_POOL=1 -DMIN_WORKERS=4')
+dnl Use poll instead of select
+APPENDDEF(\`conf_libmilter_ENVDEF',\`-DSM_CONF_POLL=1')
+dnl Enable IPv6
+APPENDDEF(\`conf_libmilter_ENVDEF',\`-DNETINET6=1')
+dnl Add -fPIC
+APPENDDEF(\`conf_libmilter_ENVDEF',\`-fPIC')
+dnl Permissions
+APPENDDEF(\`confINCGRP',\`root')
+APPENDDEF(\`confLIBGRP',\`root')
+EOF
+}
+
+build() {
+       cd "${srcdir}/${_pkgname}-${pkgver}/${pkgname}"
+       ./Build
+}
+
+package() {
+       cd "${srcdir}/${_pkgname}-${pkgver}/${pkgname}"
+       install -d "${pkgdir}/usr/lib"
+       ./Build DESTDIR="${pkgdir}" install
+       install -Dm644 ../LICENSE 
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+       chown -R root:root "${pkgdir}"
+}

Copied: libmilter/repos/community-x86_64/fd-passing-libmilter.patch (from rev 
964249, libmilter/trunk/fd-passing-libmilter.patch)
===================================================================
--- community-x86_64/fd-passing-libmilter.patch                         (rev 0)
+++ community-x86_64/fd-passing-libmilter.patch 2021-06-16 07:44:15 UTC (rev 
964250)
@@ -0,0 +1,80 @@
+Description: systemd-like socket activation support for libmilter
+Author: Mikhail Gusarov <dotted...@debian.org
+diff --git a/libmilter/docs/smfi_setconn.html 
b/libmilter/docs/smfi_setconn.html
+index 70a510e..013f04e 100644
+--- a/libmilter/docs/smfi_setconn.html
++++ b/libmilter/docs/smfi_setconn.html
+@@ -43,6 +43,7 @@ Set the socket through which this filter should communicate 
with sendmail.
+       <LI><CODE>{unix|local}:/path/to/file</CODE> -- A named pipe.
+       <LI><CODE>inet:port@{hostname|ip-address}</CODE> -- An IPV4 socket.
+       <LI><CODE>inet6:port@{hostname|ip-address}</CODE> -- An IPV6 socket.
++      <LI><CODE>fd:number</CODE> -- Pre-opened file descriptor.
+       </UL>
+       </TD></TR>
+     </TABLE>
+diff --git a/libmilter/listener.c b/libmilter/listener.c
+index 48c552f..2249a1f 100644
+--- a/libmilter/listener.c
++++ b/libmilter/listener.c
+@@ -197,6 +197,11 @@ mi_milteropen(conn, backlog, rmsocket, name)
+                       L_socksize = sizeof addr.sin6;
+               }
+ #endif /* NETINET6 */
++              else if (strcasecmp(p, "fd") == 0)
++              {
++                      addr.sa.sa_family = AF_UNSPEC;
++                      L_socksize = sizeof (_SOCK_ADDR);
++              }
+               else
+               {
+                       smi_log(SMI_LOG_ERR, "%s: unknown socket type %s",
+@@ -443,7 +448,21 @@ mi_milteropen(conn, backlog, rmsocket, name)
+       }
+ #endif /* NETINET || NETINET6 */
+ 
+-      sock = socket(addr.sa.sa_family, SOCK_STREAM, 0);
++      if (addr.sa.sa_family == AF_UNSPEC)
++      {
++              char *end;
++              sock = strtol(colon, &end, 10);
++              if (*end != '\0' || sock < 0)
++              {
++                      smi_log(SMI_LOG_ERR, "%s: expected positive integer as 
fd, got %s", name, colon);
++                      return INVALID_SOCKET;
++              }
++      }
++      else
++      {
++              sock = socket(addr.sa.sa_family, SOCK_STREAM, 0);
++      }
++
+       if (!ValidSocket(sock))
+       {
+               smi_log(SMI_LOG_ERR,
+@@ -466,6 +485,7 @@ mi_milteropen(conn, backlog, rmsocket, name)
+ #if NETUNIX
+           addr.sa.sa_family != AF_UNIX &&
+ #endif /* NETUNIX */
++          addr.sa.sa_family != AF_UNSPEC &&
+           setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *) &sockopt,
+                      sizeof(sockopt)) == -1)
+       {
+@@ -511,7 +531,8 @@ mi_milteropen(conn, backlog, rmsocket, name)
+       }
+ #endif /* NETUNIX */
+ 
+-      if (bind(sock, &addr.sa, L_socksize) < 0)
++      if (addr.sa.sa_family != AF_UNSPEC &&
++          bind(sock, &addr.sa, L_socksize) < 0)
+       {
+               smi_log(SMI_LOG_ERR,
+                       "%s: Unable to bind to port %s: %s",
+@@ -817,7 +838,7 @@ mi_listener(conn, dbg, smfi, timeout, backlog)
+ # ifdef BSD4_4_SOCKADDR
+                    cliaddr.sa.sa_len == 0 ||
+ # endif /* BSD4_4_SOCKADDR */
+-                   cliaddr.sa.sa_family != L_family))
++                   (L_family != AF_UNSPEC && cliaddr.sa.sa_family != 
L_family)))
+               {
+                       (void) closesocket(connfd);
+                       connfd = INVALID_SOCKET;

Copied: libmilter/repos/community-x86_64/sendmail-8.15.2-glibc-2.30.patch (from 
rev 964249, libmilter/trunk/sendmail-8.15.2-glibc-2.30.patch)
===================================================================
--- community-x86_64/sendmail-8.15.2-glibc-2.30.patch                           
(rev 0)
+++ community-x86_64/sendmail-8.15.2-glibc-2.30.patch   2021-06-16 07:44:15 UTC 
(rev 964250)
@@ -0,0 +1,57 @@
+The former deprecated macro RES_USE_INET6 is gone with glibc 2.30
+
+---
+ libmilter/sm_gethost.c |    6 ++++--
+ sendmail/conf.c        |    6 ++++--
+ 2 files changed, 8 insertions(+), 4 deletions(-)
+
+--- libmilter/sm_gethost.c
++++ libmilter/sm_gethost.c     2019-09-28 07:27:46.512228011 +0000
+@@ -51,18 +51,20 @@ sm_getipnodebyname(name, family, flags,
+ {
+       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/conf.c
++++ sendmail/conf.c    2019-09-28 07:28:39.103245002 +0000
+@@ -4242,18 +4242,20 @@ sm_getipnodebyname(name, family, flags,
+ 
+ # 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)
+       {

Reply via email to