diff options
Diffstat (limited to 'patches/source/dhcpcd')
-rw-r--r-- | patches/source/dhcpcd/50-ntp.conf.diff | 29 | ||||
-rw-r--r-- | patches/source/dhcpcd/COPYRIGHT | 26 | ||||
-rwxr-xr-x | patches/source/dhcpcd/dhcpcd.SlackBuild | 119 | ||||
-rw-r--r-- | patches/source/dhcpcd/dhcpcd.dho_optionsoverloaded.dos.patch | 11 | ||||
-rw-r--r-- | patches/source/dhcpcd/doinst.sh | 15 | ||||
-rw-r--r-- | patches/source/dhcpcd/slack-desc | 19 |
6 files changed, 219 insertions, 0 deletions
diff --git a/patches/source/dhcpcd/50-ntp.conf.diff b/patches/source/dhcpcd/50-ntp.conf.diff new file mode 100644 index 00000000..63fd914b --- /dev/null +++ b/patches/source/dhcpcd/50-ntp.conf.diff @@ -0,0 +1,29 @@ +--- ./dhcpcd-hooks/50-ntp.conf.orig 2010-11-19 04:17:14.000000000 -0600 ++++ ./dhcpcd-hooks/50-ntp.conf 2010-12-29 16:07:48.000000000 -0600 +@@ -8,6 +8,26 @@ + # NTP_CONF=/usr/pkg/etc/ntpd.conf + # to use openntpd from pkgsrc instead of the system provided ntp. + ++# Detect OpenRC, Debian or BSD rc ++# Distributions may want to just have their command here instead of this ++if type rc-service >/dev/null 2>&1 && rc-service --exists ntpd; then ++ ntpd_restart_cmd="rc-service ntpd -- -Ds restart" ++elif type invoke-rc.d >/dev/null 2>&1; then ++ if [ -x /etc/init.d/ntp ]; then ++ ntpd_restart_cmd="invoke-rc.d ntp try-restart" ++ fi ++ # Debian as a seperate file for DHCP config to avoid stamping on ++ # the master. ++ [ -e /var/lib/ntp ] || mkdir /var/lib/ntp ++ : ${NTP_DHCP_CONF:=/var/lib/ntp/ntp.conf.dhcp} ++elif [ -x /etc/rc.d/ntpd ]; then ++ ntpd_restart_cmd="/etc/rc.d/ntpd status >/dev/null 2>&1 && /etc/rc.d/ntpd restart" ++elif [ -x /usr/local/etc/rc.d/ntpd ]; then ++ ntpd_restart_cmd="/usr/local/etc/rc.d/ntpd status >/dev/null 2>&1 && /usr/local/etc/rc.d/ntpd restart" ++elif [ -x /etc/rc.d/rc.ntpd ]; then ++ ntpd_restart_cmd="/etc/rc.d/rc.ntpd status >/dev/null 2>&1 && /etc/rc.d/rc.ntpd restart" ++fi ++ + : ${ntpd_restart_cmd:=service_condcommand ntpd restart} + if type invoke-rc.d >/dev/null 2>&1; then + # Debian has a seperate file for DHCP config to avoid stamping on diff --git a/patches/source/dhcpcd/COPYRIGHT b/patches/source/dhcpcd/COPYRIGHT new file mode 100644 index 00000000..07d9e683 --- /dev/null +++ b/patches/source/dhcpcd/COPYRIGHT @@ -0,0 +1,26 @@ +/* + * dhcpcd - DHCP client daemon + * Copyright 2006-2008 Roy Marples <roy@marples.name> + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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/patches/source/dhcpcd/dhcpcd.SlackBuild b/patches/source/dhcpcd/dhcpcd.SlackBuild new file mode 100755 index 00000000..8d91540c --- /dev/null +++ b/patches/source/dhcpcd/dhcpcd.SlackBuild @@ -0,0 +1,119 @@ +#!/bin/sh + +# Copyright 2008, 2009, 2010, 2011, 2014 Patrick J. Volkerding, Sebeka, MN, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + + +VERSION=${VERSION:-$(echo dhcpcd-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} +BUILD=${BUILD:-2_slack13.1} + +NUMJOBS=${NUMJOBS:-" -j7 "} + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i486 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp} +PKG=$TMP/package-dhcpcd + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +rm -rf $PKG +mkdir -p $TMP $PKG +cd $TMP +rm -rf dhcpcd-$VERSION +tar xvf $CWD/dhcpcd-$VERSION.tar.?z* || exit 1 +cd dhcpcd-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# At this point, it should be safe to assume that /var will be mounted by the +# time dhcpcd is called, as all non-root local filesystems are mounted from +# /etc/rc.d/rc.S, and /var should not be on a network filesystem. As such, +# we'll use the FHS layout instead of putting things in /etc/dhcpc + +# Fixup the 50-ntp.conf hook with our init script location +zcat $CWD/50-ntp.conf.diff.gz | patch -p1 || exit 1 + +# Security fix: +zcat $CWD/dhcpcd.dho_optionsoverloaded.dos.patch.gz | patch -p1 || exit 1 + +# Yes, /lib/dhcpcd is correct, even on x86_64. +CFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sbindir=/sbin \ + --sysconfdir=/etc \ + --dbdir=/var/lib/dhcpcd \ + --libexecdir=/lib/dhcpcd \ + --mandir=/usr/man \ + --with-hooks="50-ntp.conf 50-yp.conf" \ + --build=$ARCH-slackware-linux + +make $NUMJOBS || make || exit 1 +make install DESTDIR=$PKG HOOKSCRIPTS="50-ntp.conf 50-yp.conf" || exit 1 + +find $PKG | xargs file | grep -e "executable" -e "shared object" \ + | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +# Let's not clobber the config file +mv $PKG/etc/dhcpcd.conf $PKG/etc/dhcpcd.conf.new + +# Compress manpages +( cd $PKG/usr/man + find . -type f -exec gzip -9 {} \; + for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done +) + +mkdir -p $PKG/usr/doc/dhcpcd-$VERSION +cp -a README* $PKG/usr/doc/dhcpcd-$VERSION +zcat $CWD/COPYRIGHT.gz > $PKG/usr/doc/dhcpcd-$VERSION/COPYRIGHT + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $TMP/dhcpcd-$VERSION-$ARCH-$BUILD.txz + diff --git a/patches/source/dhcpcd/dhcpcd.dho_optionsoverloaded.dos.patch b/patches/source/dhcpcd/dhcpcd.dho_optionsoverloaded.dos.patch new file mode 100644 index 00000000..77007cf9 --- /dev/null +++ b/patches/source/dhcpcd/dhcpcd.dho_optionsoverloaded.dos.patch @@ -0,0 +1,11 @@ +--- ./dhcp.c.orig 2013-08-02 15:12:22.000000000 -0500 ++++ ./dhcp.c 2014-08-01 15:34:23.681955373 -0500 +@@ -345,7 +345,7 @@ + case DHO_OPTIONSOVERLOADED: + /* Ensure we only get this option once */ + if (!overl) +- overl = p[1]; ++ overl = 0x80 | p[1]; + break; + } + l = *p++; diff --git a/patches/source/dhcpcd/doinst.sh b/patches/source/dhcpcd/doinst.sh new file mode 100644 index 00000000..a1a93b20 --- /dev/null +++ b/patches/source/dhcpcd/doinst.sh @@ -0,0 +1,15 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +config etc/dhcpcd.conf.new + diff --git a/patches/source/dhcpcd/slack-desc b/patches/source/dhcpcd/slack-desc new file mode 100644 index 00000000..04859d7c --- /dev/null +++ b/patches/source/dhcpcd/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +dhcpcd: dhcpcd (DHCP client daemon) +dhcpcd: +dhcpcd: The DHCP client program dhcpcd is used to connect to a network by +dhcpcd: contacting a DHCP server. dhcpcd gets an IP address and other +dhcpcd: information from a corresponding DHCP server, configures the network +dhcpcd: interface automatically, and tries to renew the lease time according +dhcpcd: to RFC2131 or RFC1541 depending on the command line option. +dhcpcd: +dhcpcd: +dhcpcd: +dhcpcd: |