From 0130e0d1e1168581ac3bc90d8773d968b1b5c4eb Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Wed, 31 Mar 2021 12:21:41 +0200 Subject: [PATCH] ids-functions.pl: Rework oinkmaster() to use get_enabled_providers function. Signed-off-by: Stefan Schantl --- config/cfgroot/ids-functions.pl | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl index 9424ce567f..98df831d9a 100644 --- a/config/cfgroot/ids-functions.pl +++ b/config/cfgroot/ids-functions.pl @@ -549,32 +549,17 @@ sub oinkmaster () { # Load perl module for file copying. use File::Copy; - # Hash to store the used providers. - my %used_providers = (); - - # Array to store the enabled providers. - my @enabled_providers = (); - # Check if the files in rulesdir have the correct permissions. &_check_rulesdir_permissions(); # Cleanup the rules directory before filling it with the new rulests. &_cleanup_rulesdir(); - # Read-in the providers config file. - &General::readhasharray("$providers_settings_file", \%used_providers); - - # Loop through the hash of used_providers. - foreach my $id (keys %used_providers) { - # Skip disabled providers. - next unless ($used_providers{$id}[3] eq "enabled"); - - # Grab the provider handle. - my $provider = "$used_providers{$id}[0]"; - - # Add the provider handle to the array of enabled providers. - push(@enabled_providers, $provider); + # Get all enabled providers. + my @enabled_provides = &get_enabled_providers(); + # Loop through the array of enabled providers. + foreach my $provider (@enabled_providers) { # Omit the type (dl_type) of the stored ruleset. my $type = $IDS::Ruleset::Providers{$provider}{'dl_type'}; -- 2.39.2