diff options
author | solsTiCe d'Hiver | 2023-04-28 17:25:41 +0200 |
---|---|---|
committer | solsTiCe d'Hiver | 2023-04-28 17:25:41 +0200 |
commit | 2a097448032e8aba418a2cc504ba0403a008c634 (patch) | |
tree | 5ae470b247256e7031a80422321ec3688bb99c42 | |
download | aur-2a097448032e8aba418a2cc504ba0403a008c634.tar.gz |
Bring back libwrap from the dead^H^H^H^H community repo
-rw-r--r-- | .SRCINFO | 23 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | PKGBUILD | 74 | ||||
-rw-r--r-- | hosts.allow | 5 | ||||
-rw-r--r-- | hosts.deny | 7 | ||||
-rw-r--r-- | tcp-wrappers-redhat-bug11881.patch | 36 |
6 files changed, 150 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..cbc0675ba975 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,23 @@ +pkgbase = libwrap + pkgdesc = Monitors and Controls incoming TCP connections + pkgver = 7.6.31 + pkgrel = 5 + url = http://ftp.porcupine.org/pub/security/index.html + arch = x86_64 + license = BSD + depends = glibc + depends = libnsl + provides = tcp_wrappers-libs + conflicts = tcp_wrappers-libs + source = http://ftp.porcupine.org/pub/security/tcp_wrappers_7.6.tar.gz + source = http://http.debian.net/debian/pool/main/t/tcp-wrappers/tcp-wrappers_7.6.q-31.debian.tar.xz + source = tcp-wrappers-redhat-bug11881.patch + source = hosts.allow + source = hosts.deny + sha256sums = 9543d7adedf78a6de0b221ccbbd1952e08b5138717f4ade814039bb489a4315d + sha256sums = 20fec7826bde1262007e6dd43f365b5802bacc283942d93b78385ea634dc594a + sha256sums = 2e527e54c1ea208de10a206c667f751e54651eb77c973271d213e3459d690403 + sha256sums = c1b19035a14ba552e8795ec3d7171e688592c9317f2eb14373320315435565e3 + sha256sums = 969414f0a161e95fbe4cfe32df7c657a2793734d09416c00fa1116c5c0a9924f + +pkgname = libwrap diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..42fea1a765a4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/pkg +/src +/*.pkg.* +/*.tar.gz +/*.tar.xz diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..16f99f835448 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,74 @@ +# Maintainer: Maxime Gauduin <alucryd@archlinux.org> +# Contributor: Manuel Hüsers <manuel.huesers@uni-ol.de> +# Contributor: vigo <vigo.the.unholy.carpathian@gmail.com> +# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com> +# Contributor: judd <jvinet@zeroflux.org> + +pkgname=libwrap +pkgver=7.6.31 +pkgrel=5 +pkgdesc='Monitors and Controls incoming TCP connections' +arch=(x86_64) +url="http://ftp.porcupine.org/pub/security/index.html" +license=(BSD) +depends=( glibc libnsl) +provides=(tcp_wrappers-libs) +conflicts=(tcp_wrappers-libs) +source=( + http://ftp.porcupine.org/pub/security/tcp_wrappers_${pkgver%.*}.tar.gz + http://http.debian.net/debian/pool/main/t/tcp-wrappers/tcp-wrappers_${pkgver%.*}.q-${pkgver##*.}.debian.tar.xz + tcp-wrappers-redhat-bug11881.patch + hosts.allow + hosts.deny +) +sha256sums=('9543d7adedf78a6de0b221ccbbd1952e08b5138717f4ade814039bb489a4315d' + '20fec7826bde1262007e6dd43f365b5802bacc283942d93b78385ea634dc594a' + '2e527e54c1ea208de10a206c667f751e54651eb77c973271d213e3459d690403' + 'c1b19035a14ba552e8795ec3d7171e688592c9317f2eb14373320315435565e3' + '969414f0a161e95fbe4cfe32df7c657a2793734d09416c00fa1116c5c0a9924f') + +prepare() { + cd tcp_wrappers_${pkgver%.*} + + for patch in $(cat ../debian/patches/series); do + patch -Np1 -i ../debian/patches/${patch} + done + patch -Np1 -i ../tcp-wrappers-redhat-bug11881.patch + + sed -i '/^config-check/ i\ +cflags: config-check\ +' Makefile +} + +build() { + cd tcp_wrappers_${pkgver%.*} + + # first run of make fails but second succeeds!??? + # if you read this, please help me find a better fix than to run twice make + make \ + COPTS="$CFLAGS" \ + LDOPTS="$LDFLAGS" \ + REAL_DAEMON_DIR=/usr/bin \ + STYLE='-DPROCESS_OPTIONS' \ + linux || make \ + COPTS="$CFLAGS" \ + LDOPTS="$LDFLAGS" \ + REAL_DAEMON_DIR=/usr/bin \ + STYLE='-DPROCESS_OPTIONS' \ + linux +} + +package() { + + cd tcp_wrappers_${pkgver%.*} + + install -Dm 644 tcpd.h -t "${pkgdir}"/usr/include/ + install -Dm 644 shared/libwrap.so.0.${pkgver%.*} -t "${pkgdir}"/usr/lib/ + ln -s libwrap.so.0.${pkgver%.*} "${pkgdir}"/usr/lib/libwrap.so.0 + ln -s libwrap.so.0 "${pkgdir}"/usr/lib/libwrap.so + + install -Dm 644 DISCLAIMER -t "${pkgdir}"/usr/share/licenses/libwrap/ +} + + +# vim: ts=2 sw=2 et: diff --git a/hosts.allow b/hosts.allow new file mode 100644 index 000000000000..e5c035d65079 --- /dev/null +++ b/hosts.allow @@ -0,0 +1,5 @@ +# +# /etc/hosts.allow +# + +# End of file diff --git a/hosts.deny b/hosts.deny new file mode 100644 index 000000000000..cbb00b29d1d3 --- /dev/null +++ b/hosts.deny @@ -0,0 +1,7 @@ +# +# /etc/hosts.deny +# + +ALL: ALL + +# End of file diff --git a/tcp-wrappers-redhat-bug11881.patch b/tcp-wrappers-redhat-bug11881.patch new file mode 100644 index 000000000000..2603343e2139 --- /dev/null +++ b/tcp-wrappers-redhat-bug11881.patch @@ -0,0 +1,36 @@ +--- tcp_wrappers_7.6/tcpd.c.bug11881 ++++ tcp_wrappers_7.6/tcpd.c +@@ -60,10 +60,10 @@ + */ + + if (argv[0][0] == '/') { +- strcpy(path, argv[0]); ++ strncpy(path, argv[0], sizeof(path)); + argv[0] = strrchr(argv[0], '/') + 1; + } else { +- sprintf(path, "%s/%s", REAL_DAEMON_DIR, argv[0]); ++ snprintf(path, sizeof(path), "%s/%s", REAL_DAEMON_DIR, argv[0]); + } + + /* +--- tcp_wrappers_7.6/eval.c.bug11881 ++++ tcp_wrappers_7.6/eval.c +@@ -111,7 +111,7 @@ + return (hostinfo); + #endif + if (STR_NE(eval_user(request), unknown)) { +- sprintf(both, "%s@%s", request->user, hostinfo); ++ snprintf(both, sizeof(both), "%s@%s", request->user, hostinfo); + return (both); + } else { + return (hostinfo); +@@ -128,7 +128,7 @@ + char *daemon = eval_daemon(request); + + if (STR_NE(host, unknown)) { +- sprintf(both, "%s@%s", daemon, host); ++ snprintf(both, sizeof(both), "%s@%s", daemon, host); + return (both); + } else { + return (daemon); + |