From 3ded958a19234dad3af29f01617fdc89d8f83d93 Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Mon, 6 Aug 2012 21:43:18 -0500
Subject: inetutils 1.9.1 -glibc patch

---
 abs/core/inetutils/PKGBUILD          | 71 ++++++++++++++++++++++++++++++++++++
 abs/core/inetutils/__changelog       |  2 +
 abs/core/inetutils/dnsdomainname     |  3 ++
 abs/core/inetutils/ftpd.conf         |  4 ++
 abs/core/inetutils/ftpd.rc           | 37 +++++++++++++++++++
 abs/core/inetutils/inetutils.install | 20 ++++++++++
 abs/core/inetutils/rlogin.xinetd     | 10 +++++
 abs/core/inetutils/rsh.xinetd        | 10 +++++
 abs/core/inetutils/talk.xinetd       | 10 +++++
 abs/core/inetutils/telnet.xinetd     | 10 +++++
 10 files changed, 177 insertions(+)
 create mode 100644 abs/core/inetutils/PKGBUILD
 create mode 100644 abs/core/inetutils/__changelog
 create mode 100644 abs/core/inetutils/dnsdomainname
 create mode 100644 abs/core/inetutils/ftpd.conf
 create mode 100644 abs/core/inetutils/ftpd.rc
 create mode 100644 abs/core/inetutils/inetutils.install
 create mode 100644 abs/core/inetutils/rlogin.xinetd
 create mode 100644 abs/core/inetutils/rsh.xinetd
 create mode 100644 abs/core/inetutils/talk.xinetd
 create mode 100644 abs/core/inetutils/telnet.xinetd

