Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Nov 2003 17:00:31 +0100 (CET)
From:      Vita Novy <vita@fio.cz>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/59730: isdnd crashes with signal 11 if cannot create budget-callbacksfile
Message-ID:  <200311271600.hARG0VWC074244@vita.private.fio.cz>
Resent-Message-ID: <200311271610.hARGAIHA033808@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200311271600.hARG0VWC074244>