commit 4b918ad597cd65d202e7c3672bd46f7c719aaf6f from: Markus Uhlin date: Tue Sep 2 20:32:17 2025 UTC wild_update: fixed file created without restricting permissions commit - aa39acdc978d8199edea8ac17c3347d97366e759 commit + 4b918ad597cd65d202e7c3672bd46f7c719aaf6f blob - 15db79837568b7a2cd176788dec7bd02c81598d5 blob + 5593ba63bbfba5c03c51cf5589d91c6b44e2c4e6 --- FICS/board.c +++ FICS/board.c @@ -1322,13 +1322,18 @@ wild_update(int style) { FILE *fp; char fname[MAX_FILENAME_SIZE + 1]; + int fd; int onPiece; msnprintf(fname, sizeof fname, "%s/wild/%d", board_dir, style); - if ((fp = fopen(fname, "w")) == NULL) { + if ((fd = open(fname, g_open_flags[1], g_open_modes)) < 0) { warn("%s: can't write file name: %s", __func__, fname); return; + } else if ((fp = fdopen(fd, "w")) == NULL) { + warn("%s: can't write file name: %s", __func__, fname); + close(fd); + return; } fprintf(fp, "W:");