From 7500119d8dd5fc921f91aac8222e472477973740 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 16 Jul 2011 05:34:06 +0000 Subject: Sat Jul 16 05:34:06 UTC 2011 --- testing/esound/PKGBUILD | 38 +++ testing/esound/esd | 37 +++ testing/esound/esd-0.2.38-alsa-drain.patch | 11 + testing/inetutils/PKGBUILD | 62 ++++ testing/inetutils/ftpd.conf | 4 + testing/inetutils/ftpd.rc | 37 +++ testing/inetutils/inetutils.install | 20 ++ testing/inetutils/rexec.xinetd | 10 + testing/inetutils/rlogin.xinetd | 10 + testing/inetutils/rsh.xinetd | 10 + testing/inetutils/talk.xinetd | 10 + testing/inetutils/telnet.xinetd | 10 + testing/mysql/PKGBUILD | 130 +++++++++ testing/mysql/my.cnf | 145 ++++++++++ testing/mysql/mysql.install | 26 ++ testing/mysql/mysqld | 77 +++++ testing/net-snmp/PKGBUILD | 48 ++++ testing/net-snmp/libnl-2.patch | 67 +++++ testing/net-snmp/snmpd.rc | 38 +++ testing/nfs-utils/PKGBUILD | 72 +++++ testing/nfs-utils/exports | 15 + testing/nfs-utils/idmapd.conf | 14 + testing/nfs-utils/nfs-common | 319 +++++++++++++++++++++ testing/nfs-utils/nfs-common.conf | 40 +++ testing/nfs-utils/nfs-server | 303 +++++++++++++++++++ testing/nfs-utils/nfs-server.conf | 29 ++ .../nfs-utils/nfs-utils-1.1.2-kerberos-ac.patch | 138 +++++++++ testing/nfs-utils/nfs-utils-1.1.4-mtab-sym.patch | 39 +++ testing/nfs-utils/nfs-utils-1.1.4-no-exec.patch | 15 + .../nfs-utils-1.1.6-heimdal_functions.patch | 69 +++++ .../nfs-utils/nfs-utils-1.1.6-no_libgssapi.patch | 57 ++++ testing/nfs-utils/nfs-utils.install | 32 +++ testing/nfs-utils/start-statd.patch | 22 ++ testing/openssh/PKGBUILD | 70 +++++ testing/openssh/authfile.c.patch | 198 +++++++++++++ testing/openssh/sshd | 48 ++++ testing/openssh/sshd.confd | 4 + testing/openssh/sshd.pam | 11 + testing/quota-tools/LICENSE | 33 +++ testing/quota-tools/PKGBUILD | 49 ++++ testing/quota-tools/nulls.diff | 20 ++ testing/quota-tools/quotaon.diff | 216 ++++++++++++++ testing/quota-tools/repquota.diff | 91 ++++++ testing/quota-tools/system_inodes.diff | 18 ++ testing/rrdtool/PKGBUILD | 37 +++ testing/socat/PKGBUILD | 32 +++ testing/tftp-hpa/LICENSE | 32 +++ testing/tftp-hpa/PKGBUILD | 35 +++ testing/tftp-hpa/tftpd.conf | 4 + testing/tftp-hpa/tftpd.rc | 38 +++ testing/vsftpd/PKGBUILD | 43 +++ testing/vsftpd/vsftpd.d | 67 +++++ testing/vsftpd/vsftpd.install | 17 ++ testing/vsftpd/vsftpd.xinetd | 10 + testing/xinetd/PKGBUILD | 43 +++ testing/xinetd/servers | 10 + testing/xinetd/services | 10 + testing/xinetd/xinetd | 38 +++ testing/xinetd/xinetd.conf | 14 + 59 files changed, 3142 insertions(+) create mode 100644 testing/esound/PKGBUILD create mode 100755 testing/esound/esd create mode 100644 testing/esound/esd-0.2.38-alsa-drain.patch create mode 100644 testing/inetutils/PKGBUILD create mode 100644 testing/inetutils/ftpd.conf create mode 100644 testing/inetutils/ftpd.rc create mode 100644 testing/inetutils/inetutils.install create mode 100644 testing/inetutils/rexec.xinetd create mode 100644 testing/inetutils/rlogin.xinetd create mode 100644 testing/inetutils/rsh.xinetd create mode 100644 testing/inetutils/talk.xinetd create mode 100644 testing/inetutils/telnet.xinetd create mode 100644 testing/mysql/PKGBUILD create mode 100644 testing/mysql/my.cnf create mode 100644 testing/mysql/mysql.install create mode 100755 testing/mysql/mysqld create mode 100644 testing/net-snmp/PKGBUILD create mode 100644 testing/net-snmp/libnl-2.patch create mode 100644 testing/net-snmp/snmpd.rc create mode 100644 testing/nfs-utils/PKGBUILD create mode 100644 testing/nfs-utils/exports create mode 100644 testing/nfs-utils/idmapd.conf create mode 100644 testing/nfs-utils/nfs-common create mode 100644 testing/nfs-utils/nfs-common.conf create mode 100644 testing/nfs-utils/nfs-server create mode 100644 testing/nfs-utils/nfs-server.conf create mode 100644 testing/nfs-utils/nfs-utils-1.1.2-kerberos-ac.patch create mode 100644 testing/nfs-utils/nfs-utils-1.1.4-mtab-sym.patch create mode 100644 testing/nfs-utils/nfs-utils-1.1.4-no-exec.patch create mode 100644 testing/nfs-utils/nfs-utils-1.1.6-heimdal_functions.patch create mode 100644 testing/nfs-utils/nfs-utils-1.1.6-no_libgssapi.patch create mode 100644 testing/nfs-utils/nfs-utils.install create mode 100644 testing/nfs-utils/start-statd.patch create mode 100644 testing/openssh/PKGBUILD create mode 100644 testing/openssh/authfile.c.patch create mode 100755 testing/openssh/sshd create mode 100644 testing/openssh/sshd.confd create mode 100644 testing/openssh/sshd.pam create mode 100644 testing/quota-tools/LICENSE create mode 100644 testing/quota-tools/PKGBUILD create mode 100644 testing/quota-tools/nulls.diff create mode 100644 testing/quota-tools/quotaon.diff create mode 100644 testing/quota-tools/repquota.diff create mode 100644 testing/quota-tools/system_inodes.diff create mode 100644 testing/rrdtool/PKGBUILD create mode 100644 testing/socat/PKGBUILD create mode 100644 testing/tftp-hpa/LICENSE create mode 100644 testing/tftp-hpa/PKGBUILD create mode 100644 testing/tftp-hpa/tftpd.conf create mode 100755 testing/tftp-hpa/tftpd.rc create mode 100644 testing/vsftpd/PKGBUILD create mode 100644 testing/vsftpd/vsftpd.d create mode 100644 testing/vsftpd/vsftpd.install create mode 100644 testing/vsftpd/vsftpd.xinetd create mode 100644 testing/xinetd/PKGBUILD create mode 100644 testing/xinetd/servers create mode 100644 testing/xinetd/services create mode 100755 testing/xinetd/xinetd create mode 100644 testing/xinetd/xinetd.conf (limited to 'testing') diff --git a/testing/esound/PKGBUILD b/testing/esound/PKGBUILD new file mode 100644 index 000000000..b6d035b22 --- /dev/null +++ b/testing/esound/PKGBUILD @@ -0,0 +1,38 @@ +# $Id: PKGBUILD 131830 2011-07-16 00:02:10Z dreisner $ +# Maintainer: Jan de Groot +pkgname=esound +pkgver=0.2.41 +pkgrel=2 +pkgdesc="Enlightened Sound Daemon" +arch=(i686 x86_64) +license=('LGPL') +depends=('audiofile' 'alsa-lib>=1.0.18') +url="http://www.tux.org/~ricdude/EsounD.html" +provides=("esd=${pkgver}") +replaces=('esd') +conflicts=('esd') +backup=('etc/esd.conf') +options=('!libtool') +source=(http://ftp.gnome.org/pub/GNOME/sources/${pkgname}/0.2/${pkgname}-${pkgver}.tar.bz2 + esd-0.2.38-alsa-drain.patch + esd) +md5sums=('8d9aad3d94d15e0d59ba9dc0ea990c6c' + '3de93efcd1bc196a3585e6aef50eac48' + 'a4c76e7c7f75b201ea7ab6fb15b47472') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + patch -Np1 -i "${srcdir}/esd-0.2.38-alsa-drain.patch" + ./configure --prefix=/usr --sysconfdir=/etc \ + --localstatedir=/var --disable-static \ + --with-audiofile --without-libwrap \ + --enable-alsa --disable-artstest + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + make DESTDIR="${pkgdir}" install + install -m755 -d "${pkgdir}/etc/rc.d" + install -m755 "${srcdir}/esd" "${pkgdir}/etc/rc.d/esd" +} diff --git a/testing/esound/esd b/testing/esound/esd new file mode 100755 index 000000000..d90ef55fa --- /dev/null +++ b/testing/esound/esd @@ -0,0 +1,37 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +PID=`pidof -o %PPID /usr/bin/esd` +case "$1" in + start) + stat_busy "Starting Esound Daemon" + if [ -z "$PID" ]; then + /usr/bin/esd -nobeeps & + fi + if [ ! -z "$PID" -o $? -gt 0 ]; then + stat_fail + else + add_daemon esd + stat_done + fi + ;; + stop) + stat_busy "Stopping Esound Daemon" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon esd + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac diff --git a/testing/esound/esd-0.2.38-alsa-drain.patch b/testing/esound/esd-0.2.38-alsa-drain.patch new file mode 100644 index 000000000..f2fb716ba --- /dev/null +++ b/testing/esound/esd-0.2.38-alsa-drain.patch @@ -0,0 +1,11 @@ +--- esound-0.2.38/audio_alsa09.c.old 2007-06-11 12:22:24.000000000 +0200 ++++ esound-0.2.38/audio_alsa09.c 2007-06-11 12:22:49.000000000 +0200 +@@ -486,7 +486,7 @@ void esd_audio_flush(void) + } + + if (alsa_playback_handle != NULL) +- snd_pcm_drain( alsa_playback_handle ); ++ snd_pcm_drop( alsa_playback_handle ); + + if (alsadbg) + print_state(); diff --git a/testing/inetutils/PKGBUILD b/testing/inetutils/PKGBUILD new file mode 100644 index 000000000..19feb931e --- /dev/null +++ b/testing/inetutils/PKGBUILD @@ -0,0 +1,62 @@ +# $Id: PKGBUILD 131824 2011-07-15 23:53:22Z dan $ +# Maintainer: Eric Belanger + +pkgname=inetutils +pkgver=1.8 +pkgrel=3 +pkgdesc="A collection of common network programs" +arch=('i686' 'x86_64') +url="http://www.gnu.org/software/inetutils/" +license=('GPL') +depends=('readline' 'ncurses' 'pam') +provides=('netkit-ftp' 'netkit-rsh' 'netkit-telnet' 'netkit-ntalk') +conflicts=('netkit-ftp' 'netkit-rsh' 'netkit-telnet' 'netkit-ntalk') +replaces=('netkit-ftp' 'netkit-rsh' 'netkit-telnet' 'netkit-ntalk') +backup=('etc/conf.d/ftpd' 'etc/xinetd.d/telnet' 'etc/xinetd.d/talk' \ + 'etc/xinetd.d/rexec' 'etc/xinetd.d/rlogin' 'etc/xinetd.d/rsh') +options=('!emptydirs') +install=inetutils.install +source=(http://ftp.gnu.org/gnu/inetutils/${pkgname}-${pkgver}.tar.gz \ + ftpd.rc ftpd.conf telnet.xinetd talk.xinetd rexec.xinetd rlogin.xinetd rsh.xinetd) +md5sums=('ad8fdcdf1797b9ca258264a6b04e48fd' 'c167200f6faeb64659e69ced2a9d672a'\ + 'e6e6e5990a2e8159a276fef8fbf54c04' '8596208d119045543c5fb644e1d713d5'\ + '2c3655985cf122591d71d031af84ff90' 'c490ea36751ac5f1d61d2c014959a3d1'\ + 'c25d8382a994de84d9c6962d804f689b' 'c3aa508a9d1293a787341108cd49c1b7') +sha1sums=('598445859b511f73681e4d74a41d65cd6ae0f83e' '84dc802b5e57b5e04c847572225a3b9612017155'\ + '68a590083b45997dfdb80e666b2de762f494ba74' 'bfad98a4a62f1fff8779f076c6019ed07f9111af'\ + '27d99b910eec0fc26bd79ccc2c1de26608330298' '87aa4f38ebee9dac5dcaa04cbc3f2f0906bec605'\ + '81f10b3b688e3952f793b35bcef63b5bf257a92b' '81f4a8da823cf0bb14284fc71ee6108849691eda') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + ./configure --prefix=/usr --libexec=/usr/sbin --localstatedir=/var \ + --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-rexec --enable-rexecd \ + --enable-rcp \ + --disable-tftp --disable-tftpd \ + --disable-ping --disable-ping6 \ + --disable-logger --disable-syslogd \ + --disable-inetd --disable-whois \ + --disable-uucpd --disable-hostname \ + --disable-ifconfig --disable-traceroute + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + make DESTDIR="${pkgdir}" install + + 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}/rexec.xinetd" "${pkgdir}/etc/xinetd.d/rexec" + 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/testing/inetutils/ftpd.conf b/testing/inetutils/ftpd.conf new file mode 100644 index 000000000..f660f0035 --- /dev/null +++ b/testing/inetutils/ftpd.conf @@ -0,0 +1,4 @@ +# +# Parameters to be passed to ftpd +# +FTPD_ARGS="" diff --git a/testing/inetutils/ftpd.rc b/testing/inetutils/ftpd.rc new file mode 100644 index 000000000..3d0d34421 --- /dev/null +++ b/testing/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/testing/inetutils/inetutils.install b/testing/inetutils/inetutils.install new file mode 100644 index 000000000..b338fa498 --- /dev/null +++ b/testing/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/testing/inetutils/rexec.xinetd b/testing/inetutils/rexec.xinetd new file mode 100644 index 000000000..4659e4745 --- /dev/null +++ b/testing/inetutils/rexec.xinetd @@ -0,0 +1,10 @@ +service exec +{ + flags = REUSE + socket_type = stream + wait = no + user = root + server = /usr/sbin/rexecd + log_on_failure += USERID + disable = yes +} diff --git a/testing/inetutils/rlogin.xinetd b/testing/inetutils/rlogin.xinetd new file mode 100644 index 000000000..5c72f86df --- /dev/null +++ b/testing/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/testing/inetutils/rsh.xinetd b/testing/inetutils/rsh.xinetd new file mode 100644 index 000000000..a13738c31 --- /dev/null +++ b/testing/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/testing/inetutils/talk.xinetd b/testing/inetutils/talk.xinetd new file mode 100644 index 000000000..6abef359c --- /dev/null +++ b/testing/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/testing/inetutils/telnet.xinetd b/testing/inetutils/telnet.xinetd new file mode 100644 index 000000000..bd3a5e4b1 --- /dev/null +++ b/testing/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 +} diff --git a/testing/mysql/PKGBUILD b/testing/mysql/PKGBUILD new file mode 100644 index 000000000..54248034e --- /dev/null +++ b/testing/mysql/PKGBUILD @@ -0,0 +1,130 @@ +# $Id: PKGBUILD 131641 2011-07-13 07:03:22Z andrea $ +# Maintainer: Andrea Scarpino +# Contributor: Douglas Soares de Andrade +# Contributor: judd + +pkgbase=mysql +pkgname=('libmysqlclient' 'mysql-clients' 'mysql') +pkgver=5.5.14 +pkgrel=2 +arch=('i686' 'x86_64') +license=('GPL') +url="http://www.mysql.com/" +makedepends=('cmake' 'openssl' 'zlib') +options=('!libtool') +source=("http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-5.5/${pkgbase}-${pkgver}.tar.gz" + 'mysqld' + 'my.cnf') +md5sums=('19f43bb9c72b1b5f7ff86a7f921c9244' + '2234207625baa29b2ff7d7b4f088abce' + '1c949c0dbea5206af0db14942d9927b6') + +build() { + cd "${srcdir}" + mkdir build + cd build + + # CFLAGS/CXXFLAGS as suggested upstream + CFLAGS="-fPIC ${CFLAGS} -fno-strict-aliasing -DBIG_JOINS=1 -fomit-frame-pointer" \ + CXXFLAGS="-fPIC ${CXXFLAGS} -fno-strict-aliasing -DBIG_JOINS=1 -felide-constructors -fno-rtti" \ + + cmake ../${pkgbase}-${pkgver} \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DSYSCONFDIR=/etc/mysql \ + -DMYSQL_DATADIR=/var/lib/mysql \ + -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \ + -DDEFAULT_CHARSET=utf8 \ + -DDEFAULT_COLLATION=utf8_general_ci \ + -DENABLED_LOCAL_INFILE=ON \ + -DINSTALL_INFODIR=share/mysql/docs \ + -DINSTALL_MANDIR=share/man \ + -DINSTALL_PLUGINDIR=/usr/lib/mysql/plugin \ + -DINSTALL_SCRIPTDIR=bin \ + -DINSTALL_INCLUDEDIR=include/mysql \ + -DINSTALL_DOCREADMEDIR=share/mysql \ + -DINSTALL_SUPPORTFILESDIR=share/mysql \ + -DINSTALL_MYSQLSHAREDIR=share/mysql \ + -DINSTALL_DOCDIR=share/mysql/docs \ + -DINSTALL_SHAREDIR=share/mysql \ + -DWITH_READLINE=ON \ + -DWITH_ZLIB=system \ + -DWITH_SSL=system \ + -DWITH_LIBWRAP=OFF \ + -DWITH_MYSQLD_LDFLAGS="${LDFLAGS}" \ + -DWITH_EXTRA_CHARSETS=complex \ + -DWITH_EMBEDDED_SERVER=ON \ + -DWITH_INNOBASE_STORAGE_ENGINE=1 \ + -DWITH_PARTITION_STORAGE_ENGINE=1 \ + -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \ + -DWITHOUT_ARCHIVE_STORAGE_ENGINE=1 \ + -DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1 \ + -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 + + make +} + +package_libmysqlclient(){ + pkgdesc="MySQL client libraries" + depends=('openssl') + + cd "${srcdir}"/build + for dir in include libmysql libmysqld libservices; do + make -C ${dir} DESTDIR="${pkgdir}" install + done + + install -d "${pkgdir}"/usr/bin + install -m755 scripts/mysql_config "${pkgdir}"/usr/bin/ + install -d "${pkgdir}"/usr/share/man/man1 + for man in mysql_config mysql_client_test_embedded mysqltest_embedded; do + install -m644 "${srcdir}"/${pkgbase}-${pkgver}/man/$man.1 "${pkgdir}"/usr/share/man/man1/$man.1 + done +} + +package_mysql-clients(){ + pkgdesc="MySQL client tools" + depends=('libmysqlclient') + + cd "${srcdir}"/build + make -C client DESTDIR="${pkgdir}" install + + # install man pages + install -d "${pkgdir}"/usr/share/man/man1 + for man in mysql mysqladmin mysqlcheck mysqldump mysqlimport mysqlshow mysqlslap; do + install -m644 "${srcdir}"/${pkgbase}-${pkgver}/man/$man.1 "${pkgdir}"/usr/share/man/man1/$man.1 + done + + # provided by mysql + rm "${pkgdir}"/usr/bin/{mysql_upgrade,mysqlbinlog,mysqltest} +} + +package_mysql(){ + pkgdesc="A fast SQL database server" + backup=('etc/mysql/my.cnf') + install=mysql.install + depends=('mysql-clients' 'net-tools') + optdepends=('perl-dbi' 'perl-dbd-mysql') + options=('emptydirs') + + cd "${srcdir}"/build + make DESTDIR="${pkgdir}" install + + install -Dm644 "${srcdir}"/my.cnf "${pkgdir}"/etc/mysql/my.cnf + install -Dm755 "${srcdir}"/mysqld "${pkgdir}"/etc/rc.d/mysqld + + # provided by libmysqlclient + rm "${pkgdir}"/usr/bin/{mysql_config,mysql_client_test_embedded,mysqltest_embedded} + rm "${pkgdir}"/usr/lib/libmysql* + rm -r "${pkgdir}"/usr/include/ + rm "${pkgdir}"/usr/share/man/man1/{mysql_config,mysql_client_test_embedded,mysqltest_embedded}.1 + + # provided by mysql-clients + rm "${pkgdir}"/usr/bin/{mysql,mysqladmin,mysqlcheck,mysqldump,mysqlimport,mysqlshow,mysqlslap} + rm "${pkgdir}"/usr/share/man/man1/{mysql,mysqladmin,mysqlcheck,mysqldump,mysqlimport,mysqlshow,mysqlslap}.1 + + # not needed + rm -r "${pkgdir}"/usr/{data,mysql-test,sql-bench} + rm "${pkgdir}"/usr/share/man/man1/mysql-test-run.pl.1 + + install -dm700 "${pkgdir}"/var/lib/mysql +} diff --git a/testing/mysql/my.cnf b/testing/mysql/my.cnf new file mode 100644 index 000000000..9a41b4fc3 --- /dev/null +++ b/testing/mysql/my.cnf @@ -0,0 +1,145 @@ +# MySQL config file for medium systems. +# +# This is for a system with little memory (32M - 64M) where MySQL plays +# an important part, or systems up to 128M where MySQL is used together with +# other programs (such as a web server) +# +# MySQL programs look for option files in a set of +# locations which depend on the deployment platform. +# You can copy this option file to one of those +# locations. For information about these locations, see: +# http://dev.mysql.com/doc/mysql/en/option-files.html +# +# In this file, you can use all long options that a program supports. +# If you want to know which options a program supports, run the program +# with the "--help" option. + +# The following options will be passed to all MySQL clients +[client] +#password = your_password +port = 3306 +socket = /var/run/mysqld/mysqld.sock + +# Here follows entries for some specific programs + +# The MySQL server +[mysqld] +port = 3306 +socket = /var/run/mysqld/mysqld.sock +datadir = /var/lib/mysql +skip-external-locking +key_buffer_size = 16M +max_allowed_packet = 1M +table_open_cache = 64 +sort_buffer_size = 512K +net_buffer_length = 8K +read_buffer_size = 256K +read_rnd_buffer_size = 512K +myisam_sort_buffer_size = 8M + +# Don't listen on a TCP/IP port at all. This can be a security enhancement, +# if all processes that need to connect to mysqld run on the same host. +# All interaction with mysqld must be made via Unix sockets or named pipes. +# Note that using this option without enabling named pipes on Windows +# (via the "enable-named-pipe" option) will render mysqld useless! +# +skip-networking + +# Replication Master Server (default) +# binary logging is required for replication +log-bin=mysql-bin + +# binary logging format - mixed recommended +binlog_format=mixed + +# required unique id between 1 and 2^32 - 1 +# defaults to 1 if master-host is not set +# but will not function as a master if omitted +server-id = 1 + +# Replication Slave (comment out master section to use this) +# +# To configure this host as a replication slave, you can choose between +# two methods : +# +# 1) Use the CHANGE MASTER TO command (fully described in our manual) - +# the syntax is: +# +# CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=, +# MASTER_USER=, MASTER_PASSWORD= ; +# +# where you replace , , by quoted strings and +# by the master's port number (3306 by default). +# +# Example: +# +# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, +# MASTER_USER='joe', MASTER_PASSWORD='secret'; +# +# OR +# +# 2) Set the variables below. However, in case you choose this method, then +# start replication for the first time (even unsuccessfully, for example +# if you mistyped the password in master-password and the slave fails to +# connect), the slave will create a master.info file, and any later +# change in this file to the variables' values below will be ignored and +# overridden by the content of the master.info file, unless you shutdown +# the slave server, delete master.info and restart the slaver server. +# For that reason, you may want to leave the lines below untouched +# (commented) and instead use CHANGE MASTER TO (see above) +# +# required unique id between 2 and 2^32 - 1 +# (and different from the master) +# defaults to 2 if master-host is set +# but will not function as a slave if omitted +#server-id = 2 +# +# The replication master for this slave - required +#master-host = +# +# The username the slave will use for authentication when connecting +# to the master - required +#master-user = +# +# The password the slave will authenticate with when connecting to +# the master - required +#master-password = +# +# The port the master is listening on. +# optional - defaults to 3306 +#master-port = +# +# binary logging - not required for slaves, but recommended +#log-bin=mysql-bin + +# Uncomment the following if you are using InnoDB tables +#innodb_data_home_dir = /var/lib/mysql +#innodb_data_file_path = ibdata1:10M:autoextend +#innodb_log_group_home_dir = /var/lib/mysql +# You can set .._buffer_pool_size up to 50 - 80 % +# of RAM but beware of setting memory usage too high +#innodb_buffer_pool_size = 16M +#innodb_additional_mem_pool_size = 2M +# Set .._log_file_size to 25 % of buffer pool size +#innodb_log_file_size = 5M +#innodb_log_buffer_size = 8M +#innodb_flush_log_at_trx_commit = 1 +#innodb_lock_wait_timeout = 50 + +[mysqldump] +quick +max_allowed_packet = 16M + +[mysql] +no-auto-rehash +# Remove the next comment character if you are not familiar with SQL +#safe-updates + +[myisamchk] +key_buffer_size = 20M +sort_buffer_size = 20M +read_buffer = 2M +write_buffer = 2M + +[mysqlhotcopy] +interactive-timeout diff --git a/testing/mysql/mysql.install b/testing/mysql/mysql.install new file mode 100644 index 000000000..9a4479215 --- /dev/null +++ b/testing/mysql/mysql.install @@ -0,0 +1,26 @@ +post_install(){ + groupadd -g 89 mysql &>/dev/null + useradd -u 89 -g mysql -d /var/lib/mysql -s /bin/false mysql &>/dev/null + usr/bin/mysql_install_db --user=mysql --basedir=/usr + chown -R mysql:mysql var/lib/mysql &>/dev/null +} + +post_upgrade(){ + getent group mysql >/dev/null 2>&1 || groupadd -g 89 mysql &>/dev/null + getent passwd mysql >/dev/null 2>&1 || useradd -u 89 -g mysql -d /var/lib/mysql -s /bin/false mysql &>/dev/null + + if [ "$(vercmp $2 5.5)" -lt 0 ]; then + echo " >> " + echo " >> Major version update. Consider restart the service, and then running mysql_upgrade after it." + echo " >> " + fi +} + +post_remove(){ + if getent passwd mysql >/dev/null 2>&1; then + userdel mysql + fi + if getent group mysql >/dev/null 2>&1; then + groupdel mysql + fi +} diff --git a/testing/mysql/mysqld b/testing/mysql/mysqld new file mode 100755 index 000000000..1ac88a7cc --- /dev/null +++ b/testing/mysql/mysqld @@ -0,0 +1,77 @@ +#!/bin/bash + +# general config +. /etc/rc.conf +. /etc/rc.d/functions + +getPID() { + echo $(pgrep -u mysql mysqld 2>/dev/null); +} + +case "$1" in + start) + stat_busy "Starting MySQL Server" + [ ! -d /var/run/mysqld ] && install -d -g mysql -o mysql /var/run/mysqld &>/dev/null + if [ -z "$(getPID)" ]; then + /usr/bin/mysqld_safe --user=mysql &>/dev/null & + if [ $? -gt 0 ]; then + stat_fail + exit 1 + else + timeo=30 + while [ $timeo -gt 0 ]; do + response=`/usr/bin/mysqladmin -uUNKNOWN_USER ping 2>&1` && break + echo "$response" | grep -q "mysqld is alive" && break + sleep 1 + let timeo=${timeo}-1 + done + if [ $timeo -eq 0 ]; then + stat_fail + exit 1 + else + echo $(getPID) > /var/run/mysqld/mysqld.pid + add_daemon mysqld + stat_done + fi + fi + else + stat_fail + exit 1 + fi + ;; + + stop) + stat_busy "Stopping MySQL Server" + if [ ! -z "$(getPID)" ]; then + timeo=30 + kill $(getPID) &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + exit 1 + fi + while [ ! -z "$(getPID)" -a $timeo -gt 0 ]; do + sleep 1 + let timeo=${timeo}-1 + done + if [ -z "$(getPID)" ]; then + rm -f /var/run/mysqld/mysqld.pid &>/dev/null + rm_daemon mysqld + stat_done + else + stat_fail + exit 1 + fi + else + stat_fail + exit 1 + fi + ;; + + restart) + $0 stop + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 diff --git a/testing/net-snmp/PKGBUILD b/testing/net-snmp/PKGBUILD new file mode 100644 index 000000000..a1f72cb01 --- /dev/null +++ b/testing/net-snmp/PKGBUILD @@ -0,0 +1,48 @@ +# $Id: PKGBUILD 131650 2011-07-13 08:13:14Z andrea $ +# Maintainer: Eric Belanger +# Contributor: Dale Blount + +pkgname=net-snmp +pkgver=5.6.1 +pkgrel=3 +pkgdesc="A suite of applications used to implement SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6" +arch=('i686' 'x86_64') +url="http://www.net-snmp.org/" +license=('custom') +depends=('openssl' 'libnl') +makedepends=('setuptools') +optdepends=('perl-term-readkey: for snmpcheck application' + 'perl-tk: for snmpcheck and tkmib applications' + 'python2: for the python modules') +provides=('ucd-snmp') +options=('!libtool' '!makeflags' '!emptydirs') +source=("http://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.gz" + 'snmpd.rc') +md5sums=('b4e30ead5783b0bb1d280172c6095ea4' + '9f0d13676ba1fae1eb7eb178edd85b43') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + sed -i -e "s:\(install --basedir=\$\$dir\):\1 --root='${pkgdir}':" Makefile.in + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --enable-ucd-snmp-compatibility \ + --enable-ipv6 \ + --with-python-modules \ + --with-default-snmp-version="3" \ + --with-sys-contact="root@localhost" \ + --with-sys-location="Unknown" \ + --with-logfile="/var/log/snmpd.log" \ + --with-mib-modules="host misc/ipfwacc ucd-snmp/diskio tunnel ucd-snmp/dlmod" \ + --with-persistent-directory="/var/net-snmp" \ + PYTHONPROG=/usr/bin/python2 + make NETSNMP_DONT_CHECK_VERSION=1 LDFLAGS+="-Wl,-rpath -Wl,/usr/lib/perl5/core_perl/CORE" +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + make DESTDIR="${pkgdir}" INSTALL_PREFIX="${pkgdir}" INSTALLDIRS=vendor install + install -D -m755 "${srcdir}/snmpd.rc" "${pkgdir}/etc/rc.d/snmpd" + install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} diff --git a/testing/net-snmp/libnl-2.patch b/testing/net-snmp/libnl-2.patch new file mode 100644 index 000000000..7c140fe83 --- /dev/null +++ b/testing/net-snmp/libnl-2.patch @@ -0,0 +1,67 @@ +diff -Nur net-snmp-5.5.orig//agent/mibgroup/mibII/tcpTable.c net-snmp-5.5//agent/mibgroup/mibII/tcpTable.c +--- net-snmp-5.5.orig//agent/mibgroup/mibII/tcpTable.c 2009-06-13 04:02:02.000000000 +0200 ++++ net-snmp-5.5//agent/mibgroup/mibII/tcpTable.c 2011-01-15 10:31:03.579735957 +0100 +@@ -555,8 +555,10 @@ + static int + tcpTable_load_netlink() + { ++ int err; ++ + /* TODO: perhaps use permanent nl handle? */ +- struct nl_handle *nl = nl_handle_alloc(); ++ struct nl_sock *nl = nl_socket_alloc(); + + if (nl == NULL) { + DEBUGMSGTL(("mibII/tcpTable", "Failed to allocate netlink handle\n")); +@@ -564,10 +566,10 @@ + return -1; + } + +- if (nl_connect(nl, NETLINK_INET_DIAG) < 0) { +- DEBUGMSGTL(("mibII/tcpTable", "Failed to connect to netlink: %s\n", nl_geterror())); +- snmp_log(LOG_ERR, "snmpd: Couldn't connect to netlink: %s\n", nl_geterror()); +- nl_handle_destroy(nl); ++ if ((err = nl_connect(nl, NETLINK_INET_DIAG)) < 0) { ++ DEBUGMSGTL(("mibII/tcpTable", "Failed to connect to netlink: %s\n", nl_geterror(err))); ++ snmp_log(LOG_ERR, "snmpd: Couldn't connect to netlink: %s\n", nl_geterror(err)); ++ nl_socket_free(nl); + return -1; + } + +@@ -579,10 +581,10 @@ + struct nl_msg *nm = nlmsg_alloc_simple(TCPDIAG_GETSOCK, NLM_F_ROOT|NLM_F_MATCH|NLM_F_REQUEST); + nlmsg_append(nm, &req, sizeof(struct inet_diag_req), 0); + +- if (nl_send_auto_complete(nl, nm) < 0) { +- DEBUGMSGTL(("mibII/tcpTable", "nl_send_autocomplete(): %s\n", nl_geterror())); +- snmp_log(LOG_ERR, "snmpd: nl_send_autocomplete(): %s\n", nl_geterror()); +- nl_handle_destroy(nl); ++ if ((err = nl_send_auto_complete(nl, nm)) < 0) { ++ DEBUGMSGTL(("mibII/tcpTable", "nl_send_autocomplete(): %s\n", nl_geterror(err))); ++ snmp_log(LOG_ERR, "snmpd: nl_send_autocomplete(): %s\n", nl_geterror(err)); ++ nl_socket_free(nl); + return -1; + } + nlmsg_free(nm); +@@ -593,9 +595,9 @@ + + while (running) { + if ((len = nl_recv(nl, &peer, &buf, NULL)) <= 0) { +- DEBUGMSGTL(("mibII/tcpTable", "nl_recv(): %s\n", nl_geterror())); +- snmp_log(LOG_ERR, "snmpd: nl_recv(): %s\n", nl_geterror()); +- nl_handle_destroy(nl); ++ DEBUGMSGTL(("mibII/tcpTable", "nl_recv(): %s\n", nl_geterror(len))); ++ snmp_log(LOG_ERR, "snmpd: nl_recv(): %s\n", nl_geterror(len)); ++ nl_socket_free(nl); + return -1; + } + +@@ -644,7 +646,7 @@ + free(buf); + } + +- nl_handle_destroy(nl); ++ nl_socket_free(nl); + + if (tcp_head) { + DEBUGMSGTL(("mibII/tcpTable", "Loaded TCP Table using netlink\n")); diff --git a/testing/net-snmp/snmpd.rc b/testing/net-snmp/snmpd.rc new file mode 100644 index 000000000..9f1b83f64 --- /dev/null +++ b/testing/net-snmp/snmpd.rc @@ -0,0 +1,38 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +PID=`pidof -o %PPID /usr/sbin/snmpd` +case "$1" in + start) + stat_busy "Starting Net-SNMP" + [ -z "$PID" ] && /usr/sbin/snmpd + if [ $? -gt 0 ]; then + stat_fail + else + echo $PID > /var/run/snmpd.pid + add_daemon snmpd + stat_done + fi + ;; + stop) + stat_busy "Stopping Net-SNMP" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm /var/run/snmpd.pid + rm_daemon snmpd + stat_done + fi + ;; + restart) + $0 stop + sleep 2 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 diff --git a/testing/nfs-utils/PKGBUILD b/testing/nfs-utils/PKGBUILD new file mode 100644 index 000000000..3adca96d4 --- /dev/null +++ b/testing/nfs-utils/PKGBUILD @@ -0,0 +1,72 @@ +# $Id: PKGBUILD 131837 2011-07-16 00:22:48Z dreisner $ +# Maintainer: Tobias Powalowski +# Contributor: John Proctor +# Contributor: dibblethewrecker +# Contributor: abelstr +# Contributor: Marco Lima + +pkgname=nfs-utils +pkgver=1.2.3 +pkgrel=3 +pkgdesc="Support programs for Network File Systems" +arch=('i686' 'x86_64') +url='http://nfs.sourceforge.net' +license=('GPL') +backup=(etc/{exports,idmapd.conf} etc/conf.d/{nfs-common.conf,nfs-server.conf}) +depends=('glibc' 'e2fsprogs' 'rpcbind' 'libtirpc>=0.2.1' 'librpcsecgss>=0.19-2' 'nfsidmap' 'libevent>=2.0.10' 'libgssglue') +makedepends=('pkgconfig' 'autoconf' 'automake') +source=(http://downloads.sourceforge.net/project/nfs/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.bz2 + nfs-common + nfs-common.conf + nfs-server + nfs-server.conf + exports + idmapd.conf + start-statd.patch + nfs-utils-1.1.4-mtab-sym.patch + nfs-utils-1.1.4-no-exec.patch) +install=nfs-utils.install +md5sums=('1131dc5f27c4f3905a6e7ee0d594fd4d' + 'fc508e10cdf5e8ddd80373b1b2bc99a1' + 'f73f197a16b02c3e248488ec35c4cf43' + '5ae080f6117cef3140f02bc162bdc755' + '2bf71def3263325643a09458635520f0' + 'ff585faf410a62c4333a027c50b56bae' + 'eb4f4027fab6fc1201f1ca04f5954c76' + 'e24f81a8c8657672e262c61235d34b4a' + '7674106eaaa4c149bccd4f05fe3604e9' + '4f4827dfc93008dfadd0a530ad0872b2') + +build() { + cd $srcdir/${pkgname}-${pkgver} + patch -Np1 -i ../nfs-utils-1.1.4-mtab-sym.patch + patch -Np1 -i ../nfs-utils-1.1.4-no-exec.patch + + # arch specific patch + patch -Np0 -i $srcdir/start-statd.patch + + ./configure --prefix=/usr --enable-nfsv3 --enable-nfsv4 --enable-gss \ + --without-tcp-wrappers --with-statedir=/var/lib/nfs --enable-ipv6 --sysconfdir=/etc + + make +} + +package() { + cd $srcdir/${pkgname}-${pkgver} + make DESTDIR=$pkgdir install + + # support python2 (FS#25120) + sed -i '1s/python$/python2/' "$pkgdir"/usr/sbin/{nfsiostat,mountstats} + + # NFS & NFSv4 init scripts + install -D -m 755 ../nfs-common "$pkgdir/"etc/rc.d/nfs-common + install -D -m 755 ../nfs-server "$pkgdir/"etc/rc.d/nfs-server + # Configuration + install -D -m 644 ../exports "$pkgdir/"etc/exports + install -D -m 644 ../idmapd.conf "$pkgdir/"etc/idmapd.conf + install -D -m 644 ../nfs-common.conf "$pkgdir/"etc/conf.d/nfs-common.conf + install -D -m 644 ../nfs-server.conf "$pkgdir/"etc/conf.d/nfs-server.conf + # directories + mkdir "$pkgdir/"var/lib/nfs/rpc_pipefs + mkdir "$pkgdir/"var/lib/nfs/v4recovery +} diff --git a/testing/nfs-utils/exports b/testing/nfs-utils/exports new file mode 100644 index 000000000..8f4aac598 --- /dev/null +++ b/testing/nfs-utils/exports @@ -0,0 +1,15 @@ +# /etc/exports +# +# List of directories exported to NFS clients. See exports(5). +# Use exportfs -arv to reread. +# +# Example for NFSv2 and NFSv3: +# /srv/home hostname1(rw,sync) hostname2(ro,sync) +# +# Example for NFSv4: +# /srv/nfs4 hostname1(rw,sync,fsid=0) +# /srv/nfs4/home hostname1(rw,sync,nohide) +# Using Kerberos and integrity checking: +# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt) +# /srv/nfs4/home gss/krb5i(rw,sync,nohide) +# diff --git a/testing/nfs-utils/idmapd.conf b/testing/nfs-utils/idmapd.conf new file mode 100644 index 000000000..b1b23afe9 --- /dev/null +++ b/testing/nfs-utils/idmapd.conf @@ -0,0 +1,14 @@ +[General] + +Verbosity = 0 +Pipefs-Directory = /var/lib/nfs/rpc_pipefs +Domain = localdomain + +[Mapping] + +Nobody-User = nobody +Nobody-Group = nobody + +[Translation] + +Method = nsswitch diff --git a/testing/nfs-utils/nfs-common b/testing/nfs-utils/nfs-common new file mode 100644 index 000000000..13742bde3 --- /dev/null +++ b/testing/nfs-utils/nfs-common @@ -0,0 +1,319 @@ +#!/bin/bash + +daemon_name=nfs-common + +# daemon dependencies +DAEMON_DEPENDS=('rpcbind') + +NEED_STATD= +STATD_OPTS= +NEED_IDMAPD= +IDMAPD_OPTS= +NEED_GSSD= +GSSD_OPTS= +PIPEFS_MOUNTPOINT= +PIPEFS_MOUNTOPTS= + +# rpc.statd daemon & binary location +STATD_DAEMON_NAME=rpc.statd +STATD="/usr/sbin/rpc.statd" + +# rpc.idmapd daemon & binary location +IDMAPD_DAEMON_NAME=rpc.idmapd +IDMAPD="/usr/sbin/rpc.idmapd" + +# rpc.gssd daemon & binary location +GSSD_DAEMON_NAME=rpc.gssd +GSSD="/usr/sbin/rpc.gssd" + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/$daemon_name.conf + +# Default mountpoint and options for rpc_pipefs filesystem +[ -z "$PIPEFS_MOUNTPOINT" ] && PIPEFS_MOUNTPOINT="/var/lib/nfs/rpc_pipefs" +[ -z "$PIPEFS_MOUNTOPTS" ] && PIPEFS_MOUNTOPTS="defaults" + +# Parse the fstab file, and determine whether we need idmapd and gssd. (The +# /etc/conf.d/nfs-common settings, if any, will override our autodetection.) +AUTO_NEED_IDMAPD=no +AUTO_NEED_GSSD=no + +if [ -f /etc/fstab ]; then + exec 9<&0 /dev/null ; then + return 1 + fi + + if grep -vw "$1" /proc/mounts &> /dev/null ; then + if ! mountpoint -q "$2" ; then + mount -t "$1" "$1" "$2" -o "$3" + return + fi + fi + return 0 +} + +do_umount() { + if mountpoint -q "$1" ; then + umount "$1" + fi + return 0 +} + +get_pid() { + pidof -o %PPID "$1" +} + +case "$1" in + start) + ck_depends ${DAEMON_DEPENDS[@]} + + rc=0 + if [ "$NEED_STATD" = yes ]; then + stat_busy "Starting $STATD_DAEMON_NAME daemon" + PID=$(get_pid $STATD) + if [ -z "$PID" ]; then + [ -f /var/run/$STATD_DAEMON_NAME.pid ] && rm -f /var/run/$STATD_DAEMON_NAME.pid + # RUN + $STATD $STATD_OPTS + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + echo $(get_pid $STATD) > /var/run/$STATD_DAEMON_NAME.pid + stat_done + fi + else + stat_fail + exit 1 + fi + # Run sm-notify + /usr/sbin/sm-notify $SMNOTIFY_OPTS + fi + + if [ "$NEED_IDMAPD" = yes ] || [ "$NEED_GSSD" = yes ]; then + stat_busy "Mounting pipefs filesystem" + do_modprobe sunrpc + do_modprobe nfs + do_modprobe nfsd + do_mount rpc_pipefs "$PIPEFS_MOUNTPOINT" "$PIPEFS_MOUNTOPTS" + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + stat_done + fi + + if [ "$NEED_IDMAPD" = yes ]; then + stat_busy "Starting $IDMAPD_DAEMON_NAME daemon" + PID=$(get_pid $IDMAPD) + if [ -z "$PID" ]; then + [ -f /var/run/$IDMAPD_DAEMON_NAME.pid ] && rm -f /var/run/$IDMAPD_DAEMON_NAME.pid + # RUN + $IDMAPD $IDMAPD_OPTS + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + echo $(get_pid $IDMAPD) > /var/run/$IDMAPD_DAEMON_NAME.pid + stat_done + fi + else + stat_fail + exit 1 + fi + fi + + if [ "$NEED_GSSD" = yes ]; then + do_modprobe rpcsec_gss_krb5 + stat_busy "Starting $GSSD_DAEMON_NAME daemon" + PID=$(get_pid $GSSD) + if [ -z "$PID" ]; then + [ -f /var/run/$GSSD_DAEMON_NAME.pid ] && rm -f /var/run/$GSSD_DAEMON_NAME.pid + # RUN + $GSSD $GSSD_OPTS + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + echo $(get_pid $GSSD) > /var/run/$GSSD_DAEMON_NAME.pid + stat_done + fi + else + stat_fail + exit 1 + fi + fi + fi + + add_daemon $daemon_name + ;; + + stop) + rc=0 + if [ "$NEED_IDMAPD" = yes ] || [ "$NEED_GSSD" = yes ]; then + + if [ "$NEED_GSSD" = yes ]; then + stat_busy "Stopping $GSSD_DAEMON_NAME daemon" + PID=$(get_pid $GSSD) + # KILL + [ ! -z "$PID" ] && kill $PID &> /dev/null + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + rm -f /var/run/$GSSD_DAEMON_NAME.pid &> /dev/null + stat_done + fi + fi + + if [ "$NEED_IDMAPD" = yes ]; then + stat_busy "Stopping $IDMAPD_DAEMON_NAME daemon" + PID=$(get_pid $IDMAPD) + # KILL + [ ! -z "$PID" ] && kill $PID &> /dev/null + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + rm -f /var/run/$IDMAPD_DAEMON_NAME.pid &> /dev/null + stat_done + fi + fi + do_umount "$PIPEFS_MOUNTPOINT" 2>/dev/null || true + fi + + if [ "$NEED_STATD" = yes ]; then + stat_busy "Stopping $STATD_DAEMON_NAME daemon" + PID=$(get_pid $STATD) + # KILL + [ ! -z "$PID" ] && kill $PID &> /dev/null + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + rm -f /var/run/$STATD_DAEMON_NAME.pid &> /dev/null + stat_done + fi + fi + + rm_daemon $daemon_name + ;; + + status) + stat_busy "Checking $daemon_name status"; + ck_status $daemon_name + + if [ "$NEED_STATD" = yes ]; then + stat_busy "Daemon $STATD_DAEMON_NAME running" + PID=$(get_pid $STATD) + if [ -z "$PID" ]; then + stat_fail + else + stat_done + fi + fi + + if [ "$NEED_GSSD" = yes ]; then + stat_busy "Daemon $GSSD_DAEMON_NAME running" + PID=$(get_pid $GSSD) + if [ -z "$PID" ]; then + stat_fail + else + stat_done + fi + fi + + if [ "$NEED_IDMAPD" = yes ]; then + stat_busy "Daemon $IDMAPD_DAEMON_NAME running" + PID=$(get_pid $IDMAPD) + if [ -z "$PID" ]; then + stat_fail + else + stat_done + fi + fi + echo + ;; + + restart) + $0 stop + sleep 3 + $0 start + ;; + *) + echo "usage: $0 {start|stop|status|restart}" +esac +exit 0 + diff --git a/testing/nfs-utils/nfs-common.conf b/testing/nfs-utils/nfs-common.conf new file mode 100644 index 000000000..12466b3e5 --- /dev/null +++ b/testing/nfs-utils/nfs-common.conf @@ -0,0 +1,40 @@ +# Parameters to be passed to nfs-common (nfs clients & server) init script. +# + +# If you do not set values for the NEED_ options, they will be attempted +# autodetected; this should be sufficient for most people. Valid alternatives +# for the NEED_ options are "yes" and "no". + +# Do you want to start the statd daemon? It is not needed for NFSv4. +NEED_STATD="" + +# Options to pass to rpc.statd. +# See rpc.statd(8) for more details. +# N.B. statd normally runs on both client and server, and run-time +# options should be specified accordingly. +# STATD_OPTS="-p 32765 -o 32766" +STATD_OPTS="" + +# Options to pass to sm-notify +# e.g. SMNOTIFY_OPTS="-p 32764" +SMNOTIFY_OPTS="" + +# Do you want to start the idmapd daemon? It is only needed for NFSv4. +NEED_IDMAPD="" + +# Options to pass to rpc.idmapd. +# See rpc.idmapd(8) for more details. +IDMAPD_OPTS="" + +# Do you want to start the gssd daemon? It is required for Kerberos mounts. +NEED_GSSD="" + +# Options to pass to rpc.gssd. +# See rpc.gssd(8) for more details. +GSSD_OPTS="" + +# Where to mount rpc_pipefs filesystem; the default is "/var/lib/nfs/rpc_pipefs". +PIPEFS_MOUNTPOINT="" + +# Options used to mount rpc_pipefs filesystem; the default is "defaults". +PIPEFS_MOUNTOPTS="" diff --git a/testing/nfs-utils/nfs-server b/testing/nfs-utils/nfs-server new file mode 100644 index 000000000..9574cbc12 --- /dev/null +++ b/testing/nfs-utils/nfs-server @@ -0,0 +1,303 @@ +#!/bin/bash + +daemon_name=nfs-server + +# daemon dependencies +DAEMON_DEPENDS=('nfs-common') + +NFSD_COUNT= +NFSD_OPTS= +NEED_SVCGSSD= +SVCGSSD_OPTS= +MOUNTD_OPTS= +PROCNFSD_MOUNTPOINT= +PROCNFSD_MOUNTOPTS= + +# rpc.nfsd daemon & binary location +NFSD_PROCESS_NAME=nfsd +NFSD_DAEMON_NAME=rpc.nfsd +NFSD="/usr/sbin/rpc.nfsd" + +# rpc.svcgssd daemon & binary location +SVCGSSD_DAEMON_NAME=rpc.svcgssd +SVCGSSD="/usr/sbin/rpc.svcgssd" + +# rpc.idmapd daemon & binary location +IDMAPD_DAEMON_NAME=rpc.idmapd +IDMAPD="/usr/sbin/rpc.idmapd" + +# rpc.mountd daemon & binary location +MOUNTD_DAEMON_NAME=rpc.mountd +MOUNTD="/usr/sbin/rpc.mountd" + +# exortfs binary location +EXPORTFS="/usr/sbin/exportfs" + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/$daemon_name.conf + +# Default number of nfsd servers +[ -z "$NFSD_COUNT" ] && NFSD_COUNT=8 + +# Default mountpoint and options for nfsd filesystem +[ -z "$PROCNFSD_MOUNTPOINT" ] && PROCNFSD_MOUNTPOINT="/proc/fs/nfsd" +[ -z "$PROCNFSD_MOUNTOPTS" ] && PROCNFSD_MOUNTOPTS="rw,nodev,noexec,nosuid" + +case "$NEED_SVCGSSD" in + yes|no) + ;; + *) + NEED_SVCGSSD=no + ;; +esac + +do_modprobe() { + if [ -x /sbin/modprobe -a -f /proc/modules ]; then + modprobe -q "$1" || true + fi +} + +do_mount() { + if ! grep -E "$1\$" /proc/filesystems &> /dev/null ; then + return 1 + fi + + if grep -vw "$1" /proc/mounts &> /dev/null ; then + if ! mountpoint -q "$2" ; then + mount -t "$1" "$1" "$2" -o "$3" + return + fi + fi + return 0 +} + +do_umount() { + if mountpoint -q "$1" ; then + umount "$1" + fi + return 0 +} + +get_pid() { + pidof -o %PPID "$1" +} + +case "$1" in + start) + ck_depends ${DAEMON_DEPENDS[@]} + + rc=0 + stat_busy "Mounting nfsd filesystem" + do_modprobe nfsd + do_mount nfsd "$PROCNFSD_MOUNTPOINT" "$PROCNFSD_MOUNTOPTS" + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + stat_done + fi + + stat_busy "Exporting all directories" + $EXPORTFS -r + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + stat_done + fi + + stat_busy "Starting $NFSD_DAEMON_NAME daemon" + PID=$(get_pid $NFSD_PROCESS_NAME) + if [ -z "$PID" ]; then + [ -f /var/run/$NFSD_DAEMON_NAME.pid ] && rm -f /var/run/$NFSD_DAEMON_NAME.pid + # RUN + $NFSD $NFSD_OPTS $NFSD_COUNT + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + echo $(get_pid $NFSD_PROCESS_NAME) > /var/run/$NFSD_DAEMON_NAME.pid + stat_done + fi + else + stat_fail + exit 1 + fi + + if [ "$NEED_SVCGSSD" = yes ]; then + do_modprobe rpcsec_gss_krb5 + stat_busy "Starting $SVCGSSD_DAEMON_NAME daemon" + PID=$(get_pid $SVCGSSD) + if [ -z "$PID" ]; then + [ -f /var/run/$SVCGSSD_DAEMON_NAME.pid ] && rm -f /var/run/$SVCGSSD_DAEMON_NAME.pid + # RUN + $SVCGSSD $SVCGSSD_OPTS + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + echo $(get_pid $SVCGSSD) > /var/run/$SVCGSSD_DAEMON_NAME.pid + stat_done + fi + else + stat_fail + exit 1 + fi + fi + + PID=$(get_pid $IDMAPD) + [ ! -z "$PID" ] && kill -SIGHUP $IDMAPD_DAEMON_NAME &> /dev/null + + stat_busy "Starting $MOUNTD_DAEMON_NAME daemon" + PID=$(get_pid $MOUNTD) + if [ -z "$PID" ]; then + [ -f /var/run/$MOUNTD_DAEMON_NAME.pid ] && rm -f /var/run/$MOUNTD_DAEMON_NAME.pid + # RUN + $MOUNTD $MOUNTD_OPTS + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + echo $(get_pid $MOUNTD) > /var/run/$MOUNTD_DAEMON_NAME.pid + stat_done + fi + else + stat_fail + exit 1 + fi + + add_daemon $daemon_name + ;; + + stop) + rc=0 + stat_busy "Stopping $MOUNTD_DAEMON_NAME daemon" + PID=$(get_pid $MOUNTD) + # KILL + [ ! -z "$PID" ] && kill $PID &> /dev/null + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + rm -f /var/run/$MOUNTD_DAEMON_NAME.pid &> /dev/null + stat_done + fi + + if [ "$NEED_SVCGSSD" = yes ]; then + stat_busy "Stopping $SVCGSSD_DAEMON_NAME daemon" + PID=$(get_pid $SVCGSSD) + # KILL + [ ! -z "$PID" ] && kill $PID &> /dev/null + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + rm -f /var/run/$SVCGSSD_DAEMON_NAME.pid &> /dev/null + stat_done + fi + fi + + stat_busy "Stopping $NFSD_DAEMON_NAME daemon" + PID=$(get_pid $NFSD_PROCESS_NAME) + # KILL (SIGINT) + [ ! -z "$PID" ] && kill -2 $PID &> /dev/null + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + sleep 1 + PID=$(get_pid $NFSD_PROCESS_NAME) + # KILL (KILL) - just to be sure + [ ! -z "$PID" ] && kill -9 $PID &> /dev/null + # + rm -f /var/run/$NFSD_DAEMON_NAME.pid &> /dev/null + stat_done + fi + + stat_busy "Unexporting all directories" + $EXPORTFS -au + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + stat_done + fi + + # flush everything out of the kernels export table + if mountpoint -q "$PROCNFSD_MOUNTPOINT" ; then + $EXPORTFS -f + fi + do_umount "$PROCNFSD_MOUNTPOINT" 2>/dev/null || true + rm_daemon $daemon_name + ;; + + status) + stat_busy "Checking $daemon_name status"; + ck_status $daemon_name + + stat_busy "Daemon $NFSD_DAEMON_NAME running" + PID=$(get_pid $NFSD_PROCESS_NAME) + if [ -z "$PID" ]; then + stat_fail + else + stat_done + fi + + stat_busy "Daemon $MOUNTD_DAEMON_NAME running" + PID=$(get_pid $MOUNTD) + if [ -z "$PID" ]; then + stat_fail + else + stat_done + fi + + if [ "$NEED_SVCGSSD" = yes ]; then + stat_busy "Daemon $SVCGSSD_DAEMON_NAME running" + PID=$(get_pid $SVCGSSD) + if [ -z "$PID" ]; then + stat_fail + else + stat_done + fi + fi + echo + ;; + + reload) + rc=0 + stat_busy "Re-exporting all directories" + $EXPORTFS -r + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + stat_done + fi + ;; + + restart) + $0 stop + sleep 3 + $0 start + ;; + *) + echo "usage: $0 {start|stop|status|reload|restart}" +esac +exit 0 diff --git a/testing/nfs-utils/nfs-server.conf b/testing/nfs-utils/nfs-server.conf new file mode 100644 index 000000000..4054d6b88 --- /dev/null +++ b/testing/nfs-utils/nfs-server.conf @@ -0,0 +1,29 @@ +# Parameters to be passed to nfs-server init script. +# + +# Options to pass to rpc.nfsd. +# See rpc.nfsd(8) for more details. +NFSD_OPTS="" + +# Number of servers to start up; the default is 8 servers. +NFSD_COUNT="" + +# Where to mount nfsd filesystem; the default is "/proc/fs/nfsd". +PROCNFSD_MOUNTPOINT="" + +# Options used to mount nfsd filesystem; the default is "rw,nodev,noexec,nosuid". +PROCNFSD_MOUNTOPTS="" + +# Options for rpc.mountd. +# If you have a port-based firewall, you might want to set up +# a fixed port here using the --port option. +# See rpc.mountd(8) for more details. +MOUNTD_OPTS="--no-nfs-version 2" + +# Do you want to start the svcgssd daemon? It is only required for Kerberos +# exports. Valid alternatives are "yes" and "no"; the default is "no". +NEED_SVCGSSD="" + +# Options to pass to rpc.svcgssd. +# See rpc.svcgssd(8) for more details. +SVCGSSD_OPTS="" diff --git a/testing/nfs-utils/nfs-utils-1.1.2-kerberos-ac.patch b/testing/nfs-utils/nfs-utils-1.1.2-kerberos-ac.patch new file mode 100644 index 000000000..4a5a138e7 --- /dev/null +++ b/testing/nfs-utils/nfs-utils-1.1.2-kerberos-ac.patch @@ -0,0 +1,138 @@ +diff -NaurwB nfs-utils-1.1.2.orig/aclocal/kerberos5.m4 nfs-utils-1.1.2/aclocal/kerberos5.m4 +--- nfs-utils-1.1.2.orig/aclocal/kerberos5.m4 2008-03-14 16:46:29.000000000 +0100 ++++ nfs-utils-1.1.2/aclocal/kerberos5.m4 2008-06-12 17:13:51.000000000 +0200 +@@ -1,112 +1,48 @@ +-dnl Checks for Kerberos +-dnl NOTE: while we intend to do generic gss-api, currently we +-dnl have a requirement to get an initial Kerberos machine +-dnl credential. Thus, the requirement for Kerberos. +-dnl The Kerberos gssapi library will be dynamically loaded? + AC_DEFUN([AC_KERBEROS_V5],[ ++ K5CONFIG="krb5-config" + AC_MSG_CHECKING(for Kerberos v5) +- AC_ARG_WITH(krb5, +- [AC_HELP_STRING([--with-krb5=DIR], [use Kerberos v5 installation in DIR])], ++ AC_ARG_WITH(krb5-config, ++ [AC_HELP_STRING([--with-krb5-config=PATH], [Full Path to krb5-config.])], + [ case "$withval" in + yes|no) +- krb5_with="" ++ K5CONFIG="krb5-config" + ;; + *) +- krb5_with="$withval" ++ K5CONFIG="$withval" + ;; + esac ] + ) + +- for dir in $krb5_with /usr /usr/kerberos /usr/local /usr/local/krb5 \ +- /usr/krb5 /usr/heimdal /usr/local/heimdal /usr/athena ; do +- dnl This ugly hack brought on by the split installation of +- dnl MIT Kerberos on Fedora Core 1 +- K5CONFIG="" +- if test -f $dir/bin/krb5-config; then +- K5CONFIG=$dir/bin/krb5-config +- elif test -f "/usr/kerberos/bin/krb5-config"; then +- K5CONFIG="/usr/kerberos/bin/krb5-config" +- elif test -f "/usr/lib/mit/bin/krb5-config"; then +- K5CONFIG="/usr/lib/mit/bin/krb5-config" +- fi + if test "$K5CONFIG" != ""; then + KRBCFLAGS=`$K5CONFIG --cflags` + KRBLIBS=`$K5CONFIG --libs gssapi` +- K5VERS=`$K5CONFIG --version | head -n 1 | awk '{split($(4),v,"."); if (v@<:@"3"@:>@ == "") v@<:@"3"@:>@ = "0"; print v@<:@"1"@:>@v@<:@"2"@:>@v@<:@"3"@:>@ }'` +- AC_DEFINE_UNQUOTED(KRB5_VERSION, $K5VERS, [Define this as the Kerberos version number]) +- if test -f $dir/include/gssapi/gssapi_krb5.h -a \ +- \( -f $dir/lib/libgssapi_krb5.a -o \ +- -f $dir/lib64/libgssapi_krb5.a -o \ +- -f $dir/lib64/libgssapi_krb5.so -o \ +- -f $dir/lib/libgssapi_krb5.so \) ; then ++ if $K5CONFIG --version | grep -q -e heimdal; then ++ K5VERS=`$K5CONFIG --version | head -n 1 | cut -f2 -d ' ' | tr -d '.'` ++ AC_DEFINE(HAVE_HEIMDAL, 1, [Define this if you have Heimdal Kerberos libraries]) ++ gssapi_lib=gssapi ++ KRBIMPL="heimdal" ++ elif $K5CONFIG --version | grep -q -e mit; then ++ K5VERS=`$K5CONFIG --version | head -n 1 | cut -f4 -d ' ' | tr -d '.'` + AC_DEFINE(HAVE_KRB5, 1, [Define this if you have MIT Kerberos libraries]) +- KRBDIR="$dir" +- dnl If we are using MIT K5 1.3.1 and before, we *MUST* use the +- dnl private function (gss_krb5_ccache_name) to get correct +- dnl behavior of changing the ccache used by gssapi. +- dnl Starting in 1.3.2, we *DO NOT* want to use +- dnl gss_krb5_ccache_name, instead we want to set KRB5CCNAME +- dnl to get gssapi to use a different ccache + if test $K5VERS -le 131; then + AC_DEFINE(USE_GSS_KRB5_CCACHE_NAME, 1, [Define this if the private function, gss_krb5_cache_name, must be used to tell the Kerberos library which credentials cache to use. Otherwise, this is done by setting the KRB5CCNAME environment variable]) + fi + gssapi_lib=gssapi_krb5 +- break +- dnl The following ugly hack brought on by the split installation +- dnl of Heimdal Kerberos on SuSe +- elif test \( -f $dir/include/heim_err.h -o\ +- -f $dir/include/heimdal/heim_err.h \) -a \ +- -f $dir/lib/libroken.a; then +- AC_DEFINE(HAVE_HEIMDAL, 1, [Define this if you have Heimdal Kerberos libraries]) +- KRBDIR="$dir" +- gssapi_lib=gssapi +- break +- fi +- fi +- done +- dnl We didn't find a usable Kerberos environment +- if test "x$KRBDIR" = "x"; then +- if test "x$krb5_with" = "x"; then +- AC_MSG_ERROR(Kerberos v5 with GSS support not found: consider --disable-gss or --with-krb5=) ++ KRBIMPL="mit-krb5" + else +- AC_MSG_ERROR(Kerberos v5 with GSS support not found at $krb5_with) +- fi ++ AC_MSG_ERROR(Unknown Kerberos 5 Implementation. Is neither heimdal or mit-krb5.) ++ KRBIMPL="unknown" + fi +- AC_MSG_RESULT($KRBDIR) +- +- dnl Check if -rpath=$(KRBDIR)/lib is needed +- echo "The current KRBDIR is $KRBDIR" +- if test "$KRBDIR/lib" = "/lib" -o "$KRBDIR/lib" = "/usr/lib" \ +- -o "$KRBDIR/lib" = "//lib" -o "$KRBDIR/lib" = "/usr//lib" ; then +- KRBLDFLAGS=""; +- elif /sbin/ldconfig -p | grep > /dev/null "=> $KRBDIR/lib/"; then +- KRBLDFLAGS=""; +- else +- KRBLDFLAGS="-Wl,-rpath=$KRBDIR/lib" ++ AC_DEFINE_UNQUOTED(KRB5_VERSION, $K5VERS, [Define this as the Kerberos version number]) + fi ++ AC_MSG_RESULT($KRBIMPL) + +- dnl Now check for functions within gssapi library +- AC_CHECK_LIB($gssapi_lib, gss_krb5_export_lucid_sec_context, +- AC_DEFINE(HAVE_LUCID_CONTEXT_SUPPORT, 1, [Define this if the Kerberos GSS library supports gss_krb5_export_lucid_sec_context]), ,$KRBLIBS) +- AC_CHECK_LIB($gssapi_lib, gss_krb5_set_allowable_enctypes, +- AC_DEFINE(HAVE_SET_ALLOWABLE_ENCTYPES, 1, [Define this if the Kerberos GSS library supports gss_krb5_set_allowable_enctypes]), ,$KRBLIBS) +- AC_CHECK_LIB($gssapi_lib, gss_krb5_ccache_name, +- AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME, 1, [Define this if the Kerberos GSS library supports gss_krb5_ccache_name]), ,$KRBLIBS) +- +- dnl Check for newer error message facility +- AC_CHECK_LIB($gssapi_lib, krb5_get_error_message, +- AC_DEFINE(HAVE_KRB5_GET_ERROR_MESSAGE, 1, [Define this if the function krb5_get_error_message is available]), ,$KRBLIBS) ++ AC_CHECK_LIB($gssapi_lib, gss_krb5_export_lucid_sec_context, AC_DEFINE(HAVE_LUCID_CONTEXT_SUPPORT, 1, [Define this if the Kerberos GSS library supports gss_krb5_export_lucid_sec_context]), ,$KRBLIBS) ++ AC_CHECK_LIB($gssapi_lib, gss_krb5_set_allowable_enctypes, AC_DEFINE(HAVE_SET_ALLOWABLE_ENCTYPES, 1, [Define this if the Kerberos GSS library supports gss_krb5_set_allowable_enctypes]), ,$KRBLIBS) ++ AC_CHECK_LIB($gssapi_lib, gss_krb5_ccache_name, AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME, 1, [Define this if the Kerberos GSS library supports gss_krb5_ccache_name]), ,$KRBLIBS) ++ AC_CHECK_LIB($gssapi_lib, krb5_get_error_message, AC_DEFINE(HAVE_KRB5_GET_ERROR_MESSAGE, 1, [Define this if the function krb5_get_error_message is available]), ,$KRBLIBS) ++ AC_CHECK_LIB($gssapi_lib, krb5_get_init_creds_opt_set_addressless, AC_DEFINE(HAVE_KRB5_GET_INIT_CREDS_OPT_SET_ADDRESSLESS, 1, [Define this if the function krb5_get_init_creds_opt_set_addressless is available]), ,$KRBLIBS) + +- dnl Check for function to specify addressless tickets +- AC_CHECK_LIB($gssapi_lib, krb5_get_init_creds_opt_set_addressless, +- AC_DEFINE(HAVE_KRB5_GET_INIT_CREDS_OPT_SET_ADDRESSLESS, 1, [Define this if the function krb5_get_init_creds_opt_set_addressless is available]), ,$KRBLIBS) +- +- dnl If they specified a directory and it didn't work, give them a warning +- if test "x$krb5_with" != "x" -a "$krb5_with" != "$KRBDIR"; then +- AC_MSG_WARN(Using $KRBDIR instead of requested value of $krb5_with for Kerberos!) +- fi +- +- AC_SUBST([KRBDIR]) + AC_SUBST([KRBLIBS]) + AC_SUBST([KRBCFLAGS]) + AC_SUBST([KRBLDFLAGS]) diff --git a/testing/nfs-utils/nfs-utils-1.1.4-mtab-sym.patch b/testing/nfs-utils/nfs-utils-1.1.4-mtab-sym.patch new file mode 100644 index 000000000..c9e60afc7 --- /dev/null +++ b/testing/nfs-utils/nfs-utils-1.1.4-mtab-sym.patch @@ -0,0 +1,39 @@ +ripped from Debian + +--- nfs-utils-1.1.4/utils/mount/fstab.c ++++ nfs-utils-1.1.4/utils/mount/fstab.c +@@ -57,7 +57,7 @@ mtab_does_not_exist(void) { + return var_mtab_does_not_exist; + } + +-static int ++int + mtab_is_a_symlink(void) { + get_mtab_info(); + return var_mtab_is_a_symlink; +--- nfs-utils-1.1.4/utils/mount/fstab.h ++++ nfs-utils-1.1.4/utils/mount/fstab.h +@@ -7,6 +7,7 @@ + #define _PATH_FSTAB "/etc/fstab" + #endif + ++int mtab_is_a_symlink(void); + int mtab_is_writable(void); + int mtab_does_not_exist(void); + void reset_mtab_info(void); +--- nfs-utils-1.1.4/utils/mount/mount.c ++++ nfs-utils-1.1.4/utils/mount/mount.c +@@ -230,6 +230,13 @@ create_mtab (void) { + int flags; + mntFILE *mfp; + ++ /* Avoid writing if the mtab is a symlink to /proc/mounts, since ++ that would create a file /proc/mounts in case the proc filesystem ++ is not mounted, and the fchmod below would also fail. */ ++ if (mtab_is_a_symlink()) { ++ return EX_SUCCESS; ++ } ++ + lock_mtab(); + + mfp = nfs_setmntent (MOUNTED, "a+"); diff --git a/testing/nfs-utils/nfs-utils-1.1.4-no-exec.patch b/testing/nfs-utils/nfs-utils-1.1.4-no-exec.patch new file mode 100644 index 000000000..ea50a21d8 --- /dev/null +++ b/testing/nfs-utils/nfs-utils-1.1.4-no-exec.patch @@ -0,0 +1,15 @@ +ripped from Debian + +--- nfs-utils-1.1.2/utils/mount/mount.c ++++ nfs-utils-1.1.2/utils/mount/mount.c +@@ -381,10 +381,6 @@ + mount_error(NULL, mount_point, ENOTDIR); + return 1; + } +- if (access(mount_point, X_OK) < 0) { +- mount_error(NULL, mount_point, errno); +- return 1; +- } + + return 0; + } diff --git a/testing/nfs-utils/nfs-utils-1.1.6-heimdal_functions.patch b/testing/nfs-utils/nfs-utils-1.1.6-heimdal_functions.patch new file mode 100644 index 000000000..7f6c7a751 --- /dev/null +++ b/testing/nfs-utils/nfs-utils-1.1.6-heimdal_functions.patch @@ -0,0 +1,69 @@ +diff -Naur nfs-utils-1.1.6.orig/utils/gssd/krb5_util.c nfs-utils-1.1.6/utils/gssd/krb5_util.c +--- utils/gssd/krb5_util.c 2009-04-20 19:32:50.000000000 +0200 ++++ utils/gssd/krb5_util.c 2009-04-20 20:57:31.000000000 +0200 +@@ -940,9 +940,37 @@ + { + krb5_error_code ret; + krb5_creds creds; +- krb5_cc_cursor cur; + int found = 0; + ++#ifdef HAVE_HEIMDAL ++ krb5_creds pattern; ++ krb5_realm *client_realm; ++ ++ krb5_cc_clear_mcred(&pattern); ++ ++ client_realm = krb5_princ_realm (context, principal); ++ ++ ret = krb5_make_principal (context, &pattern.server, ++ *client_realm, KRB5_TGS_NAME, *client_realm, ++ NULL); ++ if (ret) ++ krb5_err (context, 1, ret, "krb5_make_principal"); ++ pattern.client = principal; ++ ++ ret = krb5_cc_retrieve_cred (context, ccache, 0, &pattern, &creds); ++ krb5_free_principal (context, pattern.server); ++ if (ret) { ++ if (ret == KRB5_CC_END) ++ return 1; ++ krb5_err (context, 1, ret, "krb5_cc_retrieve_cred"); ++ } ++ ++ found = creds.times.endtime > time(NULL); ++ ++ krb5_free_cred_contents (context, &creds); ++#else ++ krb5_cc_cursor cur; ++ + ret = krb5_cc_start_seq_get(context, ccache, &cur); + if (ret) + return 0; +@@ -962,6 +990,7 @@ + krb5_free_cred_contents(context, &creds); + } + krb5_cc_end_seq_get(context, ccache, &cur); ++#endif + + return found; + } +@@ -1008,6 +1037,9 @@ + } + krb5_free_principal(context, principal); + err_princ: ++#ifdef HAVE_HEIMDAL ++#define KRB5_TC_OPENCLOSE 0x00000001 ++#endif + krb5_cc_set_flags(context, ccache, KRB5_TC_OPENCLOSE); + krb5_cc_close(context, ccache); + err_cache: +@@ -1262,7 +1294,7 @@ + if (context != NULL) { + origmsg = krb5_get_error_message(context, code); + msg = strdup(origmsg); +- krb5_free_error_message(context, origmsg); ++ krb5_free_error_string(context, origmsg); + } + #endif + if (msg != NULL) diff --git a/testing/nfs-utils/nfs-utils-1.1.6-no_libgssapi.patch b/testing/nfs-utils/nfs-utils-1.1.6-no_libgssapi.patch new file mode 100644 index 000000000..917136a8c --- /dev/null +++ b/testing/nfs-utils/nfs-utils-1.1.6-no_libgssapi.patch @@ -0,0 +1,57 @@ +Index: nfs-utils-1.1.6/utils/gssd/context_lucid.c +=================================================================== +--- nfs-utils-1.1.6.orig/utils/gssd/context_lucid.c ++++ nfs-utils-1.1.6/utils/gssd/context_lucid.c +@@ -51,8 +51,10 @@ + #include "context.h" + + #ifndef OM_uint64 ++#ifndef GSSAPI_GSSAPI_H_ + typedef uint64_t OM_uint64; + #endif ++#endif + + static int + write_lucid_keyblock(char **p, char *end, gss_krb5_lucid_key_t *key) +@@ -177,10 +179,10 @@ + int retcode = 0; + + printerr(2, "DEBUG: serialize_krb5_ctx: lucid version!\n"); +- maj_stat = gss_export_lucid_sec_context(&min_stat, &ctx, ++ maj_stat = gss_krb5_export_lucid_sec_context(&min_stat, &ctx, + 1, &return_ctx); + if (maj_stat != GSS_S_COMPLETE) { +- pgsserr("gss_export_lucid_sec_context", ++ pgsserr("gss_krb5_export_lucid_sec_context", + maj_stat, min_stat, &krb5oid); + goto out_err; + } +@@ -204,9 +206,9 @@ + else + retcode = prepare_krb5_rfc_cfx_buffer(lctx, buf, endtime); + +- maj_stat = gss_free_lucid_sec_context(&min_stat, ctx, return_ctx); ++ maj_stat = gss_krb5_free_lucid_sec_context(&min_stat, ctx); + if (maj_stat != GSS_S_COMPLETE) { +- pgsserr("gss_export_lucid_sec_context", ++ pgsserr("gss_krb5_export_lucid_sec_context", + maj_stat, min_stat, &krb5oid); + printerr(0, "WARN: failed to free lucid sec context\n"); + } +Index: nfs-utils-1.1.6/utils/gssd/krb5_util.c +=================================================================== +--- nfs-utils-1.1.6.orig/utils/gssd/krb5_util.c ++++ nfs-utils-1.1.6/utils/gssd/krb5_util.c +@@ -332,10 +332,10 @@ + return -1; + } + +- maj_stat = gss_set_allowable_enctypes(&min_stat, credh, &krb5oid, ++ maj_stat = gss_krb5_set_allowable_enctypes(&min_stat, credh, + num_enctypes, &enctypes); + if (maj_stat != GSS_S_COMPLETE) { +- pgsserr("gss_set_allowable_enctypes", ++ pgsserr("gss_krb5_set_allowable_enctypes", + maj_stat, min_stat, &krb5oid); + gss_release_cred(&min_stat, &credh); + return -1; diff --git a/testing/nfs-utils/nfs-utils.install b/testing/nfs-utils/nfs-utils.install new file mode 100644 index 000000000..7dcdf9575 --- /dev/null +++ b/testing/nfs-utils/nfs-utils.install @@ -0,0 +1,32 @@ +## arg 1: the new package version +post_install() { +cat << 'EOM' + ==> PLEASE NOTE: + ==> Extended configuration options for NFS (clients & server) are available in + ==> /etc/conf.d/nfs-common.conf and in /etc/conf.d/nfs-server.conf + ==> + ==> Please refer to http://wiki.archlinux.org/index.php/Nfs + ==> for further information on NFS; for NFSv4, refer to + ==> http://wiki.archlinux.org/index.php/NFSv4 +EOM +} + +## arg 1: the new package version +## arg 2: the old package version +post_upgrade() { + if [ "$(vercmp $2 1.2.0-2)" -lt 0 ]; then +cat << 'EOM' + ==> IMPORTANT NFS UTILS CHANGES: + ==> This is a rather important upgrade, you are going to have to change config files. + ==> /etc/rc.conf daemons changes: + ==> Change portmap to rpcbind + ==> Change nfslock to nfs-common + ==> Change nfsd to nfs-server + ==> + ==> Extended configuration options for NFS (clients & server) are available in: + ==> /etc/conf.d/nfs-common + ==> /etc/conf.d/nfs-server + ==> Please change them to your needs. +EOM + fi +} diff --git a/testing/nfs-utils/start-statd.patch b/testing/nfs-utils/start-statd.patch new file mode 100644 index 000000000..38c60a784 --- /dev/null +++ b/testing/nfs-utils/start-statd.patch @@ -0,0 +1,22 @@ +--- utils/statd/start-statd 2007-05-11 04:40:57.000000000 +0100 ++++ utils/statd/start-statd.new 2007-09-21 17:11:34.000000000 +0100 +@@ -1,9 +1,16 @@ +-#!/bin/sh -p ++#!/bin/sh ++ ++# Original script provided by the NFS project ++# Modified for Arch Linux by Tom Killian ++ + # nfsmount calls this script when mounting a filesystem with locking + # enabled, but when statd does not seem to be running (based on + # /var/run/rpc.statd.pid). + # It should run run statd with whatever flags are apropriate for this + # site. +-PATH=/sbin:/usr/sbin +-exec rpc.statd --no-notify ++ ++# source application-specific settings ++[ -f /etc/conf.d/nfs-common.conf ] && . /etc/conf.d/nfs-common.conf ++ ++exec /usr/sbin/rpc.statd $STATD_OPTS + diff --git a/testing/openssh/PKGBUILD b/testing/openssh/PKGBUILD new file mode 100644 index 000000000..bf45e6396 --- /dev/null +++ b/testing/openssh/PKGBUILD @@ -0,0 +1,70 @@ +# $Id: PKGBUILD 131644 2011-07-13 07:48:58Z bisson $ +# Maintainer: Gaetan Bisson +# Contributor: Aaron Griffin +# Contributor: judd + +pkgname=openssh +pkgver=5.8p2 +pkgrel=9 +pkgdesc='Free version of the SSH connectivity tools' +arch=('i686' 'x86_64') +license=('custom:BSD') +url='http://www.openssh.org/portable.html' +backup=('etc/ssh/ssh_config' 'etc/ssh/sshd_config' 'etc/pam.d/sshd' 'etc/conf.d/sshd') +depends=('krb5' 'openssl' 'libedit') +source=("ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/${pkgname}-${pkgver}.tar.gz" + 'authfile.c.patch' + 'sshd.confd' + 'sshd.pam' + 'sshd') +sha1sums=('64798328d310e4f06c9f01228107520adbc8b3e5' + '3669cb5ca6149f69015df5ce8e60b82c540eb0a4' + 'ec102deb69cad7d14f406289d2fc11fee6eddbdd' + '07fecd5880b1c4fdd8c94ddb2e89ddce88effdc1' + '6b7f8ebf0c1cc37137a7d9a53447ac8a0ee6a2b5') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + + patch -p1 -i ../authfile.c.patch # fix FS#24693 using http://anoncvs.mindrot.org/index.cgi/openssh/authfile.c?revision=1.95 + + ./configure \ + --prefix=/usr \ + --libexecdir=/usr/lib/ssh \ + --sysconfdir=/etc/ssh \ + --with-privsep-user=nobody \ + --with-md5-passwords \ + --with-pam \ + --with-mantype=man \ + --mandir=/usr/share/man \ + --with-xauth=/usr/bin/xauth \ + --with-kerberos5=/usr \ + --with-ssl-engine \ + --with-libedit=/usr/lib \ + --disable-strip # stripping is done by makepkg + + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + make DESTDIR="${pkgdir}" install + + install -Dm755 ../sshd "${pkgdir}"/etc/rc.d/sshd + install -Dm644 ../sshd.pam "${pkgdir}"/etc/pam.d/sshd + install -Dm644 ../sshd.confd "${pkgdir}"/etc/conf.d/sshd + install -Dm644 LICENCE "${pkgdir}/usr/share/licenses/${pkgname}/LICENCE" + + rm "${pkgdir}"/usr/share/man/man1/slogin.1 + ln -sf ssh.1.gz "${pkgdir}"/usr/share/man/man1/slogin.1.gz + + # additional contrib scripts that we like + install -Dm755 contrib/findssl.sh "${pkgdir}"/usr/bin/findssl.sh + install -Dm755 contrib/ssh-copy-id "${pkgdir}"/usr/bin/ssh-copy-id + install -Dm644 contrib/ssh-copy-id.1 "${pkgdir}"/usr/share/man/man1/ssh-copy-id.1 + + # PAM is a common, standard feature to have + sed -i -e '/^#ChallengeResponseAuthentication yes$/c ChallengeResponseAuthentication no' \ + -e '/^#UsePAM no$/c UsePAM yes' \ + "${pkgdir}"/etc/ssh/sshd_config +} diff --git a/testing/openssh/authfile.c.patch b/testing/openssh/authfile.c.patch new file mode 100644 index 000000000..6c18fe807 --- /dev/null +++ b/testing/openssh/authfile.c.patch @@ -0,0 +1,198 @@ +diff -aur old/authfile.c new/authfile.c +--- old/authfile.c 2011-06-12 02:21:52.262338254 +0200 ++++ new/authfile.c 2011-06-12 02:13:43.051467269 +0200 +@@ -1,4 +1,4 @@ +-/* $OpenBSD: authfile.c,v 1.87 2010/11/29 18:57:04 markus Exp $ */ ++/* $OpenBSD: authfile.c,v 1.95 2011/05/29 11:42:08 djm Exp $ */ + /* + * Author: Tatu Ylonen + * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland +@@ -69,6 +69,8 @@ + #include "misc.h" + #include "atomicio.h" + ++#define MAX_KEY_FILE_SIZE (1024 * 1024) ++ + /* Version identification string for SSH v1 identity files. */ + static const char authfile_id_string[] = + "SSH PRIVATE KEY FILE FORMAT 1.1\n"; +@@ -312,12 +314,12 @@ + return pub; + } + +-/* Load the contents of a key file into a buffer */ +-static int ++/* Load a key from a fd into a buffer */ ++int + key_load_file(int fd, const char *filename, Buffer *blob) + { ++ u_char buf[1024]; + size_t len; +- u_char *cp; + struct stat st; + + if (fstat(fd, &st) < 0) { +@@ -325,30 +327,45 @@ + filename == NULL ? "" : filename, + filename == NULL ? "" : " ", + strerror(errno)); +- close(fd); + return 0; + } +- if (st.st_size > 1*1024*1024) { ++ if ((st.st_mode & (S_IFSOCK|S_IFCHR|S_IFIFO)) == 0 && ++ st.st_size > MAX_KEY_FILE_SIZE) { ++ toobig: + error("%s: key file %.200s%stoo large", __func__, + filename == NULL ? "" : filename, + filename == NULL ? "" : " "); +- close(fd); + return 0; + } +- len = (size_t)st.st_size; /* truncated */ +- + buffer_init(blob); +- cp = buffer_append_space(blob, len); +- +- if (atomicio(read, fd, cp, len) != len) { +- debug("%s: read from key file %.200s%sfailed: %.100s", __func__, +- filename == NULL ? "" : filename, +- filename == NULL ? "" : " ", +- strerror(errno)); ++ for (;;) { ++ if ((len = atomicio(read, fd, buf, sizeof(buf))) == 0) { ++ if (errno == EPIPE) ++ break; ++ debug("%s: read from key file %.200s%sfailed: %.100s", ++ __func__, filename == NULL ? "" : filename, ++ filename == NULL ? "" : " ", strerror(errno)); ++ buffer_clear(blob); ++ bzero(buf, sizeof(buf)); ++ return 0; ++ } ++ buffer_append(blob, buf, len); ++ if (buffer_len(blob) > MAX_KEY_FILE_SIZE) { ++ buffer_clear(blob); ++ bzero(buf, sizeof(buf)); ++ goto toobig; ++ } ++ } ++ bzero(buf, sizeof(buf)); ++ if ((st.st_mode & (S_IFSOCK|S_IFCHR|S_IFIFO)) == 0 && ++ st.st_size != buffer_len(blob)) { ++ debug("%s: key file %.200s%schanged size while reading", ++ __func__, filename == NULL ? "" : filename, ++ filename == NULL ? "" : " "); + buffer_clear(blob); +- close(fd); + return 0; + } ++ + return 1; + } + +@@ -606,7 +623,7 @@ + error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); + error("Permissions 0%3.3o for '%s' are too open.", + (u_int)st.st_mode & 0777, filename); +- error("It is recommended that your private key files are NOT accessible by others."); ++ error("It is required that your private key files are NOT accessible by others."); + error("This private key will be ignored."); + return 0; + } +@@ -626,6 +643,7 @@ + case KEY_UNSPEC: + return key_parse_private_pem(blob, type, passphrase, commentp); + default: ++ error("%s: cannot parse key type %d", __func__, type); + break; + } + return NULL; +@@ -670,11 +688,38 @@ + } + + Key * ++key_parse_private(Buffer *buffer, const char *filename, ++ const char *passphrase, char **commentp) ++{ ++ Key *pub, *prv; ++ Buffer pubcopy; ++ ++ buffer_init(&pubcopy); ++ buffer_append(&pubcopy, buffer_ptr(buffer), buffer_len(buffer)); ++ /* it's a SSH v1 key if the public key part is readable */ ++ pub = key_parse_public_rsa1(&pubcopy, commentp); ++ buffer_free(&pubcopy); ++ if (pub == NULL) { ++ prv = key_parse_private_type(buffer, KEY_UNSPEC, ++ passphrase, NULL); ++ /* use the filename as a comment for PEM */ ++ if (commentp && prv) ++ *commentp = xstrdup(filename); ++ } else { ++ key_free(pub); ++ /* key_parse_public_rsa1() has already loaded the comment */ ++ prv = key_parse_private_type(buffer, KEY_RSA1, passphrase, ++ NULL); ++ } ++ return prv; ++} ++ ++Key * + key_load_private(const char *filename, const char *passphrase, + char **commentp) + { +- Key *pub, *prv; +- Buffer buffer, pubcopy; ++ Key *prv; ++ Buffer buffer; + int fd; + + fd = open(filename, O_RDONLY); +@@ -697,23 +742,7 @@ + } + close(fd); + +- buffer_init(&pubcopy); +- buffer_append(&pubcopy, buffer_ptr(&buffer), buffer_len(&buffer)); +- /* it's a SSH v1 key if the public key part is readable */ +- pub = key_parse_public_rsa1(&pubcopy, commentp); +- buffer_free(&pubcopy); +- if (pub == NULL) { +- prv = key_parse_private_type(&buffer, KEY_UNSPEC, +- passphrase, NULL); +- /* use the filename as a comment for PEM */ +- if (commentp && prv) +- *commentp = xstrdup(filename); +- } else { +- key_free(pub); +- /* key_parse_public_rsa1() has already loaded the comment */ +- prv = key_parse_private_type(&buffer, KEY_RSA1, passphrase, +- NULL); +- } ++ prv = key_parse_private(&buffer, filename, passphrase, commentp); + buffer_free(&buffer); + return prv; + } +@@ -737,13 +766,19 @@ + case '\0': + continue; + } ++ /* Abort loading if this looks like a private key */ ++ if (strncmp(cp, "-----BEGIN", 10) == 0) ++ break; + /* Skip leading whitespace. */ + for (; *cp && (*cp == ' ' || *cp == '\t'); cp++) + ; + if (*cp) { + if (key_read(k, &cp) == 1) { +- if (commentp) +- *commentp=xstrdup(filename); ++ cp[strcspn(cp, "\r\n")] = '\0'; ++ if (commentp) { ++ *commentp = xstrdup(*cp ? ++ cp : filename); ++ } + fclose(f); + return 1; + } diff --git a/testing/openssh/sshd b/testing/openssh/sshd new file mode 100755 index 000000000..2ee1091f0 --- /dev/null +++ b/testing/openssh/sshd @@ -0,0 +1,48 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/sshd + +PIDFILE=/var/run/sshd.pid +PID=$(cat $PIDFILE 2>/dev/null) +if ! readlink -q /proc/$PID/exe | grep -q '^/usr/sbin/sshd'; then + PID= + rm $PIDFILE 2>/dev/null +fi + +case "$1" in + start) + stat_busy "Starting Secure Shell Daemon" + [ -f /etc/ssh/ssh_host_key ] || { /usr/bin/ssh-keygen -t rsa1 -N "" -f /etc/ssh/ssh_host_key >/dev/null; } + [ -f /etc/ssh/ssh_host_rsa_key ] || { /usr/bin/ssh-keygen -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key >/dev/null; } + [ -f /etc/ssh/ssh_host_dsa_key ] || { /usr/bin/ssh-keygen -t dsa -N "" -f /etc/ssh/ssh_host_dsa_key >/dev/null; } + [ -f /etc/ssh/ssh_host_ecdsa_key ] || { /usr/bin/ssh-keygen -t ecdsa -N "" -f /etc/ssh/ssh_host_ecdsa_key >/dev/null; } + [ -d /var/empty ] || mkdir -p /var/empty + [ -z "$PID" ] && /usr/sbin/sshd $SSHD_ARGS + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon sshd + stat_done + fi + ;; + stop) + stat_busy "Stopping Secure Shell Daemon" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon sshd + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 diff --git a/testing/openssh/sshd.confd b/testing/openssh/sshd.confd new file mode 100644 index 000000000..5ce7c0079 --- /dev/null +++ b/testing/openssh/sshd.confd @@ -0,0 +1,4 @@ +# +# Parameters to be passed to sshd +# +SSHD_ARGS="" diff --git a/testing/openssh/sshd.pam b/testing/openssh/sshd.pam new file mode 100644 index 000000000..ff8829fe9 --- /dev/null +++ b/testing/openssh/sshd.pam @@ -0,0 +1,11 @@ +#%PAM-1.0 +#auth required pam_securetty.so #Disable remote root +auth required pam_unix.so +auth required pam_env.so +account required pam_nologin.so +account required pam_unix.so +account required pam_time.so +password required pam_unix.so +session required pam_unix_session.so +session required pam_limits.so +-session optional pam_ck_connector.so nox11 diff --git a/testing/quota-tools/LICENSE b/testing/quota-tools/LICENSE new file mode 100644 index 000000000..4bae71589 --- /dev/null +++ b/testing/quota-tools/LICENSE @@ -0,0 +1,33 @@ +/* + * Copyright (c) 1980, 1990 Regents of the University of California. All + * rights reserved. + * + * This code is derived from software contributed to Berkeley by Robert Elz at + * The University of Melbourne. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. 2. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. 3. All advertising + * materials mentioning features or use of this software must display the + * following acknowledgement: This product includes software developed by the + * University of California, Berkeley and its contributors. 4. Neither the + * name of the University nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ diff --git a/testing/quota-tools/PKGBUILD b/testing/quota-tools/PKGBUILD new file mode 100644 index 000000000..79bb209a4 --- /dev/null +++ b/testing/quota-tools/PKGBUILD @@ -0,0 +1,49 @@ +# $Id: PKGBUILD 131802 2011-07-15 11:55:43Z eric $ +# Maintainer: Eric Bélanger + +pkgname=quota-tools +pkgver=4.00_pre1 +pkgrel=1 +pkgdesc="Tools to manage kernel-level quotas in Linux" +arch=('i686' 'x86_64') +url="http://sourceforge.net/projects/linuxquota/" +license=('GPL' 'BSD') +depends=('e2fsprogs') +backup=('etc/warnquota.conf' 'etc/quotatab' 'etc/quotagrpadmins') +options=('!emptydirs') +source=(http://downloads.sourceforge.net/sourceforge/linuxquota/quota-${pkgver/_/-}.tar.gz LICENSE \ + quotaon.diff system_inodes.diff repquota.diff nulls.diff) +md5sums=('ef9d66e8a968ecffd2d9df648fa8ada2' + 'dd792440e684043e4e4ef80963d0237b' + '9ac7ca4746de1ad057baee21474b7906' + '92d9f2a4b3e5e3adf2977051391785a7' + 'd1d70d4167e53d1414079b4391f1cfb8' + '094bce5226c4fd1c383bd0b75405ee2c') +sha1sums=('adf29b49dab449078eb6ffdfe8af51fe85419e28' + '57297bdc9e638c500506169bbbe12eb89bcf7d07' + '2304f03cddd06d8791167f621683f7ef54610673' + 'e2a33f1f95a3ff8c741a2067058e898f6054af09' + '8b00e7c4f7af2188ad49a50a616c1d71eee20459' + '0527f761aa869f5d9e463ceab4a3bf82881d05c2') + +build() { + cd "${srcdir}/${pkgname}" + patch -p1 -i "${srcdir}/quotaon.diff" + patch -p1 -i "${srcdir}/system_inodes.diff" + patch -p1 -i "${srcdir}/repquota.diff" + patch -p1 -i "${srcdir}/nulls.diff" + ./configure --prefix=/usr --sysconfdir=/etc + sed -i -e 's/#define HOSTS_ACCESS 1//' -e 's/HOSTS_ACCESS//' config.h + sed -i 's/-lwrap//' Makefile + make +} + +package() { + cd "${srcdir}/${pkgname}" + make ROOTDIR="${pkgdir}" install + install -D -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + +# remove conflicts with glibc and man-pages + rm "${pkgdir}"/usr/include/rpcsvc/rquota.{h,x} + rm "${pkgdir}/usr/share/man/man2/quotactl.2" +} diff --git a/testing/quota-tools/nulls.diff b/testing/quota-tools/nulls.diff new file mode 100644 index 000000000..97c5bc482 --- /dev/null +++ b/testing/quota-tools/nulls.diff @@ -0,0 +1,20 @@ +#Description: Avoid memory corruption of NULL address +#Author: Petr Pisar + +--- quota/quotasys.c 2010-02-18 09:44:11.000000000 +0100 ++++ quota-tools/quotasys.c 2010-05-05 08:02:53.000000000 +0200 +@@ -746,9 +746,12 @@ + kernel_qfmt_num = 0; + if (!stat("/proc/fs/xfs/stat", &st)) + kernel_qfmt[kernel_qfmt_num++] = QF_XFS; +- else +- if (!quotactl(QCMD(Q_XGETQSTAT, 0), NULL, 0, NULL) || (errno != EINVAL && errno != ENOSYS)) ++ else { ++ fs_quota_stat_t dummy; ++ ++ if (!quotactl(QCMD(Q_XGETQSTAT, 0), "/dev/root", 0, (void *)&dummy) || (errno != EINVAL && errno != ENOSYS)) + kernel_qfmt[kernel_qfmt_num++] = QF_XFS; ++ } + /* Detect new kernel interface; Assume generic interface unless we can prove there is not one... */ + if (!stat("/proc/sys/fs/quota", &st) || errno != ENOENT) { + kernel_iface = IFACE_GENERIC; diff --git a/testing/quota-tools/quotaon.diff b/testing/quota-tools/quotaon.diff new file mode 100644 index 000000000..6a43cee6c --- /dev/null +++ b/testing/quota-tools/quotaon.diff @@ -0,0 +1,216 @@ +# Description: Fix quotaon to work with XFS and print all informational messages only in verbose mode +# Author: Jan Kara + +diff -u quota/quotaon.c quota-tools/quotaon.c +--- quota/quotaon.c 2010-07-28 11:14:02.000000000 +0200 ++++ quota-tools/quotaon.c 2010-06-15 10:11:30.000000000 +0200 +@@ -42,6 +42,7 @@ + #include + #include + #include ++#include + + #include "quotaon.h" + #include "quota.h" +@@ -145,6 +146,19 @@ + } + } + ++int pinfo(char *fmt, ...) ++{ ++ va_list arg; ++ int ret; ++ ++ if (!(flags & FL_VERBOSE)) ++ return 0; ++ va_start(arg, fmt); ++ ret = vprintf(fmt, arg); ++ va_end(arg); ++ return ret; ++} ++ + /* + * Enable/disable rsquash on given filesystem + */ +@@ -171,10 +185,10 @@ + errstr(_("set root_squash on %s: %s\n"), quotadev, strerror(errno)); + return 1; + } +- if ((flags & STATEFLAG_VERBOSE) && (flags & STATEFLAG_OFF)) +- printf(_("%s: %s root_squash turned off\n"), quotadev, type2name(type)); +- else if ((flags & STATEFLAG_VERBOSE) && (flags & STATEFLAG_ON)) +- printf(_("%s: %s root_squash turned on\n"), quotadev, type2name(type)); ++ if (flags & STATEFLAG_OFF) ++ pinfo(_("%s: %s root_squash turned off\n"), quotadev, type2name(type)); ++ else if (flags & STATEFLAG_ON) ++ pinfo(_("%s: %s root_squash turned on\n"), quotadev, type2name(type)); + #endif + return 0; + } +@@ -195,8 +209,7 @@ + errstr(_("quotactl on %s [%s]: %s\n"), quotadev, quotadir, strerror(errno)); + return 1; + } +- if (flags & STATEFLAG_VERBOSE) +- printf(_("%s [%s]: %s quotas turned off\n"), quotadev, quotadir, type2name(type)); ++ pinfo(_("%s [%s]: %s quotas turned off\n"), quotadev, quotadir, type2name(type)); + return 0; + } + if (kernel_iface == IFACE_GENERIC) { +@@ -218,8 +231,7 @@ + errstr(_("Quota format not supported in kernel.\n")); + return 1; + } +- if (flags & STATEFLAG_VERBOSE) +- printf(_("%s [%s]: %s quotas turned on\n"), quotadev, quotadir, type2name(type)); ++ pinfo(_("%s [%s]: %s quotas turned on\n"), quotadev, quotadir, type2name(type)); + return 0; + } + +@@ -268,8 +280,6 @@ + int sflags, ret = 0; + + sflags = flags & FL_OFF ? STATEFLAG_OFF : STATEFLAG_ON; +- if (flags & FL_VERBOSE) +- sflags |= STATEFLAG_VERBOSE; + if (flags & FL_ALL) + sflags |= STATEFLAG_ALL; + +@@ -281,10 +291,7 @@ + errstr(_("Cannot change state of XFS quota. It's not compiled in kernel.\n")); + return 1; + } +- if ((flags & FL_OFF && (kern_quota_on(mnt->mnt_fsname, USRQUOTA, QF_XFS) != -1 +- || kern_quota_on(mnt->mnt_fsname, GRPQUOTA, QF_XFS) != -1)) +- || (!(flags & FL_OFF) && kern_quota_on(mnt->mnt_fsname, type, QF_XFS) == -1)) +- ret = xfs_newstate(mnt, type, extra, sflags); ++ ret = xfs_newstate(mnt, type, extra, sflags); + } + else if (meta_qf_fstype(mnt->mnt_type)) { + if (!hasquota(mnt, type, 0)) +@@ -376,7 +383,7 @@ + while ((mnt = get_next_mount())) { + if (nfs_fstype(mnt->mnt_type)) { + if (!(flags & FL_ALL)) +- fprintf(stderr, "%s: Quota cannot be turned on on NFS filesystem\n", mnt->mnt_fsname); ++ errstr(_("%s: Quota cannot be turned on on NFS filesystem\n"), mnt->mnt_fsname); + continue; + } + +diff -u quota/quotaon.h quota-tools/quotaon.h +--- quota/quotaon.h 2010-02-18 09:44:11.000000000 +0100 ++++ quota-tools/quotaon.h 2010-06-12 12:06:08.000000000 +0200 +@@ -13,7 +13,7 @@ + #define STATEFLAG_ON 0x01 + #define STATEFLAG_OFF 0x02 + #define STATEFLAG_ALL 0x04 +-#define STATEFLAG_VERBOSE 0x08 + + typedef int (newstate_t) (struct mntent * mnt, int type, char *file, int flags); + extern int xfs_newstate(struct mntent *mnt, int type, char *file, int flags); ++extern int pinfo(char *fmt, ...); +diff -u quota/quotaon_xfs.c quota-tools/quotaon_xfs.c +--- quota/quotaon_xfs.c 2010-07-26 18:48:24.000000000 +0200 ++++ quota-tools/quotaon_xfs.c 2010-06-15 10:11:30.000000000 +0200 +@@ -59,8 +59,8 @@ + return 1; + case Q_XFS_QUOTAON: + if (roothack) { +- printf(_("Enabling %s quota on root filesystem" +- " (reboot to take effect)\n"), type2name(type)); ++ pinfo(_("Enabling %s quota on root filesystem" ++ " (reboot to take effect)\n"), type2name(type)); + return 1; + } + errstr(_("Enable XFS %s quota accounting during mount\n"), +@@ -79,12 +79,12 @@ + return -1; + case Q_XFS_QUOTAON: + if (roothack) { +- printf(_("Enabling %s quota on root filesystem" +- " (reboot to take effect)\n"), type2name(type)); ++ pinfo(_("Enabling %s quota on root filesystem" ++ " (reboot to take effect)\n"), type2name(type)); + return 1; + } + if (xopts & XFS_QUOTA_UDQ_ENFD || xopts & XFS_QUOTA_GDQ_ENFD) { +- printf(_("Enabling %s quota enforcement on %s\n"), type2name(type), dev); ++ pinfo(_("Enabling %s quota enforcement on %s\n"), type2name(type), dev); + return 1; + } + errstr(_("Already accounting %s quota on %s\n"), +@@ -92,7 +92,7 @@ + return -1; + case Q_XFS_QUOTAOFF: + if (xopts & XFS_QUOTA_UDQ_ACCT || xopts & XFS_QUOTA_GDQ_ACCT) { +- printf(_("Disabling %s quota accounting on %s\n"), ++ pinfo(_("Disabling %s quota accounting on %s\n"), + type2name(type), dev); + return 1; + } +@@ -121,9 +121,9 @@ + return -1; + } + if (xopts & XFS_QUOTA_UDQ_ACCT || xopts & XFS_QUOTA_GDQ_ACCT) +- acctstr = _("and accounting "); +- printf(_("Disabling %s quota enforcement %son %s\n"), +- type2name(type), acctstr, dev); ++ acctstr = _("and accounting "); ++ pinfo(_("Disabling %s quota enforcement %son %s\n"), ++ type2name(type), acctstr, dev); + return 1; + } + break; +@@ -146,10 +146,10 @@ + errstr(_("quotactl on %s: %s\n"), dev, strerror(errno)); + return 1; + } +- if ((flags & STATEFLAG_VERBOSE) && qoff) +- printf(_("%s: %s quotas turned off\n"), dev, type2name(type)); +- else if ((flags & STATEFLAG_VERBOSE) && !qoff) +- printf(_("%s: %s quotas turned on\n"), dev, type2name(type)); ++ if (qoff) ++ pinfo(_("%s: %s quotas turned off\n"), dev, type2name(type)); ++ else ++ pinfo(_("%s: %s quotas turned on\n"), dev, type2name(type)); + return 0; + } + +@@ -168,8 +168,7 @@ + return 1; + } + +- if (flags & STATEFLAG_VERBOSE) +- printf(_("%s: deleted %s quota blocks\n"), dev, type2name(type)); ++ pinfo(_("%s: deleted %s quota blocks\n"), dev, type2name(type)); + return 0; + } + +@@ -208,16 +207,12 @@ + } + #endif /* XFS_ROOTHACK */ + +- if (xarg == NULL) { /* both acct & enfd on/off */ +- xopts |= (type == USRQUOTA) ? +- (XFS_QUOTA_UDQ_ACCT | XFS_QUOTA_UDQ_ENFD) : +- (XFS_QUOTA_GDQ_ACCT | XFS_QUOTA_GDQ_ENFD); ++ if (xarg == NULL) { /* only enfd on/off */ ++ xopts |= (type == USRQUOTA) ? XFS_QUOTA_UDQ_ENFD : ++ XFS_QUOTA_GDQ_ENFD; + err = xfs_onoff((char *)dev, type, flags, roothack, xopts); + } + else if (strcmp(xarg, "account") == 0) { +- /* only useful if we want root accounting only */ +- if (!roothack || !(flags & STATEFLAG_ON)) +- goto done; + xopts |= (type == USRQUOTA) ? XFS_QUOTA_UDQ_ACCT : XFS_QUOTA_GDQ_ACCT; + err = xfs_onoff((char *)dev, type, flags, roothack, xopts); + } +@@ -231,7 +226,6 @@ + } + else + die(1, _("Invalid argument \"%s\"\n"), xarg); +- done: + free((char *)dev); + return err; + } diff --git a/testing/quota-tools/repquota.diff b/testing/quota-tools/repquota.diff new file mode 100644 index 000000000..3d79497d9 --- /dev/null +++ b/testing/quota-tools/repquota.diff @@ -0,0 +1,91 @@ +# Description: fix repquota to get latest quota info header +# Author: Jan Kara + +diff -u quota/quotaio.c quota-tools/quotaio.c +--- quota/quotaio.c 2010-07-28 11:14:02.000000000 +0200 ++++ quota-tools/quotaio.c 2010-05-28 09:05:21.000000000 +0200 +@@ -147,6 +147,15 @@ + } + } + if (!QIO_ENABLED(h) || flags & IOI_OPENFILE) { /* Need to open file? */ ++ if (QIO_ENABLED(h)) { /* Kernel uses same file? */ ++ unsigned int cmd = ++ (kernel_iface == IFACE_GENERIC) ? Q_SYNC : Q_6_5_SYNC; ++ if (quotactl(QCMD(cmd, h->qh_type), h->qh_quotadev, ++ 0, NULL) < 0) { ++ die(4, _("Cannot sync quotas on device %s: %s\n"), ++ h->qh_quotadev, strerror(errno)); ++ } ++ } + /* We still need to open file for operations like 'repquota' */ + if ((fd = open(qfname, QIO_RO(h) ? O_RDONLY : O_RDWR)) < 0) { + errstr(_("Cannot open quotafile %s: %s\n"), +diff -u quota/quotaio_v1.c quota-tools/quotaio_v1.c +--- quota/quotaio_v1.c 2010-07-26 18:48:24.000000000 +0200 ++++ quota-tools/quotaio_v1.c 2010-05-28 09:05:23.000000000 +0200 +@@ -348,11 +348,6 @@ + struct dquot *dquot = get_empty_dquot(); + qid_t id = 0; + +- if (QIO_ENABLED(h)) /* Kernel uses same file? */ +- if (quotactl(QCMD((kernel_iface == IFACE_GENERIC) ? Q_SYNC : Q_6_5_SYNC, h->qh_type), +- h->qh_quotadev, 0, NULL) < 0) +- die(4, _("Cannot sync quotas on device %s: %s\n"), h->qh_quotadev, +- strerror(errno)); + memset(dquot, 0, sizeof(*dquot)); + dquot->dq_h = h; + lseek(h->qh_fd, 0, SEEK_SET); +diff -u quota/quotaio_v2.c quota-tools/quotaio_v2.c +--- quota/quotaio_v2.c 2010-02-18 09:44:11.000000000 +0100 ++++ quota-tools/quotaio_v2.c 2010-05-28 09:05:23.000000000 +0200 +@@ -484,11 +484,6 @@ + + static int v2_scan_dquots(struct quota_handle *h, int (*process_dquot) (struct dquot *, char *)) + { +- if (QIO_ENABLED(h)) /* Kernel uses same file? */ +- if (quotactl(QCMD((kernel_iface == IFACE_GENERIC) ? Q_SYNC : Q_6_5_SYNC, h->qh_type), +- h->qh_quotadev, 0, NULL) < 0) +- die(4, _("Cannot sync quotas on device %s: %s\n"), h->qh_quotadev, +- strerror(errno)); + return qtree_scan_dquots(h, process_dquot); + } + +diff -u quota/quotasys.c quota-tools/quotasys.c +--- quota/quotasys.c 2010-07-28 11:14:02.000000000 +0200 ++++ quota-tools/quotasys.c 2010-06-15 10:11:30.000000000 +0200 +@@ -861,22 +861,23 @@ + if (kernel_iface == IFACE_GENERIC) { + int actfmt; + +- if (quotactl(QCMD(Q_GETFMT, type), dev, 0, (void *)&actfmt) < 0) +- return -1; +- actfmt = kern2utilfmt(actfmt); +- if (actfmt < 0) +- return -1; +- return actfmt; ++ if (quotactl(QCMD(Q_GETFMT, type), dev, 0, ++ (void *)&actfmt) >= 0) { ++ actfmt = kern2utilfmt(actfmt); ++ if (actfmt >= 0) ++ return actfmt; ++ } ++ } else { ++ if ((fmt == -1 || fmt == QF_VFSV0) && ++ v2_kern_quota_on(dev, type)) /* VFSv0 quota format */ ++ return QF_VFSV0; ++ if ((fmt == -1 || fmt == QF_VFSOLD) && ++ v1_kern_quota_on(dev, type)) /* Old quota format */ ++ return QF_VFSOLD; + } +- if ((fmt == -1 || fmt == QF_VFSV0) && +- v2_kern_quota_on(dev, type)) /* VFSv0 quota format */ +- return QF_VFSV0; + if ((fmt == -1 || fmt == QF_XFS) && + xfs_kern_quota_on(dev, type)) /* XFS quota format */ + return QF_XFS; +- if ((fmt == -1 || fmt == QF_VFSOLD) && +- v1_kern_quota_on(dev, type)) /* Old quota format */ +- return QF_VFSOLD; + return -1; + } + diff --git a/testing/quota-tools/system_inodes.diff b/testing/quota-tools/system_inodes.diff new file mode 100644 index 000000000..94f4d66da --- /dev/null +++ b/testing/quota-tools/system_inodes.diff @@ -0,0 +1,18 @@ +# Description: Do not count system inodes into quota for ext[234] +# Author: Jan Kara + +--- quota/quotacheck.c 2010-02-18 09:44:10.000000000 +0100 ++++ quota-tools//quotacheck.c 2010-05-22 16:47:53.000000000 +0200 +@@ -455,8 +455,10 @@ + return -1; + } + +- while ((long)i_num) { +- if (inode.i_links_count) { ++ while (i_num) { ++ if ((i_num == EXT2_ROOT_INO || ++ i_num >= EXT2_FIRST_INO(fs->super)) && ++ inode.i_links_count) { + debug(FL_DEBUG, _("Found i_num %ld, blocks %ld\n"), (long)i_num, (long)inode.i_blocks); + if (flags & FL_VERBOSE) + blit(NULL); diff --git a/testing/rrdtool/PKGBUILD b/testing/rrdtool/PKGBUILD new file mode 100644 index 000000000..2395df342 --- /dev/null +++ b/testing/rrdtool/PKGBUILD @@ -0,0 +1,37 @@ +# $Id: PKGBUILD 131818 2011-07-15 23:27:54Z dan $ +# Maintainer: Eric Bélanger + +pkgname=rrdtool +pkgver=1.4.5 +pkgrel=3 +pkgdesc="Data logging and graphing application" +arch=('i686' 'x86_64') +url="http://www.rrdtool.org" +license=('GPL' 'custom') +depends=('libpng' 'libxml2' 'pango') +makedepends=('intltool' 'ruby' 'python2' 'tcl' 'lua') +optdepends=('tcl: to use corresponding binding' \ + 'python2: to use corresponding binding' \ + 'ruby: to use corresponding binding' \ + 'lua: to use corresponding binding') +options=('!libtool' '!emptydirs' '!makeflags') +source=(http://oss.oetiker.ch/rrdtool/pub/rrdtool-${pkgver}.tar.gz) +md5sums=('4d116dba9a0888d8aaac179e35d3980a') +sha1sums=('56638e8aedd5d5522152e86746e382b75dc48c35') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + sed -i 's|-lrrd|-lrrd -L/usr/lib/perl5/core_perl/CORE/ -lperl -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE |' \ + bindings/perl-shared/Makefile.PL + ./configure --prefix=/usr --localstatedir=/var --disable-rpath \ + --enable-perl --enable-perl-site-install --with-perl-options='INSTALLDIRS=vendor' \ + --enable-ruby --enable-ruby-site-install --enable-python \ + --enable-lua --enable-lua-site-install --enable-tcl --disable-libwrap + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + make DESTDIR="${pkgdir}" install + install -D -m644 COPYRIGHT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} diff --git a/testing/socat/PKGBUILD b/testing/socat/PKGBUILD new file mode 100644 index 000000000..458009ce3 --- /dev/null +++ b/testing/socat/PKGBUILD @@ -0,0 +1,32 @@ +# $Id: PKGBUILD 131647 2011-07-13 08:01:50Z bisson $ +# Maintainer: Gaetan Bisson +# Contributor: Juergen Hoetzel +# Contributor: John Proctor + +pkgname=socat +pkgver=1.7.1.3 +pkgrel=3 +pkgdesc='Multipurpose relay' +url='http://www.dest-unreach.org/socat/' +license=('GPL2') +arch=('i686' 'x86_64') +depends=('readline' 'openssl') +source=("http://www.dest-unreach.org/socat/download/${pkgname}-${pkgver}.tar.gz") +sha1sums=('5a42275da0d8a5182452b36535a74c3cdf21793b') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + + ./configure \ + --prefix=/usr \ + --mandir=/usr/share/man \ + --disable-libwrap # only required while base/base-devel uses tcp_wrappers + + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + + make DESTDIR="${pkgdir}" install +} diff --git a/testing/tftp-hpa/LICENSE b/testing/tftp-hpa/LICENSE new file mode 100644 index 000000000..6dade6984 --- /dev/null +++ b/testing/tftp-hpa/LICENSE @@ -0,0 +1,32 @@ +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ diff --git a/testing/tftp-hpa/PKGBUILD b/testing/tftp-hpa/PKGBUILD new file mode 100644 index 000000000..4ffee8765 --- /dev/null +++ b/testing/tftp-hpa/PKGBUILD @@ -0,0 +1,35 @@ +# $Id: PKGBUILD 131815 2011-07-15 23:11:48Z dan $ +# Contributor: Jose Javier +pkgname=tftp-hpa +pkgver=5.1 +pkgrel=0 +pkgdesc="Official tftp server" +arch=('i686' 'x86_64') +url="http://www.kernel.org/pub/software/network/tftp/" +license=('BSD') +depends=('readline>=6.0') +conflicts=('netkit-tftp') +backup=('etc/conf.d/tftpd') +source=(http://www.kernel.org/pub/software/network/tftp/$pkgname-$pkgver.tar.gz + tftpd.rc tftpd.conf LICENSE) +md5sums=('d086b1bd6e5ed6375ad407e273afccdf' + 'a974d02526f19222146c8e3d3b598871' + '414a79dc891bced056d99a9bb790fc9e' + '6ce21e27b6fdc1a1adf85c81e42aeecf') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + ./configure --prefix=/usr --mandir=/usr/share/man --without-tcpwrappers + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + make INSTALLROOT="${pkgdir}" install + install -d "${pkgdir}/etc/rc.d" + install -d "${pkgdir}/var/tftpboot" + install -m755 "${srcdir}/tftpd.rc" "${pkgdir}/etc/rc.d/tftpd" + install -D -m644 "${srcdir}/tftpd.conf" "${pkgdir}/etc/conf.d/tftpd" + rm "${pkgdir}/usr/share/man/man8/tftpd.8" + install -D -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} diff --git a/testing/tftp-hpa/tftpd.conf b/testing/tftp-hpa/tftpd.conf new file mode 100644 index 000000000..4705cc3a9 --- /dev/null +++ b/testing/tftp-hpa/tftpd.conf @@ -0,0 +1,4 @@ +# +# Parameters to be passed to TFTPD +# +TFTPD_ARGS="-l -s /var/tftpboot" diff --git a/testing/tftp-hpa/tftpd.rc b/testing/tftp-hpa/tftpd.rc new file mode 100755 index 000000000..b21f87f5c --- /dev/null +++ b/testing/tftp-hpa/tftpd.rc @@ -0,0 +1,38 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +TFTPD_ARGS= +[ -f /etc/conf.d/tftpd ] && . /etc/conf.d/tftpd + +PID=$(pidof -o %PPID /usr/sbin/in.tftpd) +case "$1" in + start) + stat_busy "Starting TFTPD" + [ -z "$PID" ] && /usr/sbin/in.tftpd ${TFTPD_ARGS} + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon in.tftpd + stat_done + fi + ;; + stop) + stat_busy "Stopping TFTPD" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon in.tftpd + stat_done + fi + ;; + restart) + $0 stop + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 diff --git a/testing/vsftpd/PKGBUILD b/testing/vsftpd/PKGBUILD new file mode 100644 index 000000000..c35fe02de --- /dev/null +++ b/testing/vsftpd/PKGBUILD @@ -0,0 +1,43 @@ +# $Id: PKGBUILD 131827 2011-07-15 23:59:43Z dreisner $ +# Maintainer: Andreas Radke +# Contributor: judd + +pkgname=vsftpd +pkgver=2.3.4 +pkgrel=2 +pkgdesc="Very Secure FTP daemon" +arch=('i686' 'x86_64') +url="https://security.appspot.com/vsftpd.html" +license=('GPL2') +depends=('openssl') +backup=('etc/vsftpd.conf' 'etc/xinetd.d/vsftpd') +install=vsftpd.install +source=("https://security.appspot.com/downloads/${pkgname}-${pkgver}.tar.gz" + 'vsftpd.xinetd' 'vsftpd.d') +md5sums=('2ea5d19978710527bb7444d93b67767a' + 'b07fd4609c70063c1d6b20142910c1a6' + '60060a6c7db3b3b7baa1561a302e6923') +sha1sums=('b774cc6b4c50e20f4fe9ca7f6aa74169ce7fe5ea' + 'c87b4ce56dac15223694a6e86c01ea813b877596' + '24f268956c24e78be0c234c6d31f41487922eafe') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + # build-time config + sed \ + -e 's|^#undef VSF_BUILD_SSL$|#define VSF_BUILD_SSL|' \ + -i builddefs.h + make CFLAGS="${CFLAGS}" +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + install -D -m755 vsftpd "${pkgdir}/usr/sbin/vsftpd" + install -D -m644 vsftpd.conf "${pkgdir}/etc/vsftpd.conf" + install -D -m644 vsftpd.8 "${pkgdir}/usr/share/man/man8/vsftpd.8" + install -D -m644 vsftpd.conf.5 "${pkgdir}/usr/share/man/man5/vsftpd.conf.5" + install -D -m644 "${srcdir}/vsftpd.xinetd" "${pkgdir}/etc/xinetd.d/vsftpd" + install -D -m755 "${srcdir}/vsftpd.d" "${pkgdir}/etc/rc.d/vsftpd" + + install -d -m755 "${pkgdir}/usr/share/empty" +} diff --git a/testing/vsftpd/vsftpd.d b/testing/vsftpd/vsftpd.d new file mode 100644 index 000000000..27310855c --- /dev/null +++ b/testing/vsftpd/vsftpd.d @@ -0,0 +1,67 @@ +#!/bin/bash + +daemon_name=vsftpd + +. /etc/rc.conf +. /etc/rc.d/functions + +get_pid() { + pidof -o %PPID $daemon_name +} + +case "$1" in + start) + stat_busy "Starting $daemon_name daemon" + + PID=$(get_pid) + if [ -z "$PID" ]; then + [ -f /var/run/$daemon_name.pid ] && rm -f /var/run/$daemon_name.pid + # RUN + $daemon_name & + # + if [ $? -gt 0 ]; then + stat_fail + exit 1 + else + echo $(get_pid) > /var/run/$daemon_name.pid + add_daemon $daemon_name + stat_done + fi + else + stat_fail + exit 1 + fi + ;; + + stop) + stat_busy "Stopping $daemon_name daemon" + PID=$(get_pid) + # KILL + [ ! -z "$PID" ] && kill $PID &> /dev/null + # + if [ $? -gt 0 ]; then + stat_fail + exit 1 + else + rm -f /var/run/$daemon_name.pid &> /dev/null + rm_daemon $daemon_name + stat_done + fi + ;; + + restart) + $0 stop + sleep 3 + $0 start + ;; + + status) + stat_busy "Checking $daemon_name status"; + ck_status $daemon_name + ;; + + *) + echo "usage: $0 {start|stop|restart|status}" +esac + +exit 0 diff --git a/testing/vsftpd/vsftpd.install b/testing/vsftpd/vsftpd.install new file mode 100644 index 000000000..48f134e24 --- /dev/null +++ b/testing/vsftpd/vsftpd.install @@ -0,0 +1,17 @@ +# arg 1: the new package version +post_install() { + if [ -f lib/modules/`uname -r`/kernel/security/capability.ko ]; then + echo ">>> It appears that your current kernel has linux security" + echo ">>> capabilities built as a module. vsftpd requires this" + echo ">>> functionality to operate." + echo ">>>" + echo ">>> To activate the module, please load it now (modprobe capability)." + echo ">>> Also, you should add it to your MODULES array in rc.conf, so" + echo ">>> it will be activated automatically at boot-up." + fi +} + +post_upgrade() { + post_install $1 +} + diff --git a/testing/vsftpd/vsftpd.xinetd b/testing/vsftpd/vsftpd.xinetd new file mode 100644 index 000000000..eff2eb3db --- /dev/null +++ b/testing/vsftpd/vsftpd.xinetd @@ -0,0 +1,10 @@ +service ftp +{ + socket_type = stream + wait = no + user = root + server = /usr/sbin/vsftpd + log_on_success += HOST DURATION + log_on_failure += HOST + disable = yes +} diff --git a/testing/xinetd/PKGBUILD b/testing/xinetd/PKGBUILD new file mode 100644 index 000000000..27bf3b2a0 --- /dev/null +++ b/testing/xinetd/PKGBUILD @@ -0,0 +1,43 @@ +# $Id: PKGBUILD 131821 2011-07-15 23:50:00Z dan $ +# Maintainer: +# Contributor: Judd + +pkgname=xinetd +pkgver=2.3.14 +pkgrel=7 +pkgdesc="A secure replacement for inetd" +arch=('i686' 'x86_64') +url="http://www.xinetd.org/" +license=('custom') +optdepends=('perl: for xconv.pl script') +backup=('etc/xinetd.conf' 'etc/xinetd.d/servers' 'etc/xinetd.d/services') +source=(http://www.xinetd.org/xinetd-$pkgver.tar.gz + xinetd.conf + xinetd + servers + services) +md5sums=('567382d7972613090215c6c54f9b82d9' + 'f109f699a07bc8cfb5791060f5e87f9e' + 'ea37a2794f202e6b953d9b6956dad16a' + '21f47b4aa20921cfaddddd9f9a407f81' + '9fa2061dc7dd738c8424251deb86f81e') + +build() { + cd $srcdir/$pkgname-$pkgver + sed -i "s#${prefix}/man#${prefix}/share/man#" configure + ./configure --prefix=/usr --without-libwrap + make +} + +package() { + cd $srcdir/$pkgname-$pkgver + make prefix=$pkgdir/usr install + + install -Dm755 $srcdir/xinetd $pkgdir/etc/rc.d/xinetd + install -Dm644 $srcdir/xinetd.conf $pkgdir/etc/xinetd.conf + install -Dm644 $srcdir/servers $pkgdir/etc/xinetd.d/servers + install -Dm644 $srcdir/services $pkgdir/etc/xinetd.d/services + + # install license + install -Dm644 COPYRIGHT $pkgdir/usr/share/licenses/$pkgname/COPYRIGHT +} diff --git a/testing/xinetd/servers b/testing/xinetd/servers new file mode 100644 index 000000000..f064c8d7a --- /dev/null +++ b/testing/xinetd/servers @@ -0,0 +1,10 @@ +service servers +{ + type = INTERNAL UNLISTED + port = 9099 + socket_type = stream + protocol = tcp + wait = no + disable = yes + only_from = 127.0.0.1 +} diff --git a/testing/xinetd/services b/testing/xinetd/services new file mode 100644 index 000000000..4ea304c4f --- /dev/null +++ b/testing/xinetd/services @@ -0,0 +1,10 @@ +service services +{ + type = INTERNAL UNLISTED + port = 9098 + socket_type = stream + protocol = tcp + wait = no + disable = yes + only_from = 127.0.0.1 +} diff --git a/testing/xinetd/xinetd b/testing/xinetd/xinetd new file mode 100755 index 000000000..4b8fa369a --- /dev/null +++ b/testing/xinetd/xinetd @@ -0,0 +1,38 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +PID=`pidof -o %PPID /usr/sbin/xinetd` +case "$1" in + start) + stat_busy "Starting xinetd" + [ -z "$PID" ] && /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid + if [ $? -gt 0 ]; then + stat_fail + else + echo $PID > /var/run/xinetd.pid + add_daemon xinetd + stat_done + fi + ;; + stop) + stat_busy "Stopping xinetd" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm -f /var/run/xinetd.pid + rm_daemon xinetd + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 diff --git a/testing/xinetd/xinetd.conf b/testing/xinetd/xinetd.conf new file mode 100644 index 000000000..b15d9f649 --- /dev/null +++ b/testing/xinetd/xinetd.conf @@ -0,0 +1,14 @@ +# +# /etc/xinetd.conf +# + +defaults +{ + instances = 60 + log_type = SYSLOG authpriv + log_on_success = HOST PID + log_on_failure = HOST + cps = 25 30 +} + +includedir /etc/xinetd.d -- cgit v1.2.3-54-g00ecf