*/
#include <stdio.h>
+#include <unistd.h>
#include "rogue.h"
char login_name[MAX_OPT_LEN];
boolean passgo = 0;
char *error_file = "rogue.esave";
char *byebye_string = "Okay, bye bye!";
+gid_t gid, egid;
extern char *fruit;
extern char *save_file;
char *pn;
int seed;
+ gid = getgid();
+ egid = getegid();
+ setegid(gid);
pn = md_gln();
if ((!pn) || (strlen(pn) >= MAX_OPT_LEN)) {
clean_up("Hey! Who are you?");
md_lock(l)
boolean l;
{
+ extern gid_t gid, egid;
static int fd;
short tries;
if (l) {
+ setegid(egid);
if ((fd = open(_PATH_SCOREFILE, O_RDONLY)) < 1) {
+ setegid(gid);
message("cannot lock score file", 0);
return;
}
+ setegid(gid);
for (tries = 0; tries < 5; tries++)
if (!flock(fd, LOCK_EX|LOCK_NB))
return;
FILE *fp;
long s;
boolean pause = score_only;
+ extern gid_t gid, egid;
md_lock(1);
+ setegid(egid);
if ((fp = fopen(_PATH_SCOREFILE, "r+")) == NULL &&
(fp = fopen(_PATH_SCOREFILE, "w+")) == NULL) {
+ setegid(gid);
message("cannot read/write/create score file", 0);
sf_error();
}
+ setegid(gid);
rewind(fp);
(void) xxx(1);