diff --git a/abs/core/inetutils/PKGBUILD b/abs/core/inetutils/PKGBUILD
new file mode 100644
index 0000000..aeea05d
--- /dev/null
+++ b/abs/core/inetutils/PKGBUILD
@@ -0,0 +1,71 @@
+# $Id: PKGBUILD 157926 2012-04-30 06:14:42Z eric $
+# Maintainer: Eric Bélanger <eric@archlinux.org>
+
+pkgname=inetutils
+pkgver=1.9.1
+pkgrel=2
+pkgdesc="A collection of common network programs"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/inetutils/"
+license=('GPL3')
+groups=('base')
+depends=('readline' 'ncurses' 'pam')
+backup=('etc/conf.d/ftpd' 'etc/xinetd.d/telnet' 'etc/xinetd.d/talk' \
+        'etc/xinetd.d/rlogin' 'etc/xinetd.d/rsh')
+options=('!emptydirs')
+install=inetutils.install
+source=(http://ftp.gnu.org/gnu/inetutils/${pkgname}-${pkgver}.tar.gz{,.sig} \
+        ftpd.rc ftpd.conf telnet.xinetd talk.xinetd rlogin.xinetd rsh.xinetd \
+        dnsdomainname)
+sha1sums=('86b7eb11cfdaefb1d4e9bfc10620beaf8f09bc90'
+          'ff0aad9946a38915580b094dadf67e790e8a2f87'
+          '84dc802b5e57b5e04c847572225a3b9612017155'
+          '68a590083b45997dfdb80e666b2de762f494ba74'
+          'bfad98a4a62f1fff8779f076c6019ed07f9111af'
+          '27d99b910eec0fc26bd79ccc2c1de26608330298'
+          '81f10b3b688e3952f793b35bcef63b5bf257a92b'
+          '81f4a8da823cf0bb14284fc71ee6108849691eda'
+          'eb952b0b9c3e3d429d8e21b110249e495f0e0e63')
+
+build() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+  sed -i '/gets is a security hole/d'  lib/stdio.in.h
+
+  ./configure --prefix=/usr --libexec=/usr/sbin --localstatedir=/var \
+    --sysconfdir=/etc --mandir=/usr/share/man --infodir=/usr/share/info \
+    --without-wrap --with-pam \
+    --enable-ftp --enable-ftpd \
+    --enable-telnet --enable-telnetd \
+    --enable-talk --enable-talkd \
+    --enable-rlogin --enable-rlogind \
+    --enable-rsh --enable-rshd \
+    --enable-rcp --enable-hostname \
+    --disable-rexec --disable-rexecd \
+    --disable-tftp --disable-tftpd \
+    --disable-ping --disable-ping6 \
+    --disable-logger --disable-syslogd \
+    --disable-inetd --disable-whois \
+    --disable-uucpd --disable-ifconfig --disable-traceroute
+  make
+}
+
+check() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+  make check
+}
+
+package() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+  make DESTDIR="${pkgdir}" install
+
+  install -d "${pkgdir}/bin"
+  ln -s /usr/bin/hostname "${pkgdir}/bin/hostname"
+  install -D -m755 "${srcdir}/dnsdomainname" "${pkgdir}/bin/dnsdomainname"
+  echo ".so man1/hostname.1" > "${pkgdir}/usr/share/man/man1/dnsdomainname.1"
+  install -D -m755 "${srcdir}/ftpd.rc" "${pkgdir}/etc/rc.d/ftpd"
+  install -D -m644 "${srcdir}/ftpd.conf" "${pkgdir}/etc/conf.d/ftpd"
+  install -D -m644 "${srcdir}/telnet.xinetd" "${pkgdir}/etc/xinetd.d/telnet"
+  install -D -m644 "${srcdir}/talk.xinetd" "${pkgdir}/etc/xinetd.d/talk"
+  install -D -m644 "${srcdir}/rlogin.xinetd" "${pkgdir}/etc/xinetd.d/rlogin"
+  install -D -m644 "${srcdir}/rsh.xinetd" "${pkgdir}/etc/xinetd.d/rsh"
+}
diff --git a/abs/core/inetutils/__changelog b/abs/core/inetutils/__changelog
new file mode 100644
index 0000000..b5d6eea
--- /dev/null
+++ b/abs/core/inetutils/__changelog
@@ -0,0 +1,2 @@
+sed -i '/gets is a security hole/d'  lib/stdio.in.h
+
diff --git a/abs/core/inetutils/dnsdomainname b/abs/core/inetutils/dnsdomainname
new file mode 100644
index 0000000..a1b8a8c
--- /dev/null
+++ b/abs/core/inetutils/dnsdomainname
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /usr/bin/hostname -d "$@"
diff --git a/abs/core/inetutils/ftpd.conf b/abs/core/inetutils/ftpd.conf
new file mode 100644
index 0000000..f660f00
--- /dev/null
+++ b/abs/core/inetutils/ftpd.conf
@@ -0,0 +1,4 @@
+#
+# Parameters to be passed to ftpd
+#
+FTPD_ARGS=""
diff --git a/abs/core/inetutils/ftpd.rc b/abs/core/inetutils/ftpd.rc
new file mode 100644
index 0000000..3d0d344
--- /dev/null
+++ b/abs/core/inetutils/ftpd.rc
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/ftpd
+
+PID=$(pidof -o %PPID /usr/sbin/ftpd)
+case "$1" in
+  start)
+    stat_busy "Starting ftpd"
+    [ -z "$PID" ] && /usr/sbin/ftpd -D $FTPD_ARGS
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      add_daemon ftpd
+      stat_done
+    fi
+    ;;
+  stop)
+    stat_busy "Stopping ftpd"
+    [ ! -z "$PID" ]  && kill $PID &> /dev/null
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      rm_daemon ftpd
+      stat_done
+    fi
+    ;;
+  restart)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+  *)
+    echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/abs/core/inetutils/inetutils.install b/abs/core/inetutils/inetutils.install
new file mode 100644
index 0000000..b338fa4
--- /dev/null
+++ b/abs/core/inetutils/inetutils.install
@@ -0,0 +1,20 @@
+infodir=/usr/share/info
+filelist=(inetutils.info.gz)
+
+post_install() {
+  [ -x usr/bin/install-info ] || return 0
+  for file in ${filelist[@]}; do
+    install-info $infodir/$file $infodir/dir 2> /dev/null
+  done
+}
+
+post_upgrade() {
+  post_install $1
+}
+
+pre_remove() {
+  [ -x usr/bin/install-info ] || return 0
+  for file in ${filelist[@]}; do
+    install-info --delete $infodir/$file $infodir/dir 2> /dev/null
+  done
+}
diff --git a/abs/core/inetutils/rlogin.xinetd b/abs/core/inetutils/rlogin.xinetd
new file mode 100644
index 0000000..5c72f86
--- /dev/null
+++ b/abs/core/inetutils/rlogin.xinetd
@@ -0,0 +1,10 @@
+service login
+{
+        flags                   = REUSE
+        socket_type             = stream
+        wait                    = no
+        user                    = root
+        server                  = /usr/sbin/rlogind
+        log_on_failure          += USERID
+        disable                 = yes
+}
diff --git a/abs/core/inetutils/rsh.xinetd b/abs/core/inetutils/rsh.xinetd
new file mode 100644
index 0000000..a13738c
--- /dev/null
+++ b/abs/core/inetutils/rsh.xinetd
@@ -0,0 +1,10 @@
+service shell
+{
+        flags                   = REUSE
+        socket_type             = stream
+        wait                    = no
+        user                    = root
+        server                  = /usr/sbin/rshd
+        log_on_failure          += USERID
+        disable                 = yes
+}
diff --git a/abs/core/inetutils/talk.xinetd b/abs/core/inetutils/talk.xinetd
new file mode 100644
index 0000000..6abef35
--- /dev/null
+++ b/abs/core/inetutils/talk.xinetd
@@ -0,0 +1,10 @@
+service ntalk
+{
+	flags			= REUSE
+	socket_type		= dgram
+	wait			= yes
+	user			= root
+	server			= /usr/sbin/talkd
+	log_on_failure		+= USERID
+	disable			= yes
+}
diff --git a/abs/core/inetutils/telnet.xinetd b/abs/core/inetutils/telnet.xinetd
new file mode 100644
index 0000000..bd3a5e4
--- /dev/null
+++ b/abs/core/inetutils/telnet.xinetd
@@ -0,0 +1,10 @@
+service telnet
+{
+	flags			= REUSE
+	socket_type		= stream
+	wait			= no
+	user			= root
+	server			= /usr/sbin/telnetd
+	log_on_failure		+= USERID
+	disable			= yes
+}
-- 
cgit v0.12

