From 3a01ccc550fb339f57129ed64fec3cf1f3e16ad3 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 18 Nov 2021 13:52:51 +0000 Subject: [PATCH] IPS: Do not try to show rules when stat on rules tarball fails Signed-off-by: Michael Tremer --- html/cgi-bin/ids.cgi | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index 85c5ddd866..4e8b28fd84 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -1091,13 +1091,14 @@ if (%idsrules) { # Call stat on the rulestarball. my $stat = stat("$IDS::rulestarball"); - # Get timestamp the file creation. - my $mtime = $stat->mtime; + if (defined $stat) { + # Get timestamp the file creation. + my $mtime = $stat->mtime; - # Convert into human read-able format. - my $rulesdate = strftime('%Y-%m-%d %H:%M:%S', localtime($mtime)); + # Convert into human read-able format. + my $rulesdate = strftime('%Y-%m-%d %H:%M:%S', localtime($mtime)); - &Header::openbox('100%', 'LEFT', "$Lang::tr{'intrusion detection system rules'} ($rulesdate)" ); + &Header::openbox('100%', 'LEFT', "$Lang::tr{'intrusion detection system rules'} ($rulesdate)" ); print"
\n"; @@ -1189,7 +1190,7 @@ if (%idsrules) { # Close display table print ""; -print < @@ -1198,7 +1199,8 @@ print < END ; - &Header::closebox(); + &Header::closebox(); + } } &Header::closebigbox(); -- 2.39.5