The configuration file has an invalid syntax which causes
suricata to fail to start.
There was no comma inserted between DNS servers when there
was more than two of them. This is now fixed in this patch..
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
my @nameservers = &General::get_nameservers();
# Format dns servers declaration.
my @nameservers = &General::get_nameservers();
# Format dns servers declaration.
# Check if the system has configured nameservers.
if (@nameservers) {
# Check if the system has configured nameservers.
if (@nameservers) {
- # Loop through the array of nameservers.
- foreach my $server (@nameservers) {
- # Add the DNS server to the line.
- $line = "$line" . "$server";
-
- # Check if the current DNS server was the last in the array.
- if ($server ne $nameservers[-1]) {
- # Add "," for the next DNS server.
- $line = "$line" . "\,";
- }
- }
+ $line = join(",", @nameservers);
} else {
# The responsible DNS servers on red are directly used, and because we are not able
# to specify each single DNS server address here, we currently have to thread each
# address which is not part of the HOME_NET as possible DNS server.
} else {
# The responsible DNS servers on red are directly used, and because we are not able
# to specify each single DNS server address here, we currently have to thread each
# address which is not part of the HOME_NET as possible DNS server.
- $line = "$line" . "!\$HOME_NET";
-
- # Close the line...
- $line = "$line" . "\]\"";
-
# Open file to store the used DNS server addresses.
open(FILE, ">$dns_servers_file") or die "Could not open $dns_servers_file. $!\n";
# Open file to store the used DNS server addresses.
open(FILE, ">$dns_servers_file") or die "Could not open $dns_servers_file. $!\n";
print FILE "#Autogenerated file. Any custom changes will be overwritten!\n";
# Print the generated DNS declaration to the file.
print FILE "#Autogenerated file. Any custom changes will be overwritten!\n";
# Print the generated DNS declaration to the file.
- print FILE "DNS_SERVERS:\t$line\n";
+ print FILE "DNS_SERVERS:\t\"[$line]\"\n";
# Close file handle.
close(FILE);
# Close file handle.
close(FILE);