1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-17 00:00:40 +00:00
freebsd-ports/games/golddig/files/patch-aa
Jean-Marc Zucconi 0a498f3afe Do not install makelev setuid root, so that nobody but root can edit files
in ${PREFIX}/. Users can still create levels in their directories if the file
name has a /.
Golddig is now setgid games so that it can update the score file (the file
is no more world writable)
2000-05-01 20:25:40 +00:00

27 lines
801 B
Plaintext

--- shared.c.orig Mon May 1 18:20:48 2000
+++ shared.c Mon May 1 18:25:28 2000
@@ -58,7 +58,7 @@
#include "bitmap/window.bits"
#include "bitmap/anti.bits"
-char *sprintf(); /* UNIX brain damage */
+/* char *sprintf(); /* UNIX brain damage */
/* All in and out movements except up */
#define NOUPBITS DLEAVE | LLEAVE | RLEAVE | HENTER | VENTER
@@ -316,8 +316,12 @@
/* Manufaction the file name by starting with the world name and */
/* appending the level number to it. */
- strcpy(filename,LIB);
- strcat(filename,"/");
+ if (strchr (worldname, '/'))
+ *filename = 0;
+ else {
+ strcpy(filename,LIB);
+ strcat(filename,"/");
+ }
strcat(filename,worldname);
sprintf(filename + strlen(filename),"%03d",levelnum);
/* Open level file for reading */