-/* $NetBSD: main.c,v 1.7 1999/09/08 21:45:27 jsm Exp $ */
+/* $NetBSD: main.c,v 1.10 2000/05/08 07:56:03 mycroft Exp $ */
/*
* Copyright (c) 1994
#if 0
static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: main.c,v 1.7 1999/09/08 21:45:27 jsm Exp $");
+__RCSID("$NetBSD: main.c,v 1.10 2000/05/08 07:56:03 mycroft Exp $");
#endif
#endif /* not lint */
"%3d %-6s"
};
+ /* Revoke setgid privileges */
+ setgid(getgid());
+
color = curmove = 0;
prog = strrchr(argv[0], '/');
ask("save file name? ");
(void)getline(buf, sizeof(buf));
if ((fp = fopen(buf, "w")) == NULL) {
- log("cannot create save file");
+ glog("cannot create save file");
goto getinput;
}
for (i = 0; i < movenum - 1; i++)
}
if (curmove != RESIGN &&
board[curmove].s_occ != EMPTY) {
- log("Illegal move");
+ glog("Illegal move");
goto getinput;
}
}
}
if (interactive) {
sprintf(fmtbuf, fmt[color], movenum, stoc(curmove));
- log(fmtbuf);
+ glog(fmtbuf);
}
if ((i = makemove(color, curmove)) != MOVEOK)
break;
ask("save file name? ");
(void)getline(buf, sizeof(buf));
if ((fp = fopen(buf, "w")) == NULL) {
- log("cannot create save file");
+ glog("cannot create save file");
goto replay;
}
for (i = 0; i < movenum - 1; i++)
}
void
-log(str)
+glog(str)
const char *str;
{