1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-22 08:58:47 +00:00

Create high score dir with mode 755, when installing from the package.

Respect $HOME/.Xauthority.
This commit is contained in:
Thomas Gellekum 1998-03-26 12:13:39 +00:00
parent e7993a1b0e
commit dda7cefae9
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=10317
4 changed files with 58 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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