From patchwork Tue Apr 9 04:02:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2189 Return-Path: Received: from mail01.ipfire.org (mail01.i.ipfire.org [172.28.1.200]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail01.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web07.i.ipfire.org (Postfix) with ESMTPS id E8CA988E621 for ; Mon, 8 Apr 2019 19:03:01 +0100 (BST) Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 44dJDh5vWmz52pLc; Mon, 8 Apr 2019 19:03:00 +0100 (BST) Received: from tuxedo.stevee (212095005041.public.telering.at [212.95.5.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 44dJDf0xNgz52pLc; Mon, 8 Apr 2019 19:02:58 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201904rsa; t=1554746578; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=MArYW4l6dMuGn9Lw1cp3GFWVh0b3wsK81EvhXuqHq34=; b=ZcKh0GdKKBYLQJ3JDuMIjl6GeYJd4037W+NZPedxUsdWLw9rZ9ei96Vxqi8kZL5/pM228E K7WwPFdgUKYO4xXIJ/GncnLNOuGqpfEEF7M2Zsxc7ZLge01lt+gYF9wQaA8V3rkknkvHAD ki7ZABOaNGekZNCKtekXv1VdfpC5b7NknTPWYFTOlmHP7ydfB0gfOX+Sm73brhUx2Ydevp MN24Wrjj3i3HevCJhfTNPYQwYmOLD8k0ki4Puh09rZyQYaGBJN0+xp5ctlW2z7IMws0Qqx BSx8rmA5WudHf4qoOBKZqgOWM15EG3rOZorGTYxG6C1YPRLTu0tjJbMXMcCAlA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=201904ed25519; t=1554746578; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=MArYW4l6dMuGn9Lw1cp3GFWVh0b3wsK81EvhXuqHq34=; b=78c0fIdpsL1IkfpT8aIN7fUTKo4TKid5uhcFjionG5Yrk16uWJj84Kt0+yoWu05wNV/wX0 d9pg7TYsrHegtiBA== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH] convert-snort: Fix logic for detecting enough free disk space. Date: Mon, 8 Apr 2019 20:02:53 +0200 Message-Id: <20190408180253.5394-1-stefan.schantl@ipfire.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.auth=stevee smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" The subfunction only will return something if the check fails - so the logic of the if statement was wrong set and the downloader only was called if this check failed and to less diskspace would be available. Signed-off-by: Stefan Schantl --- config/suricata/convert-snort | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/suricata/convert-snort b/config/suricata/convert-snort index ca650b149..19aa38fbc 100644 --- a/config/suricata/convert-snort +++ b/config/suricata/convert-snort @@ -231,6 +231,9 @@ if (-f $snort_rules_tarball) { } else { # Check if enought disk space is available. if(&IDS::checkdiskspace()) { + # Print error message. + print "Could not download ruleset - Not enough free diskspace available.\n"; + } else { # Call the download function and grab the new ruleset. &IDS::downloadruleset(); }