From owner-freebsd-bugs Mon Dec 1 19:10:05 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id TAA18923 for bugs-outgoing; Mon, 1 Dec 1997 19:10:05 -0800 (PST) (envelope-from owner-freebsd-bugs) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id TAA18912; Mon, 1 Dec 1997 19:10:02 -0800 (PST) (envelope-from gnats) Resent-Date: Mon, 1 Dec 1997 19:10:02 -0800 (PST) Resent-Message-Id: <199712020310.TAA18912@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, garbanzo@hooked.net Received: (from nobody@localhost) by hub.freebsd.org (8.8.7/8.8.7) id TAA18188; Mon, 1 Dec 1997 19:00:59 -0800 (PST) (envelope-from nobody) Message-Id: <199712020300.TAA18188@hub.freebsd.org> Date: Mon, 1 Dec 1997 19:00:59 -0800 (PST) From: garbanzo@hooked.net To: freebsd-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: www-1.0 Subject: misc/5187: phantasia will segfault if it can't open certian files Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 5187 >Category: misc >Synopsis: phantasia will segfault if it can't open certian files >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Dec 1 19:10:01 PST 1997 >Last-Modified: >Originator: Alex >Organization: >Release: 3.0-current >Environment: FreeBSD zippy.dyn.ml.org 3.0-CURRENT FreeBSD 3.0-CURRENT #0: Mon Dec 1 00:29:42 PST 1997 root@zippy.dyn.ml.org:/usr/src/sys/compile/ZIPPY i386 >Description: When phantasia is run, it expects to have access to various /var/games/phantasia files, if it doesn't it calls a function to theoretically shut itself down nicely. However that function doesn't check to see if the fds it's fclosing are open or not. >How-To-Repeat: Run phantasia as a user that doesn't have read or write access to /var/games. >Fix: *** main.c.orig Mon Dec 1 18:59:03 1997 --- main.c Mon Dec 1 18:59:32 1997 *************** *** 1277,1286 **** endwin(); } ! fclose(Playersfp); ! fclose(Monstfp); ! fclose(Messagefp); ! fclose(Energyvoidfp); if (doexit) exit(0); --- 1277,1290 ---- endwin(); } ! if (Playersfp) ! fclose(Playersfp); ! if (Monstfp) ! fclose(Monstfp); ! if (Messagefp) ! fclose(Messagefp); ! if (Energyvoidfp) ! fclose(Energyvoidfp); if (doexit) exit(0); >Audit-Trail: >Unformatted: