From: Michael Tremer Date: Fri, 19 Nov 2021 17:44:57 +0000 (+0000) Subject: IPS: Do not try to show rules when stat on rules tarball fails X-Git-Tag: v2.27-core162~56 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9268cddfd284f82df51fd76c48b1810f5980620e;p=ipfire-2.x.git IPS: Do not try to show rules when stat on rules tarball fails Signed-off-by: Michael Tremer --- 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();