Hi,

$ xkobo                                                               
/usr/local/bin/xkobo: not supposed to be setgid, aborting
Abort trap

One way to get xkobo running again would be to add the _permit_setugid
symbol. On the other hand, there's this approach: switch to writing a
scorefile at ./xkobo-scores instead of /var/games/xkobo.scores/$uid, so
setgid is no longer necessary.

This means there is no longer a systemwide shared scorefile. I think
that for a number of reasons, that's a thing of the past.

The code in the patch is not great, but I would rather not rewrite the
whole program...

blob - 0b094ad278a68b3592b1ddd22ec6f5777e752d19
blob + 0e61ee1315f68f9814e25a95b82bba8f6fadb5ac
--- games/xkobo/Makefile
+++ games/xkobo/Makefile
@@ -2,7 +2,7 @@ COMMENT =       multi-way scrolling shoot'em up for X11, add
 #'
 
 DISTNAME =     xkobo-1.11
-REVISION =     9
+REVISION =     10
 CATEGORIES =   games
 
 SITES =                ${SITE_XCONTRIB:=games/}  \
@@ -17,7 +17,7 @@ PATCH_LIST =  patch-* extra-hard
 
 MAINTAINER =   Marc Espie <[email protected]>
 
-# GPL
+# GPLv2+
 PERMIT_PACKAGE =       Yes
        
 WANTLIB =      X11 Xau Xdmcp Xext c m xcb ${COMPILER_LIBCXX}
blob - 1bc5d5fc68a8e30b22fc4cb2b53a15feef903e03
blob + 9301340ac13838211c466a7a70615847ef6fe8be
--- games/xkobo/patches/patch-Imakefile
+++ games/xkobo/patches/patch-Imakefile
@@ -1,15 +1,16 @@
---- Imakefile.orig     Fri Jan 10 03:29:36 1997
-+++ Imakefile  Sun Oct  6 00:55:01 2002
+Index: Imakefile
+--- Imakefile.orig
++++ Imakefile
 @@ -6,7 +6,7 @@ WAIT_MSEC   = 30
  SHIPS       = 5
  
  /*  RECORDS  */
 -HSCORE_DIR  = /usr/local/games/xkobo-scores
-+HSCORE_DIR  = /var/games/xkobo.scores
++HSCORE_DIR  = .
  
  /*  C++ COMPILER  */
  /*  CXX         = g++  */
-@@ -69,15 +69,15 @@ xkp256.c: # xkp256.tif
+@@ -69,15 +69,10 @@ xkp256.c: # xkp256.tif
  
  #ifdef SECURE_SCOREFILES
  install::
@@ -18,11 +19,6 @@
 -      chown $(XKOBO_ADMINISTER) $(BINDIR)/xkobo
 -      chown -R $(XKOBO_ADMINISTER) $(HSCORE_DIR)
 -      chmod 4755 $(BINDIR)/xkobo
-+      if [ -d $(DESTDIR)$(HSCORE_DIR) ]; then chmod 575 
$(DESTDIR)$(HSCORE_DIR); \
-+      else mkdirhier $(DESTDIR)$(HSCORE_DIR); chmod 575 
$(DESTDIR)$(HSCORE_DIR); fi
-+      chgrp $(XKOBO_ADMINISTER) $(DESTDIR)$(BINDIR)/xkobo
-+      chgrp -R $(XKOBO_ADMINISTER) $(DESTDIR)$(HSCORE_DIR)
-+      chmod 2755 $(DESTDIR)$(BINDIR)/xkobo
  #else /* SECURE_SCOREFILES */
  install::
 -      if [ -d $(HSCORE_DIR) ]; then chmod 777 $(HSCORE_DIR); \
blob - /dev/null
blob + a98a6796ae0e7f0e30e35f9218fe97ddf01b7c16 (mode 644)
--- /dev/null
+++ games/xkobo/patches/patch-score_C
@@ -0,0 +1,56 @@
+Index: score.C
+--- score.C.orig
++++ score.C
+@@ -35,7 +35,7 @@ extern "C"{
+ #include "file.h"
+ 
+ int  _scorefile::highscore       = 0;
+-char _scorefile::save_path[1024];
++char _scorefile::save_path[1024] = "xkobo-scores";
+ char _scorefile::login_name[64];
+ 
+ class uint_little_endian {
+@@ -89,7 +89,6 @@ void _scorefile::init(int *highscorep, int *stagep)
+     else {
+         strcpy(login_name, pw->pw_name);
+     }
+-    sprintf(save_path, "%s/%u", XKOBO_SCORE_DIR, getuid());
+     if ((i=load_block(save_path, &tbl, sizeof(tbl))) < 0){
+         fprintf(stderr, "xkobo : (warning) can't read the score-file\n");
+     }
+@@ -128,7 +127,7 @@ void _scorefile::record(int new_score, int stage)
+ void _scorefile::show_high_scores(int to_stdout)
+ {
+     s_table tbl[SCORE_SAVE_MAX];
+-    char    path[1024];
++    char    path[1024] = "xkobo-scores";
+     int i, j;
+     for (i=0; i<SCORE_SAVE_MAX; i++){
+         tbl[i].score = 0;
+@@ -137,19 +136,16 @@ void _scorefile::show_high_scores(int to_stdout)
+     }
+ 
+     struct dirent *direntp;
+-    DIR           *dp;
+     struct stat st_buffer;
+-    dp = opendir(XKOBO_SCORE_DIR);
+-    if (dp == NULL) return;
+     i = 0;
+-    while ((direntp = readdir(dp)) != NULL){
+-        sprintf(path, "%s/%s", XKOBO_SCORE_DIR, direntp->d_name);
+-        if (stat(path, &st_buffer)) continue;
+-        if (!S_ISREG(st_buffer.st_mode)) continue;
+-        if (load_block(path, &tbl[i], sizeof(s_table)) < 0) continue;
+-        if ((++i) >= SCORE_SAVE_MAX) break;
++    if (!stat(path, &st_buffer)){
++        if (S_ISREG(st_buffer.st_mode)){
++            if (load_block(path, &tbl[i], sizeof(s_table)) >= 0){
++                i=1;
++            }
++        }
++        
+     }
+-    closedir(dp);
+ 
+     qsort(tbl, i, sizeof(s_table), 
+           (int (*)(const void *, const void *))s_table_cmp);
blob - ecdb02e98b7eb8323096de4163a5d4e42bd1d0b9
blob + 7bca76330ecef801bb5053d7c63b74d15c55caba
--- games/xkobo/pkg/PLIST
+++ games/xkobo/pkg/PLIST
@@ -1,9 +1,2 @@
-@extraunexec rm -rf /var/games/xkobo.scores/*
-@mode 2755
-@group games
-bin/xkobo
-@mode 575
-@sample /var/games/xkobo.scores/
-@mode
-@group
+@bin bin/xkobo
 @man man/man1/xkobo.1

Reply via email to