summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--games/xkobo/Makefile4
-rw-r--r--games/xkobo/files/patch-aa19
-rw-r--r--games/xkobo/files/patch-ab35
-rw-r--r--games/xkobo/pkg-plist4
4 files changed, 58 insertions, 4 deletions
diff --git a/games/xkobo/Makefile b/games/xkobo/Makefile
index 677092833771..a638fa553e9e 100644
--- a/games/xkobo/Makefile
+++ b/games/xkobo/Makefile
@@ -3,7 +3,7 @@
# Date created: 18 Jul 1995
# Whom: jkh
#
-# $Id: Makefile,v 1.9 1997/07/02 07:54:05 tg Exp $
+# $Id: Makefile,v 1.10 1997/11/12 09:57:17 tg Exp $
#
DISTNAME= xkobo-1.11
@@ -12,6 +12,8 @@ MASTER_SITES= ${MASTER_SITE_XCONTRIB} \
ftp://ftp.uoknor.edu/mirrors/X/contrib/games/
MASTER_SITE_SUBDIR= games
+MAINTAINER= ports@FreeBSD.ORG
+
USE_IMAKE= yes
ALL_TARGET= xkobo
diff --git a/games/xkobo/files/patch-aa b/games/xkobo/files/patch-aa
index 621b23d399ce..34330e40acd7 100644
--- a/games/xkobo/files/patch-aa
+++ b/games/xkobo/files/patch-aa
@@ -1,5 +1,5 @@
--- Imakefile.orig Fri Jan 10 03:29:36 1997
-+++ Imakefile Wed Nov 12 10:55:46 1997
++++ Imakefile Wed Mar 25 20:18:50 1998
@@ -6,7 +6,7 @@
SHIPS = 5
@@ -9,3 +9,20 @@
/* C++ COMPILER */
/* CXX = g++ */
+@@ -19,6 +19,7 @@
+ #ifdef SECURE_SCOREFILES
+ /* ADMINISTER OF THE GAME */
+ XKOBO_ADMINISTER = games
++DEF_SECURE = -DSECURE_SCOREFILES
+ #endif
+
+ /* ------------------------------------------------------------------- */
+@@ -35,7 +36,7 @@
+ SRCS = $(SRCS1) $(SRCS2)
+
+ DEFINES = -DWAIT_MSEC=$(WAIT_MSEC) -DSHIPS=$(SHIPS) \
+- -DXKOBO_SCORE_DIR=\"$(HSCORE_DIR)\"
++ -DXKOBO_SCORE_DIR=\"$(HSCORE_DIR)\" $(DEF_SECURE)
+
+ CCOPTIONS = #-Wall -g -pg
+
diff --git a/games/xkobo/files/patch-ab b/games/xkobo/files/patch-ab
new file mode 100644
index 000000000000..9591a1bf90cd
--- /dev/null
+++ b/games/xkobo/files/patch-ab
@@ -0,0 +1,35 @@
+--- xlwin.C.orig Wed Mar 13 17:34:46 1996
++++ xlwin.C Wed Mar 25 20:16:00 1998
+@@ -21,6 +21,10 @@
+ */
+
+ extern "C"{
++#ifdef SECURE_SCOREFILES
++#include <sys/types.h>
++#include <unistd.h>
++#endif
+ #include <stdio.h>
+ #include <stdlib.h>
+ }
+@@ -105,7 +109,21 @@
+ {
+ if (mask == -1) return;
+ if (disp == NULL){
++#ifdef SECURE_SCOREFILES
++ uid_t ruid, euid;
++
++ /* get ruid */
++ ruid = getuid();
++ /* save euid */
++ euid = geteuid();
++ /* become normal user to read $HOME/.Xauthority */
++ (void)seteuid(ruid);
++#endif
+ disp = XOpenDisplay(disp_string);
++#ifdef SECURE_SCOREFILES
++ /* become XKOBO_ADMINISTER again */
++ (void)seteuid(euid);
++#endif
+ if (disp == NULL){
+ fprintf(stderr, "xlwin: can't open display\n");
+ exit(1);
diff --git a/games/xkobo/pkg-plist b/games/xkobo/pkg-plist
index 5fb419ad3c30..8ec3efc42d91 100644
--- a/games/xkobo/pkg-plist
+++ b/games/xkobo/pkg-plist
@@ -1,4 +1,4 @@
bin/xkobo
man/man1/xkobo.1.gz
-@exec mkdir %D/lib/X11/xkobo-scores && chmod 777 %D/lib/X11/xkobo-scores
-@unexec rm -r %D/lib/X11/xkobo-scores
+@exec mkdir -p %D/lib/X11/xkobo-scores && chmod 755 %D/lib/X11/xkobo-scores; chown games %D/lib/X11/xkobo-scores
+@unexec rm -rf %D/lib/X11/xkobo-scores