]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
ids-functions.pl: Remove read_enabled_disabled_sids_file() function.
authorStefan Schantl <stefan.schantl@ipfire.org>
Fri, 15 Apr 2022 04:02:49 +0000 (06:02 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Fri, 15 Apr 2022 04:02:49 +0000 (06:02 +0200)
Not longer needed and therefore dead code.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
config/cfgroot/ids-functions.pl

index 8e1137ce01ab3363b3242e3db93a738ab88e3c66..c916926de7f41bbecb75c487abd848d343b96239 100644 (file)
@@ -1077,57 +1077,6 @@ sub drop_dl_rulesfile ($) {
        }
 }
 
-#
-## Function to read-in the given enabled or disables sids file.
-#
-sub read_enabled_disabled_sids_file($) {
-       my ($file) = @_;
-
-       # Temporary hash to store the sids and their state. It will be
-       # returned at the end of this function.
-       my %temphash;
-
-       # Open the given filename.
-       open(FILE, "$file") or die "Could not open $file. $!\n";
-
-       # Loop through the file.
-       while(<FILE>) {
-               # Remove newlines.
-               chomp $_;
-
-               # Skip blank lines.
-               next if ($_ =~ /^\s*$/);
-
-               # Skip coments.
-               next if ($_ =~ /^\#/);
-
-               # Splitt line into sid and state part.
-               my ($state, $sid) = split(" ", $_);
-
-               # Skip line if the sid is not numeric.
-               next unless ($sid =~ /\d+/ );
-
-               # Check if the sid was enabled.
-               if ($state eq "enablesid") {
-                       # Add the sid and its state as enabled to the temporary hash.
-                       $temphash{$sid} = "enabled";
-               # Check if the sid was disabled.
-               } elsif ($state eq "disablesid") {
-                       # Add the sid and its state as disabled to the temporary hash.
-                       $temphash{$sid} = "disabled";
-               # Invalid state - skip the current sid and state.
-               } else {
-                       next;
-               }
-       }
-
-       # Close filehandle.
-       close(FILE);
-
-       # Return the hash.
-       return %temphash;
-}
-
 #
 ## Function to check if the IDS is running.
 #