pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/games/moria moria: disable fortify, try to put sense i...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/33242af378df
branches:  trunk
changeset: 370320:33242af378df
user:      maya <maya%pkgsrc.org@localhost>
date:      Sun Oct 15 03:16:07 2017 +0000

description:
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:

 games/moria/Makefile                        |   6 ++++--
 games/moria/distinfo                        |   8 +++++---
 games/moria/patches/patch-ac                |  19 +++++++++++++++++--
 games/moria/patches/patch-ad                |  15 ++++++++++++---
 games/moria/patches/patch-source_generate.c |  26 ++++++++++++++++++++++++++
 games/moria/patches/patch-source_tables.c   |  15 +++++++++++++++
 6 files changed, 79 insertions(+), 10 deletions(-)

diffs (155 lines):

diff -r aef055a77a63 -r 33242af378df games/moria/Makefile
--- a/games/moria/Makefile      Sat Oct 14 21:45:24 2017 +0000
+++ b/games/moria/Makefile      Sun Oct 15 03:16:07 2017 +0000
@@ -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 @@
        @${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 -r aef055a77a63 -r 33242af378df games/moria/distinfo
--- a/games/moria/distinfo      Sat Oct 14 21:45:24 2017 +0000
+++ b/games/moria/distinfo      Sun Oct 15 03:16:07 2017 +0000
@@ -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 @@
 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-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 -r aef055a77a63 -r 33242af378df games/moria/patches/patch-ac
--- a/games/moria/patches/patch-ac      Sat Oct 14 21:45:24 2017 +0000
+++ b/games/moria/patches/patch-ac      Sun Oct 15 03:16:07 2017 +0000
@@ -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 -r aef055a77a63 -r 33242af378df games/moria/patches/patch-ad
--- a/games/moria/patches/patch-ad      Sat Oct 14 21:45:24 2017 +0000
+++ b/games/moria/patches/patch-ad      Sun Oct 15 03:16:07 2017 +0000
@@ -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 @@
  
    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 -r aef055a77a63 -r 33242af378df games/moria/patches/patch-source_generate.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/moria/patches/patch-source_generate.c       Sun Oct 15 03:16:07 2017 +0000
@@ -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 -r aef055a77a63 -r 33242af378df games/moria/patches/patch-source_tables.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/moria/patches/patch-source_tables.c Sun Oct 15 03:16:07 2017 +0000
@@ -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",



Home | Main Index | Thread Index | Old Index