diff options
author | root <root@rshg054.dnsready.net> | 2012-07-17 00:01:52 +0000 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2012-07-17 00:01:52 +0000 |
commit | 412d061bfbf23d1e908eed3f8405b1af46fb1ba8 (patch) | |
tree | ee137173c889a2b7279200c20b168f9d9b9fdd64 /community/bsd-games | |
parent | 50a1eb604b2d5503a06d56b76347faa581160245 (diff) |
Tue Jul 17 00:01:52 UTC 2012
Diffstat (limited to 'community/bsd-games')
-rw-r--r-- | community/bsd-games/PKGBUILD | 19 | ||||
-rw-r--r-- | community/bsd-games/bad-ntohl-cast.diff | 22 | ||||
-rw-r--r-- | community/bsd-games/null-check.diff | 24 |
3 files changed, 59 insertions, 6 deletions
diff --git a/community/bsd-games/PKGBUILD b/community/bsd-games/PKGBUILD index 68e93182f..470e8a2f0 100644 --- a/community/bsd-games/PKGBUILD +++ b/community/bsd-games/PKGBUILD @@ -1,11 +1,11 @@ -# $Id: PKGBUILD 72260 2012-06-11 12:32:05Z cbrannon $ +# $Id: PKGBUILD 73816 2012-07-15 23:02:25Z cbrannon $ # Maintainer: Chris Brannon <cmbrannon79@gmail.com> # Contributor: Abhishek Dasgupta <abhidg@gmail.com> # Contributor: SmackleFunky <smacklefunky@optusnet.com.au> pkgname=bsd-games pkgver=2.17 -pkgrel=12 +pkgrel=13 pkgdesc="A linux port for a collection of BSD command line games." url="ftp://ftp.ibiblio.org/pub/Linux/games/" arch=('i686' 'x86_64') @@ -13,9 +13,10 @@ install=$pkgname.install license=('BSD') depends=(gcc-libs words sh) makedepends=('flex' 'bison' 'm4') -source=(ftp://ftp.ibiblio.org/pub/Linux/games/$pkgname-$pkgver.tar.gz \ - config.params stdio.h.diff gamescreen.h.diff getline.diff - number.c.diff bsd-games-2.17-64bit.patch) +source=(ftp://ftp.ibiblio.org/pub/Linux/games/$pkgname-$pkgver.tar.gz + config.params stdio.h.diff gamescreen.h.diff getline.diff + number.c.diff bsd-games-2.17-64bit.patch + bad-ntohl-cast.diff null-check.diff) build() { cd "${srcdir}/$pkgname-$pkgver" @@ -36,6 +37,10 @@ build() { # Incorporated some fixes from Debian patch -p1 -i "${srcdir}/number.c.diff" +# ntohl returns uint32_t, not unsigned long: + patch -p1 -i "${srcdir}/bad-ntohl-cast.diff" +# And add a NULL pointer check to the "hunt" program, fixing a segfault. + patch -p1 -i "${srcdir}/null-check.diff" sed -i "s/FISH/GO-FISH/g; s/\.Nm fish/\.Nm go-fish/g" fish/fish.6 sed -i "s/tenths/tenth/g" tests/number.-0.1 @@ -92,4 +97,6 @@ md5sums=('238a38a3a017ca9b216fc42bde405639' '9c0fa6e2345bd0a7945c9a41d5ba68aa' '5356bd6999ae53dd27cb2a0f837a3e70' '47249a90f38ccb4dd07625b245bbc728' - '257813b76a41c8b2c02701571c804227') + '257813b76a41c8b2c02701571c804227' + '3d21a9dad2e603ddf3842972e4ff85a1' + 'a43ca0b4b9ebc4eec26372c52014ac0a') diff --git a/community/bsd-games/bad-ntohl-cast.diff b/community/bsd-games/bad-ntohl-cast.diff new file mode 100644 index 000000000..f783813e9 --- /dev/null +++ b/community/bsd-games/bad-ntohl-cast.diff @@ -0,0 +1,22 @@ +diff --git a/hunt/hunt/playit.c b/hunt/hunt/playit.c +index 9acf86e..881a4e7 100644 +--- a/hunt/hunt/playit.c ++++ b/hunt/hunt/playit.c +@@ -114,7 +114,7 @@ playit() + bad_con(); + /* NOTREACHED */ + } +- if (ntohl(version) != (unsigned long)HUNT_VERSION) { ++ if (ntohl(version) != (uint32_t)HUNT_VERSION) { + bad_ver(); + /* NOTREACHED */ + } +@@ -649,7 +649,7 @@ do_message() + bad_con(); + /* NOTREACHED */ + } +- if (ntohl(version) != (unsigned long)HUNT_VERSION) { ++ if (ntohl(version) != (uint32_t)HUNT_VERSION) { + bad_ver(); + /* NOTREACHED */ + } diff --git a/community/bsd-games/null-check.diff b/community/bsd-games/null-check.diff new file mode 100644 index 000000000..048ed93f4 --- /dev/null +++ b/community/bsd-games/null-check.diff @@ -0,0 +1,24 @@ +diff --git a/hunt/hunt/hunt.c b/hunt/hunt/hunt.c +index 11f4c44..28321bc 100644 +--- a/hunt/hunt/hunt.c ++++ b/hunt/hunt/hunt.c +@@ -394,7 +394,8 @@ broadcast_vec(s, vector) + + vec_cnt = 0; + for (ip = ifp; ip; ip = ip->ifa_next) +- if ((ip->ifa_addr->sa_family == AF_INET) && ++ if (ip->ifa_addr && ++ (ip->ifa_addr->sa_family == AF_INET) && + (ip->ifa_flags & IFF_BROADCAST)) + vec_cnt++; + +@@ -405,7 +406,8 @@ broadcast_vec(s, vector) + + vec_cnt = 0; + for (ip = ifp; ip; ip = ip->ifa_next) +- if ((ip->ifa_addr->sa_family == AF_INET) && ++ if (ip->ifa_addr && ++ (ip->ifa_addr->sa_family == AF_INET) && + (ip->ifa_flags & IFF_BROADCAST)) + memcpy(&(*vector)[vec_cnt++], ip->ifa_broadaddr, + sizeof(struct sockaddr_in)); |