freebsd-ports/games/xtrojka/files/patch-aa
Jim Mock 40c4d3d7f0 Fix exploit where a local user can overwrite arbitrary files.
PR:		19862
		19864
19862 submitted by:	Rich Mirch <mirchr@sunyit.edu>
19864 submitted by:	maintainer
2000-07-13 20:33:25 +00:00

83 lines
1.7 KiB
Text

--- Makefile.orig Sat Oct 21 22:38:22 1995
+++ Makefile Wed Jul 12 08:50:34 2000
@@ -8,7 +8,7 @@
# your favorite C-compiler
#
-CC=gcc
+CC?=gcc
#CC=cc
@@ -22,13 +22,13 @@
# Touch 'hiscore.c' and 'score_status_mgr.c' when you change
# these variables!
#
-HSFILE=/usr/local/games/lib/xtrojka.scores
+HSFILE=${PREFIX}/share/xtrojka/xtrojka.scores
#HSFILE=/tmp/xtrojka.scores
CFLAGS= -DSCOREFILE='"$(HSFILE)"'
# add library search path
#
-CFLAGS+=-L/usr/X11/lib
+CFLAGS+=-L${X11BASE}/lib
# on some systems you might add this line, because gcc starts wining
# about 'sizeof(Display)', since Display might be an empty struct;
@@ -42,24 +42,28 @@
# location of xtrojka game
#
-TARGET_DIR=/usr/games
+TARGET_DIR=${PREFIX}/bin
# location of the manualpage
#
-MANDIR=/usr/local/man/man6
+MANDIR=${PREFIX}/man/man6
# please comment out for the system you use
#
# sunos 4.1.3
-XDIR=/usr/openwin/include
-LIBS=-lm
+#XDIR=/usr/openwin/include
+#LIBS=-lm
# solaris
#XDIR=/usr/openwin/include
#LIBS=-lnsl
+# FreeBSD
+XDIR=${X11BASE}/include
+LIBS=-lm
+
#
#
# main
@@ -101,11 +105,17 @@
#
#
install:
- @echo $(HSFILE)|sed -e 's/\//\\\//g'>/tmp/hsn; \
- sed -e "s/__SCOREDIR__/`cat /tmp/hsn`/g" manpage > xtrojka.6; \
- cp xtrojka.6 $(MANDIR); chmod go+r xtrojka.6; \
- cp xtrojka $(TARGET_DIR);chmod go+rx xtrojka; \
- touch $(HSFILE); chmod go+rwx $(HSFILE);
+ @rm -f hsn
+ echo $(HSFILE)|sed -e 's/\//\\\//g'>hsn
+ sed -e "s/__SCOREDIR__/`cat hsn`/g" manpage > xtrojka.6
+ gzip -c xtrojka.6 >$(MANDIR)/xtrojka.6.gz
+ cp xtrojka $(TARGET_DIR)
+ chmod 2755 $(TARGET_DIR)/xtrojka
+ chgrp games $(TARGET_DIR)/xtrojka
+ touch $(HSFILE)
+ chmod 664 $(HSFILE)
+ chgrp games $(HSFILE)
+ @rm -f hsn
clean:
rm -rf *.o core xtrojka xtrojka.6