summaryrefslogtreecommitdiff
path: root/games/moria
diff options
context:
space:
mode:
authormaya <maya@pkgsrc.org>2017-10-15 03:16:07 +0000
committermaya <maya@pkgsrc.org>2017-10-15 03:16:07 +0000
commit946a2cf6f25d1bb8db9c2910b92526a594f92031 (patch)
tree37b0c7fae807e96bda42897e002635b4e39d7a73 /games/moria
parentda861219188f6e31385c3fe6a34eaa32cab6bf4f (diff)
downloadpkgsrc-946a2cf6f25d1bb8db9c2910b92526a594f92031.tar.gz
moria: disable fortify, try to put sense into package.
avoid implicit declarations - add includes where necessary, use memset rather than bzero while at it - it's the more portable one. avoid global buffer overflow found via asan. disable fortify because it still won't run and no tool I've tried found what's wrong. it's corrupting the GOT at init according to gdb. bump PKGREVISION
Diffstat (limited to 'games/moria')
-rw-r--r--games/moria/Makefile6
-rw-r--r--games/moria/distinfo8
-rw-r--r--games/moria/patches/patch-ac19
-rw-r--r--games/moria/patches/patch-ad15
-rw-r--r--games/moria/patches/patch-source_generate.c26
-rw-r--r--games/moria/patches/patch-source_tables.c15
6 files changed, 79 insertions, 10 deletions
diff --git a/games/moria/Makefile b/games/moria/Makefile
index 39de94b16c7..1df7d281b3e 100644
--- a/games/moria/Makefile
+++ b/games/moria/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.19 2017/01/03 21:50:53 roy Exp $
+# $NetBSD: Makefile,v 1.20 2017/10/15 03:16:07 maya Exp $
DISTNAME= um5.5.2
PKGNAME= moria-5.5.2
-PKGREVISION= 5
+PKGREVISION= 6
CATEGORIES= games
# The "offical" master site has lost the pub/Games directory.
#MASTER_SITES= ftp://ftp.cis.ksu.edu/pub/Games/Moria/source/
@@ -28,5 +28,7 @@ do-configure:
@${RM} -f ${WRKSRC}/*.[ch] ${WRKSRC}/Makefile
@cd ${WRKSRC}; ${LN} -s source/* unix/* .
+PKGSRC_USE_FORTIFY=no
+
.include "../../mk/curses.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/games/moria/distinfo b/games/moria/distinfo
index 49b40d1a832..46d501cc2cc 100644
--- a/games/moria/distinfo
+++ b/games/moria/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.13 2015/11/03 20:56:59 agc Exp $
+$NetBSD: distinfo,v 1.14 2017/10/15 03:16:07 maya Exp $
SHA1 (um5.5.2.tar.Z) = 69c7a7bf4e2c5be123ee7a82f5ad12ad5d0f5b08
RMD160 (um5.5.2.tar.Z) = 1556c76f151d7ea29da79071a57398f63d0b138b
@@ -6,8 +6,8 @@ SHA512 (um5.5.2.tar.Z) = 987bbccb9cb4870ec91704cd20cf19875320d1cfe62c4c5a0063bfc
Size (um5.5.2.tar.Z) = 910536 bytes
SHA1 (patch-aa) = 45338539960c193e9f7556aa6a588cf40bfbe726
SHA1 (patch-ab) = 21418a69d7a694894dd9408513693f87fff91953
-SHA1 (patch-ac) = ea9e23de0a147f317a579a4a04502cb165b4c4bd
-SHA1 (patch-ad) = f83f4596677b8d37493145f82a4d2d5cb489b53a
+SHA1 (patch-ac) = aefb05ebf219bcf803d92409937f48a65c0a6b0a
+SHA1 (patch-ad) = a13dade7ce548ed078870db8b63548d0a91265dc
SHA1 (patch-ae) = 5cf8ad7c6e5d87856a31a5456ba9ed2422075988
SHA1 (patch-af) = f8a9f32dffa2123512e36c774ca75e0b28a053cc
SHA1 (patch-ag) = af425b9a48c17f170fc780909b7287264a053cc4
@@ -18,3 +18,5 @@ SHA1 (patch-ak) = 3b39f9bd883cae5cd0a8a2561fcb1bcdbfa0bc1b
SHA1 (patch-al) = 0625fd70eeecaa7e0b5f5874b180244fb1f034c2
SHA1 (patch-am) = b5d250e9b870e3540c382c7e7c588e1f1c5a4910
SHA1 (patch-source_files_c) = 56d4c89b4ab2b0e916f06a39cfb25b8cb6a52877
+SHA1 (patch-source_generate.c) = 2f659fab5d7a54a93b2abeea16ef9540b5d76466
+SHA1 (patch-source_tables.c) = b934535fdf8d1ee53e24538ff92be591d72e4b6c
diff --git a/games/moria/patches/patch-ac b/games/moria/patches/patch-ac
index 3d4568fa364..4daf9fede0d 100644
--- a/games/moria/patches/patch-ac
+++ b/games/moria/patches/patch-ac
@@ -1,8 +1,23 @@
-$NetBSD: patch-ac,v 1.2 2004/04/26 10:55:27 seb Exp $
+$NetBSD: patch-ac,v 1.3 2017/10/15 03:16:07 maya Exp $
--- source/config.h.orig 1994-07-22 01:47:13.000000000 +0000
+++ source/config.h
-@@ -200,16 +200,18 @@ some of the system defines set up here.
+@@ -12,6 +12,14 @@ Constant.h should always be included aft
+ some of the system defines set up here.
+ #endif
+
++#include <sys/stat.h>
++
++#include <time.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
++
+ /* Person to bother if something goes wrong. */
+ /* Recompile files.c and misc2.c if this changes. */
+ #define WIZARD "David Grabiner"
+@@ -200,16 +208,18 @@ some of the system defines set up here.
/* This must be unix; change MORIA_LIB as appropriate. */
#define MORIA_SAV "moria.save"
diff --git a/games/moria/patches/patch-ad b/games/moria/patches/patch-ad
index 3ddba32b3f1..2b6b22ecd58 100644
--- a/games/moria/patches/patch-ad
+++ b/games/moria/patches/patch-ad
@@ -1,6 +1,6 @@
-$NetBSD: patch-ad,v 1.3 2007/03/06 23:25:48 rillig Exp $
---- source/io.c.orig 1994-07-22 03:47:26.000000000 +0200
-+++ source/io.c 2007-03-07 00:06:06.234247718 +0100
+$NetBSD: patch-ad,v 1.4 2017/10/15 03:16:07 maya Exp $
+--- source/io.c.orig 1994-07-22 01:47:26.000000000 +0000
++++ source/io.c
@@ -90,12 +90,19 @@ typedef struct { int stuff; } fpvmach;
#include <sys/types.h>
#endif
@@ -30,6 +30,15 @@ $NetBSD: patch-ad,v 1.3 2007/03/06 23:25:48 rillig Exp $
py.misc.male |= 2;
(void) ioctl(0, TIOCGETP, (char *)&tbuf);
+@@ -313,7 +320,7 @@ void init_curses()
+ #endif
+
+ /* PC curses returns ERR */
+-#if defined(USG) && !defined(PC_CURSES) && !defined(AMIGA)
++#if 1
+ if (initscr() == NULL)
+ #else
+ if (initscr() == ERR)
@@ -331,7 +338,7 @@ void init_curses()
#if defined(atarist) && defined(__GNUC__)
(void) signal (SIGTSTP, (__Sigfunc)suspend);
diff --git a/games/moria/patches/patch-source_generate.c b/games/moria/patches/patch-source_generate.c
new file mode 100644
index 00000000000..60bae3a1505
--- /dev/null
+++ b/games/moria/patches/patch-source_generate.c
@@ -0,0 +1,26 @@
+$NetBSD: patch-source_generate.c,v 1.1 2017/10/15 03:16:07 maya Exp $
+
+Always use memset over bzero.
+As opposed to implicitly declaring bzero, and because memset is a
+part of the C standard.
+
+--- source/generate.c.orig 1994-07-22 01:47:23.000000000 +0000
++++ source/generate.c
+@@ -123,9 +123,6 @@ int *rdir, *cdir;
+ /* Blanks out entire cave -RAK- */
+ static void blank_cave()
+ {
+-#ifndef USG
+- bzero ((char *)&cave[0][0], sizeof (cave));
+-#else
+ #ifdef MAC
+ /* On the mac, cave is a pointer, so sizeof(cave) = 4! */
+ (void)memset((char *)&cave[0][0], 0,
+@@ -133,7 +130,6 @@ static void blank_cave()
+ #else
+ (void)memset((char *)&cave[0][0], 0, sizeof (cave));
+ #endif
+-#endif
+ }
+
+
diff --git a/games/moria/patches/patch-source_tables.c b/games/moria/patches/patch-source_tables.c
new file mode 100644
index 00000000000..d0dd5935af2
--- /dev/null
+++ b/games/moria/patches/patch-source_tables.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-source_tables.c,v 1.1 2017/10/15 03:16:07 maya Exp $
+
+Avoid global buffer overflow
+
+--- source/tables.c.orig 1994-07-22 01:47:47.000000000 +0000
++++ source/tables.c
+@@ -13,7 +13,7 @@
+ #ifdef MORIA_HOU
+ /* Operating hours for Moria -RAK- */
+ /* X = Open; . = Closed */
+-char days[7][29] = { "SUN:XXXXXXXXXXXXXXXXXXXXXXXX",
++char days[7][30] = { "SUN:XXXXXXXXXXXXXXXXXXXXXXXX",
+ "MON:XXXXXXXX.........XXXXXXX",
+ "TUE:XXXXXXXX.........XXXXXXX",
+ "WED:XXXXXXXX.........XXXXXXX",