From owner-freebsd-bugs@FreeBSD.ORG Thu Nov 27 08:10:21 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2674016A4CE for ; Thu, 27 Nov 2003 08:10:21 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD76E43FD7 for ; Thu, 27 Nov 2003 08:10:18 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id hARGAIFY033809 for ; Thu, 27 Nov 2003 08:10:18 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id hARGAIHA033808; Thu, 27 Nov 2003 08:10:18 -0800 (PST) (envelope-from gnats) Resent-Date: Thu, 27 Nov 2003 08:10:18 -0800 (PST) Resent-Message-Id: <200311271610.hARGAIHA033808@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Vita Novy Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B373416A4CE for ; Thu, 27 Nov 2003 08:00:41 -0800 (PST) Received: from sofia.fio.cz (sf-wall.fio.cz [195.250.140.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0108143FD7 for ; Thu, 27 Nov 2003 08:00:35 -0800 (PST) (envelope-from rumik@fio.cz) Received: from vita.private.fio.cz (vita.private.fio.cz [10.0.4.41]) by sofia.fio.cz (8.12.8p2/8.12.8) with ESMTP id hARG0Svk072921 for ; Thu, 27 Nov 2003 17:00:28 +0100 (CET) (envelope-from rumik@fio.cz) Received: from vita.private.fio.cz (localhost [127.0.0.1]) by vita.private.fio.cz (8.12.9p2/8.12.8) with ESMTP id hARG0VTq074245 for ; Thu, 27 Nov 2003 17:00:31 +0100 (CET) (envelope-from rumik@vita.private.fio.cz) Received: (from rumik@localhost) by vita.private.fio.cz (8.12.9p2/8.12.9/Submit) id hARG0VWC074244; Thu, 27 Nov 2003 17:00:31 +0100 (CET) (envelope-from rumik) Message-Id: <200311271600.hARG0VWC074244@vita.private.fio.cz> Date: Thu, 27 Nov 2003 17:00:31 +0100 (CET) From: Vita Novy To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/59730: isdnd crashes with signal 11 if cannot create budget-callbacksfile X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Vita Novy List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Nov 2003 16:10:21 -0000 >Number: 59730 >Category: bin >Synopsis: isdnd crashes with signal 11 if cannot create budget-callbacksfile >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Nov 27 08:10:18 PST 2003 >Closed-Date: >Last-Modified: >Originator: Vita Novy >Release: FreeBSD 4.9-RELEASE i386 >Organization: >Environment: System: FreeBSD vita.private.fio.cz 4.9-RELEASE FreeBSD 4.9-RELEASE #13: Mon Nov 24 14:13:18 CET 2003 rumik@vita.private.fio.cz:/usr/src/sys/compile/VITA i386 >Description: isdnd crashes on signal 11 due to fclose(NULL) if budget-callbacksfile and/or budget-calloutsfile not exist and cannot be created. >How-To-Repeat: In /etc/isdn/isdnd.rc configure isdnd to place budget-callbacksfile to nonexistent directory and start isdnd. >Fix: --- usr.sbin/i4b/isdnd/rc_config.c.orig Tue Nov 25 17:06:37 2003 +++ usr.sbin/i4b/isdnd/rc_config.c Tue Nov 25 17:08:16 2003 @@ -453,18 +453,20 @@ DBGL(DL_RCCF, (log(LL_DBG, "entry %d: initializing budget-callbacksfile %s", entrycount, yylval.str))); fclose(fp); fp = fopen(yylval.str, "w"); - if(fp != NULL) + if(fp != NULL) { fprintf(fp, "%d %d %d", (int)time(NULL), (int)time(NULL), 0); - fclose(fp); + fclose(fp); + } } } else { DBGL(DL_RCCF, (log(LL_DBG, "entry %d: creating budget-callbacksfile %s", entrycount, yylval.str))); fp = fopen(yylval.str, "w"); - if(fp != NULL) + if(fp != NULL) { fprintf(fp, "%d %d %d", (int)time(NULL), (int)time(NULL), 0); - fclose(fp); + fclose(fp); + } } fp = fopen(yylval.str, "r"); @@ -513,9 +515,10 @@ { DBGL(DL_RCCF, (log(LL_DBG, "entry %d: creating budget-calloutsfile %s", entrycount, yylval.str))); fp = fopen(yylval.str, "w"); - if(fp != NULL) + if(fp != NULL) { fprintf(fp, "%d %d %d", (int)time(NULL), (int)time(NULL), 0); - fclose(fp); + fclose(fp); + } } fp = fopen(yylval.str, "r"); >Release-Note: >Audit-Trail: >Unformatted: