[arch-commits] Commit in tcp-wrappers/repos (6 files)

Maxime Gauduin alucryd at archlinux.org
Sun Oct 2 13:32:22 UTC 2016


    Date: Sunday, October 2, 2016 @ 13:32:21
  Author: alucryd
Revision: 191209

Fix bad communitypkg

Added:
  tcp-wrappers/repos/community-i686/PKGBUILD
  tcp-wrappers/repos/community-i686/tcp-wrappers-headers.patch
  tcp-wrappers/repos/community-i686/tcp-wrappers-redhat-bug11881.patch
  tcp-wrappers/repos/community-x86_64/PKGBUILD
  tcp-wrappers/repos/community-x86_64/tcp-wrappers-headers.patch
  tcp-wrappers/repos/community-x86_64/tcp-wrappers-redhat-bug11881.patch

-----------------------------------------------------+
 community-i686/PKGBUILD                             |   86 +++++
 community-i686/tcp-wrappers-headers.patch           |  296 ++++++++++++++++++
 community-i686/tcp-wrappers-redhat-bug11881.patch   |   36 ++
 community-x86_64/PKGBUILD                           |   86 +++++
 community-x86_64/tcp-wrappers-headers.patch         |  296 ++++++++++++++++++
 community-x86_64/tcp-wrappers-redhat-bug11881.patch |   36 ++
 6 files changed, 836 insertions(+)

Added: community-i686/PKGBUILD
===================================================================
--- community-i686/PKGBUILD	                        (rev 0)
+++ community-i686/PKGBUILD	2016-10-02 13:32:21 UTC (rev 191209)
@@ -0,0 +1,86 @@
+# $Id: PKGBUILD 191207 2016-10-02 13:29:29Z alucryd $
+# Maintainer: Maxime Gauduin <alucryd at archlinux.org>
+# Contributor: Manuel Hüsers <manuel.huesers at uni-ol.de>
+# Contributor: vigo <vigo.the.unholy.carpathian at gmail.com>
+# Contributor: Sergej Pupykin <pupykin.s+arch at gmail.com>
+# Contributor: judd <jvinet at zeroflux.org>
+
+pkgbase=tcp-wrappers
+pkgname=('libwrap' 'tcp-wrappers')
+pkgver=7.6.24
+pkgrel=2
+pkgdesc='Monitors and Controls incoming TCP connections'
+arch=('i686' 'x86_64')
+url='ftp://ftp.porcupine.org/pub/security/index.html'
+license=('BSD')
+depends=('glibc')
+options=('!makeflags')
+source=("ftp://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-headers.patch'
+        'tcp-wrappers-redhat-bug11881.patch'
+        'hosts.allow'
+        'hosts.deny')
+sha256sums=('9543d7adedf78a6de0b221ccbbd1952e08b5138717f4ade814039bb489a4315d'
+            '672ad0d3f70579815cd8f15c29054c49f6fd9902863be42cc2452a9ecbe8eacd'
+            'caf0719fdac5c0c8874420af63bddf3b970c40d464f0553a9822a53d372854d8'
+            '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-headers.patch
+  patch -Np1 -i ../tcp-wrappers-redhat-bug11881.patch
+}
+
+build() {
+  cd tcp_wrappers_${pkgver%.*}
+
+  make \
+    COPTS="$CFLAGS" \
+    LDOPTS="$LDFLAGS" \
+    REAL_DAEMON_DIR='/usr/bin' \
+    STYLE='-DPROCESS_OPTIONS' \
+    linux
+}
+
+package_libwrap() {
+  provides=('tcp_wrappers-libs')
+  conflicts=('tcp_wrappers-libs')
+
+  cd tcp_wrappers_${pkgver%.*}
+
+  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/
+}
+
+package_tcp-wrappers() {
+  depends=('libwrap')
+  provides=('tcp_wrappers')
+  conflicts=('tcp_wrappers')
+  backup=('etc/hosts.allow'
+          'etc/hosts.deny')
+
+  cd tcp_wrappers_${pkgver%.*}
+
+  install -Dm 755 safe_finger tcpd tcpdchk tcpdmatch try-from -t "${pkgdir}"/usr/bin/
+  install -Dm 644 tcpd.h -t "${pkgdir}"/usr/include/
+  install -Dm 644 *.3 -t "${pkgdir}"/usr/share/man/man3/
+  install -Dm 644 *.5 -t "${pkgdir}"/usr/share/man/man5/
+  install -Dm 644 *.8 -t "${pkgdir}"/usr/share/man/man8/
+  install -Dm 644 ../hosts.{allow,deny} -t "${pkgdir}"/etc/
+  install -Dm 644 README -t "${pkgdir}"/usr/share/doc/tcp-wrappers/
+
+  install -dm 755 "${pkgdir}"/usr/share/licenses
+  ln -s libwrap "${pkgdir}"/usr/share/licenses/tcp-wrappers
+}
+
+# vim: ts=2 sw=2 et:

