From patchwork Fri Nov 19 17:44:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 4848 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4HwkbD6cX3z3wcw for ; Fri, 19 Nov 2021 17:45:28 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Hwkb30lbfz39V; Fri, 19 Nov 2021 17:45:19 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Hwkb226DXz30H1; Fri, 19 Nov 2021 17:45:18 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Hwkb11Pcnz2ykC for ; Fri, 19 Nov 2021 17:45:17 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4Hwkb10Zzsz25; Fri, 19 Nov 2021 17:45:17 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1637343917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aZHqgmnLaxERZlt/FwFdurak2ydep0Y9ku7/3D/AXb8=; b=S0AF4TVMR8pSy+1qT9DyE92afLIgdnCdW9Q+zc2SvaHwHi/fiATXIVEohNvBFnkhFRiYoc 4bM18Bmp+cMt53Aw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1637343917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aZHqgmnLaxERZlt/FwFdurak2ydep0Y9ku7/3D/AXb8=; b=AXeSIKYJi9haL6bdwjQTZ+VAKbFy6uPwGgo3hfduoyxgWDyQwzxDyxVAFAyvOE4pCHOp3s 1jX3Vwou3+oITMUvb/0Px8MPJnkJOvqgzMSN0NghEJYalArTZb88kXF2Cyj0XGl0mWCPAA Q7FMDJ3+wzrkNNaSII+g2Qe0pkQk8BlEnPhVnTBCp429zK9iz2kKQe1WdiVF637aeWFAc9 an5mPrCTdO2XBZCQRXwPVismN818/LQ3zQsWG+48VGYN/RTQHtFVGv8C9EiRmK1SBEV/FC NgxNe1bgfl1G5z/2rp+NTz8ngTWnXav4PBv0kUOyUJChSg3FAIoAzDHu6CUrwQ== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 6/7] IPS: Do not try to show rules when stat on rules tarball fails Date: Fri, 19 Nov 2021 17:44:57 +0000 Message-Id: <20211119174458.789486-6-michael.tremer@ipfire.org> In-Reply-To: <20211119174458.789486-1-michael.tremer@ipfire.org> References: <20211119174458.789486-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" 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 85c5ddd86..4e8b28fd8 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();