From aa3ee531acb3800be5a266085d69853e2d49f353 Mon Sep 17 00:00:00 2001 From: Thibault Godouet Date: Sat, 13 Nov 2004 19:44:01 +0000 Subject: [PATCH] fix several security vulnerabilities found by iDEFENSE in fcronsighup (close fcron.allow and fcron.deny files after use) --- allow.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/allow.c b/allow.c index 20ab4c1..555712b 100644 --- a/allow.c +++ b/allow.c @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: allow.c,v 1.13 2003-12-25 22:52:55 thib Exp $ */ + /* $Id: allow.c,v 1.14 2004-11-13 19:44:01 thib Exp $ */ #include "fcrontab.h" @@ -56,12 +56,17 @@ in_file(char *str, char *file) continue; remove_blanks(start); - if ( strcmp(str, start) == 0 ) + if ( strcmp(str, start) == 0 ) { + fclose(f); return 1; - if ( strcmp(start, "all") == 0 ) + } + if ( strcmp(start, "all") == 0 ) { + fclose(f); return 2; + } } + fclose(f); /* if execution gets here, string is not in file */ return 0; -- 2.47.3