Added: community-i686/tcp-wrappers-headers.patch
===================================================================
--- community-i686/tcp-wrappers-headers.patch	                        (rev 0)
+++ community-i686/tcp-wrappers-headers.patch	2016-10-02 13:32:21 UTC (rev 191209)
@@ -0,0 +1,296 @@
+--- a/options.c
++++ b/options.c
+@@ -34,6 +34,8 @@
+ 
+ /* System libraries. */
+ 
++#include <unistd.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/socket.h>
+--- a/safe_finger.c
++++ b/safe_finger.c
+@@ -20,6 +20,11 @@
+ 
+ /* System libraries */
+ 
++#include <unistd.h>
++#include <fcntl.h>
++#include <stdlib.h>
++#include <sys/wait.h>
++#include <grp.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <signal.h>
+@@ -27,7 +31,7 @@
+ #include <ctype.h>
+ #include <pwd.h>
+ 
+-extern void exit();
++int pipe_stdin(char **argv);
+ 
+ /* Local stuff */
+ 
+--- a/scaffold.c
++++ b/scaffold.c
+@@ -10,6 +10,7 @@
+ 
+ /* System libraries. */
+ 
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/socket.h>
+@@ -27,7 +27,4 @@
+ #endif
+ 
+-#ifndef INET6
+-extern char *malloc();
+-#endif
+ 
+ /* Application-specific. */
+--- a/shell_cmd.c
++++ b/shell_cmd.c
+@@ -14,6 +14,10 @@
+ 
+ /* System libraries. */
+ 
++#include <unistd.h>
++#include <stdlib.h>
++#include <fcntl.h>
++#include <sys/wait.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <signal.h>
+@@ -25,8 +25,6 @@
+ #include <syslog.h>
+ #include <string.h>
+ 
+-extern void exit();
+-
+ /* Local stuff. */
+ 
+ #include "tcpd.h"
+--- a/tcpdchk.c
++++ b/tcpdchk.c
+@@ -20,6 +20,8 @@
+ 
+ /* System libraries. */
+ 
++#include <unistd.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #ifdef INET6
+@@ -35,10 +36,7 @@
+ #include <netdb.h>
+ #include <string.h>
+ 
+-extern int errno;
+-extern void exit();
+-extern int optind;
+-extern char *optarg;
++int cidr_mask_addr(char *str);
+ 
+ #ifndef INADDR_NONE
+ #define INADDR_NONE     (-1)		/* XXX should be 0xffffffff */
+--- a/clean_exit.c
++++ b/clean_exit.c
+@@ -13,8 +13,8 @@
+ #endif
+ 
+ #include <stdio.h>
+-
+-extern void exit();
++#include <unistd.h>
++#include <stdlib.h>
+ 
+ #include "tcpd.h"
+ 
+--- a/hosts_access.c
++++ b/hosts_access.c
+@@ -23,6 +23,7 @@
+ 
+ /* System libraries. */
+ 
++#include <stdlib.h>
+ #include <sys/types.h>
+ #ifdef INT32_T
+     typedef uint32_t u_int32_t;
+@@ -43,8 +44,8 @@
+ #include <netdb.h>
+ #endif
+ 
+-extern char *fgets();
+-extern int errno;
++static int match_pattern_ylo(const char *s, const char *pattern);
++int cidr_mask_addr(char *str);
+ 
+ #ifndef	INADDR_NONE
+ #define	INADDR_NONE	(-1)		/* XXX should be 0xffffffff */
+--- a/inetcf.c
++++ b/inetcf.c
+@@ -9,15 +9,14 @@
+ static char sccsid[] = "@(#) inetcf.c 1.7 97/02/12 02:13:23";
+ #endif
+ 
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <stdio.h>
+ #include <errno.h>
+ #include <string.h>
+ 
+-extern int errno;
+-extern void exit();
+-
++#include "scaffold.h"
+ #include "tcpd.h"
+ #include "inetcf.h"
+ 
+--- a/percent_x.c
++++ b/percent_x.c
+@@ -16,12 +16,12 @@
+ 
+ /* System libraries. */
+ 
++#include <unistd.h>
++#include <stdlib.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <string.h>
+ 
+-extern void exit();
+-
+ /* Local stuff. */
+ 
+ #include "tcpd.h"
+--- a/rfc931.c
++++ b/rfc931.c
+@@ -15,6 +15,7 @@
+ 
+ /* System libraries. */
+ 
++#include <unistd.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <sys/types.h>
+--- a/tcpd.c
++++ b/tcpd.c
+@@ -16,6 +16,7 @@
+ 
+ /* System libraries. */
+ 
++#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+@@ -39,6 +39,8 @@
+ #include "patchlevel.h"
+ #include "tcpd.h"
+ 
++void fix_options(struct request_info *request);
++
+ int     allow_severity = SEVERITY;	/* run-time adjustable */
+ int     deny_severity = LOG_WARNING;	/* ditto */
+ 
+--- a/tcpdmatch.c
++++ b/tcpdmatch.c
+@@ -19,6 +19,8 @@
+ 
+ /* System libraries. */
+ 
++#include <unistd.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/socket.h>
+@@ -30,9 +32,6 @@
+ #include <setjmp.h>
+ #include <string.h>
+ 
+-extern void exit();
+-extern int optind;
+-extern char *optarg;
+ 
+ #ifndef	INADDR_NONE
+ #define	INADDR_NONE	(-1)		/* XXX should be 0xffffffff */
+--- a/update.c
++++ b/update.c
+@@ -19,6 +19,7 @@
+ 
+ /* System libraries */
+ 
++#include <unistd.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <string.h>
+--- a/misc.c
++++ b/misc.c
+@@ -14,11 +14,10 @@
+ #include <arpa/inet.h>
+ #include <stdio.h>
+ #include <string.h>
++#include <stdlib.h>
+ 
+ #include "tcpd.h"
+ 
+-extern char *fgets();
+-
+ #ifndef	INADDR_NONE
+ #define	INADDR_NONE	(-1)		/* XXX should be 0xffffffff */
+ #endif
+--- a/fix_options.c
++++ b/fix_options.c
+@@ -32,6 +32,7 @@
+ 
+ /* fix_options - get rid of IP-level socket options */
+ 
++void
+ fix_options(request)
+ struct request_info *request;
+ {
+@@ -38,11 +38,8 @@
+ #ifdef IP_OPTIONS
+     unsigned char optbuf[BUFFER_SIZE / 3], *cp;
+     char    lbuf[BUFFER_SIZE], *lp;
+-#ifdef __GLIBC__
+-    size_t  optsize = sizeof(optbuf), ipproto;
+-#else
+-    int     optsize = sizeof(optbuf), ipproto;
+-#endif
++    socklen_t optsize = sizeof(optbuf);
++    int ipproto;
+     struct protoent *ip;
+     int     fd = request->fd;
+     unsigned int opt;
+--- a/socket.c
++++ b/socket.c
+@@ -95,11 +95,7 @@
+     static struct sockaddr_in client;
+     static struct sockaddr_in server;
+ #endif
+-#ifdef __GLIBC__
+-    size_t  len;
+-#else
+-    int     len;
+-#endif
++    socklen_t len;
+     char    buf[BUFSIZ];
+     int     fd = request->fd;
+ 
+@@ -430,11 +426,7 @@
+ #else
+     struct sockaddr_in sin;
+ #endif
+-#ifdef __GLIBC__
+-    size_t  size = sizeof(sin);
+-#else
+-    int     size = sizeof(sin);
+-#endif
++    socklen_t size;
+ 
+     /*
+      * Eat up the not-yet received datagram. Some systems insist on a
+

Added: community-i686/tcp-wrappers-redhat-bug11881.patch
===================================================================
--- community-i686/tcp-wrappers-redhat-bug11881.patch	                        (rev 0)
+++ community-i686/tcp-wrappers-redhat-bug11881.patch	2016-10-02 13:32:21 UTC (rev 191209)
@@ -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);
+

Added: community-x86_64/PKGBUILD
===================================================================
--- community-x86_64/PKGBUILD	                        (rev 0)
+++ community-x86_64/PKGBUILD	2016-10-02 13:32:21 UTC (rev 191209)
@@ -0,0 +1,86 @@
+# $Id: PKGBUILD 191207 2016-10-02 13:29:29Z alucryd $
+# Maintainer: Maxime Gauduin <alucryd at archlinux.org>
+# Contributor: Manuel Hüsers <manuel.huesers at uni-ol.de>
+# Contributor: vigo <vigo.the.unholy.carpathian at gmail.com>
+# Contributor: Sergej Pupykin <pupykin.s+arch at gmail.com>
+# Contributor: judd <jvinet at zeroflux.org>
+
+pkgbase=tcp-wrappers
+pkgname=('libwrap' 'tcp-wrappers')
+pkgver=7.6.24
+pkgrel=2
+pkgdesc='Monitors and Controls incoming TCP connections'
+arch=('i686' 'x86_64')
+url='ftp://ftp.porcupine.org/pub/security/index.html'
+license=('BSD')
+depends=('glibc')
+options=('!makeflags')
+source=("ftp://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-headers.patch'
+        'tcp-wrappers-redhat-bug11881.patch'
+        'hosts.allow'
+        'hosts.deny')
+sha256sums=('9543d7adedf78a6de0b221ccbbd1952e08b5138717f4ade814039bb489a4315d'
+            '672ad0d3f70579815cd8f15c29054c49f6fd9902863be42cc2452a9ecbe8eacd'
+            'caf0719fdac5c0c8874420af63bddf3b970c40d464f0553a9822a53d372854d8'
+            '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-headers.patch
+  patch -Np1 -i ../tcp-wrappers-redhat-bug11881.patch
+}
+
+build() {
+  cd tcp_wrappers_${pkgver%.*}
+
+  make \
+    COPTS="$CFLAGS" \
+    LDOPTS="$LDFLAGS" \
+    REAL_DAEMON_DIR='/usr/bin' \
+    STYLE='-DPROCESS_OPTIONS' \
+    linux
+}
+
+package_libwrap() {
+  provides=('tcp_wrappers-libs')
+  conflicts=('tcp_wrappers-libs')
+
+  cd tcp_wrappers_${pkgver%.*}
+
+  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/
+}
+
+package_tcp-wrappers() {
+  depends=('libwrap')
+  provides=('tcp_wrappers')
+  conflicts=('tcp_wrappers')
+  backup=('etc/hosts.allow'
+          'etc/hosts.deny')
+
+  cd tcp_wrappers_${pkgver%.*}
+
+  install -Dm 755 safe_finger tcpd tcpdchk tcpdmatch try-from -t "${pkgdir}"/usr/bin/
+  install -Dm 644 tcpd.h -t "${pkgdir}"/usr/include/
+  install -Dm 644 *.3 -t "${pkgdir}"/usr/share/man/man3/
+  install -Dm 644 *.5 -t "${pkgdir}"/usr/share/man/man5/
+  install -Dm 644 *.8 -t "${pkgdir}"/usr/share/man/man8/
+  install -Dm 644 ../hosts.{allow,deny} -t "${pkgdir}"/etc/
+  install -Dm 644 README -t "${pkgdir}"/usr/share/doc/tcp-wrappers/
+
+  install -dm 755 "${pkgdir}"/usr/share/licenses
+  ln -s libwrap "${pkgdir}"/usr/share/licenses/tcp-wrappers
+}
+
+# vim: ts=2 sw=2 et:

Added: community-x86_64/tcp-wrappers-headers.patch
===================================================================
--- community-x86_64/tcp-wrappers-headers.patch	                        (rev 0)
+++ community-x86_64/tcp-wrappers-headers.patch	2016-10-02 13:32:21 UTC (rev 191209)
@@ -0,0 +1,296 @@
+--- a/options.c
++++ b/options.c
+@@ -34,6 +34,8 @@
+ 
+ /* System libraries. */
+ 
++#include <unistd.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/socket.h>
+--- a/safe_finger.c
++++ b/safe_finger.c
+@@ -20,6 +20,11 @@
+ 
+ /* System libraries */
+ 
++#include <unistd.h>
++#include <fcntl.h>
++#include <stdlib.h>
++#include <sys/wait.h>
++#include <grp.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <signal.h>
+@@ -27,7 +31,7 @@
+ #include <ctype.h>
+ #include <pwd.h>
+ 
+-extern void exit();
++int pipe_stdin(char **argv);
+ 
+ /* Local stuff */
+ 
+--- a/scaffold.c
++++ b/scaffold.c
+@@ -10,6 +10,7 @@
+ 
+ /* System libraries. */
+ 
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/socket.h>
+@@ -27,7 +27,4 @@
+ #endif
+ 
+-#ifndef INET6
+-extern char *malloc();
+-#endif
+ 
+ /* Application-specific. */
+--- a/shell_cmd.c
++++ b/shell_cmd.c
+@@ -14,6 +14,10 @@
+ 
+ /* System libraries. */
+ 
++#include <unistd.h>
++#include <stdlib.h>
++#include <fcntl.h>
++#include <sys/wait.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <signal.h>
+@@ -25,8 +25,6 @@
+ #include <syslog.h>
+ #include <string.h>
+ 
+-extern void exit();
+-
+ /* Local stuff. */
+ 
+ #include "tcpd.h"
+--- a/tcpdchk.c
++++ b/tcpdchk.c
+@@ -20,6 +20,8 @@
+ 
+ /* System libraries. */
+ 
++#include <unistd.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #ifdef INET6
+@@ -35,10 +36,7 @@
+ #include <netdb.h>
+ #include <string.h>
+ 
+-extern int errno;
+-extern void exit();
+-extern int optind;
+-extern char *optarg;
++int cidr_mask_addr(char *str);
+ 
+ #ifndef INADDR_NONE
+ #define INADDR_NONE     (-1)		/* XXX should be 0xffffffff */
+--- a/clean_exit.c
++++ b/clean_exit.c
+@@ -13,8 +13,8 @@
+ #endif
+ 
+ #include <stdio.h>
+-
+-extern void exit();
++#include <unistd.h>
++#include <stdlib.h>
+ 
+ #include "tcpd.h"
+ 
+--- a/hosts_access.c
++++ b/hosts_access.c
+@@ -23,6 +23,7 @@
+ 
+ /* System libraries. */
+ 
++#include <stdlib.h>
+ #include <sys/types.h>
+ #ifdef INT32_T
+     typedef uint32_t u_int32_t;
+@@ -43,8 +44,8 @@
+ #include <netdb.h>
+ #endif
+ 
+-extern char *fgets();
+-extern int errno;
++static int match_pattern_ylo(const char *s, const char *pattern);
++int cidr_mask_addr(char *str);
+ 
+ #ifndef	INADDR_NONE
+ #define	INADDR_NONE	(-1)		/* XXX should be 0xffffffff */
+--- a/inetcf.c
++++ b/inetcf.c
+@@ -9,15 +9,14 @@
+ static char sccsid[] = "@(#) inetcf.c 1.7 97/02/12 02:13:23";
+ #endif
+ 
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <stdio.h>
+ #include <errno.h>
+ #include <string.h>
+ 
+-extern int errno;
+-extern void exit();
+-
++#include "scaffold.h"
+ #include "tcpd.h"
+ #include "inetcf.h"
+ 
+--- a/percent_x.c
++++ b/percent_x.c
+@@ -16,12 +16,12 @@
+ 
+ /* System libraries. */
+ 
++#include <unistd.h>
++#include <stdlib.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <string.h>
+ 
+-extern void exit();
+-
+ /* Local stuff. */
+ 
+ #include "tcpd.h"
+--- a/rfc931.c
++++ b/rfc931.c
+@@ -15,6 +15,7 @@
+ 
+ /* System libraries. */
+ 
++#include <unistd.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <sys/types.h>
+--- a/tcpd.c
++++ b/tcpd.c
+@@ -16,6 +16,7 @@
+ 
+ /* System libraries. */
+ 
++#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+@@ -39,6 +39,8 @@
+ #include "patchlevel.h"
+ #include "tcpd.h"
+ 
++void fix_options(struct request_info *request);
++
+ int     allow_severity = SEVERITY;	/* run-time adjustable */
+ int     deny_severity = LOG_WARNING;	/* ditto */
+ 
+--- a/tcpdmatch.c
++++ b/tcpdmatch.c
+@@ -19,6 +19,8 @@
+ 
+ /* System libraries. */
+ 
++#include <unistd.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/socket.h>
+@@ -30,9 +32,6 @@
+ #include <setjmp.h>
+ #include <string.h>
+ 
+-extern void exit();
+-extern int optind;
+-extern char *optarg;
+ 
+ #ifndef	INADDR_NONE
+ #define	INADDR_NONE	(-1)		/* XXX should be 0xffffffff */
+--- a/update.c
++++ b/update.c
+@@ -19,6 +19,7 @@
+ 
+ /* System libraries */
+ 
++#include <unistd.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <string.h>
+--- a/misc.c
++++ b/misc.c
+@@ -14,11 +14,10 @@
+ #include <arpa/inet.h>
+ #include <stdio.h>
+ #include <string.h>
++#include <stdlib.h>
+ 
+ #include "tcpd.h"
+ 
+-extern char *fgets();
+-
+ #ifndef	INADDR_NONE
+ #define	INADDR_NONE	(-1)		/* XXX should be 0xffffffff */
+ #endif
+--- a/fix_options.c
++++ b/fix_options.c
+@@ -32,6 +32,7 @@
+ 
+ /* fix_options - get rid of IP-level socket options */
+ 
++void
+ fix_options(request)
+ struct request_info *request;
+ {
+@@ -38,11 +38,8 @@
+ #ifdef IP_OPTIONS
+     unsigned char optbuf[BUFFER_SIZE / 3], *cp;
+     char    lbuf[BUFFER_SIZE], *lp;
+-#ifdef __GLIBC__
+-    size_t  optsize = sizeof(optbuf), ipproto;
+-#else
+-    int     optsize = sizeof(optbuf), ipproto;
+-#endif
++    socklen_t optsize = sizeof(optbuf);
++    int ipproto;
+     struct protoent *ip;
+     int     fd = request->fd;
+     unsigned int opt;
+--- a/socket.c
++++ b/socket.c
+@@ -95,11 +95,7 @@
+     static struct sockaddr_in client;
+     static struct sockaddr_in server;
+ #endif
+-#ifdef __GLIBC__
+-    size_t  len;
+-#else
+-    int     len;
+-#endif
++    socklen_t len;
+     char    buf[BUFSIZ];
+     int     fd = request->fd;
+ 
+@@ -430,11 +426,7 @@
+ #else
+     struct sockaddr_in sin;
+ #endif
+-#ifdef __GLIBC__
+-    size_t  size = sizeof(sin);
+-#else
+-    int     size = sizeof(sin);
+-#endif
++    socklen_t size;
+ 
+     /*
+      * Eat up the not-yet received datagram. Some systems insist on a
+

Added: community-x86_64/tcp-wrappers-redhat-bug11881.patch
===================================================================
--- community-x86_64/tcp-wrappers-redhat-bug11881.patch	                        (rev 0)
+++ community-x86_64/tcp-wrappers-redhat-bug11881.patch	2016-10-02 13:32:21 UTC (rev 191209)
@@ -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);
+



More information about the arch-commits mailing list