are going to run setuid, then we can make the tmp file mode 600...
SCCS-vsn: games/sail/pl_1.c 1.2
char message[60];
int load = ROUND, ready = -30000;
int people = 0;
char message[60];
int load = ROUND, ready = -30000;
int people = 0;
register int n;
register int k;
struct stat Stat;
char *nameptr;
srand(pid = getpid());
register int n;
register int k;
struct stat Stat;
char *nameptr;
srand(pid = getpid());
initscr();
view = newwin(ROWSINVIEW, COLSINVIEW, 2, 1);
slot = newwin(ROWSINVIEW, 3, 2, 1+COLSINVIEW);
initscr();
view = newwin(ROWSINVIEW, COLSINVIEW, 2, 1);
slot = newwin(ROWSINVIEW, 3, 2, 1+COLSINVIEW);
exit(1);
}
sprintf(file, "/tmp/.%d", game);
exit(1);
}
sprintf(file, "/tmp/.%d", game);
- if (stat(file, &Stat) < 0 )
+ if (stat(file, &Stat) < 0 ) {
+#ifdef SETUID
+ omask = umask(077);
+#else
+ omask = umask(011);
+#endif
syncfile = fopen(file, "w+");
syncfile = fopen(file, "w+");
+ umask(omask);
+ } else {
syncfile = fopen(file, "r+");
people = 1;
}
syncfile = fopen(file, "r+");
people = 1;
}