public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
* [git.ipfire.org] IPFire 2.x development tree branch, master, updated. b76118c32ceb03b40945805e42bd7514f7007f1f
@ 2020-01-30 11:56 Michael Tremer
  0 siblings, 0 replies; only message in thread
From: Michael Tremer @ 2020-01-30 11:56 UTC (permalink / raw)
  To: ipfire-scm

[-- Attachment #1: Type: text/plain, Size: 3139 bytes --]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".

The branch, master has been updated
       via  b76118c32ceb03b40945805e42bd7514f7007f1f (commit)
      from  e2338aa7ef6936044b6782fdbdd6abc12738395c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b76118c32ceb03b40945805e42bd7514f7007f1f
Author: Arne Fitzenreiter <arne_f(a)ipfire.org>
Date:   Thu Jan 30 12:51:31 2020 +0100

    ids-functions.pl: Fix generating DNS_SERVERS
    
    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(a)ipfire.org>
    Signed-off-by: Arne Fitzenreiter <arne_f(a)ipfire.org>

-----------------------------------------------------------------------

Summary of changes:
 config/cfgroot/ids-functions.pl | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

Difference in files:
diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl
index 3cfe837db..186c39ac7 100644
--- a/config/cfgroot/ids-functions.pl
+++ b/config/cfgroot/ids-functions.pl
@@ -712,32 +712,18 @@ sub generate_dns_servers_file() {
 	my @nameservers = &General::get_nameservers();
 
 	# Format dns servers declaration.
-	my $line = "\"\[";
+	my $line = "";
 
 	# 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.
-		$line = "$line" . "!\$HOME_NET";
-
+		$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";
 
@@ -749,7 +735,7 @@ sub generate_dns_servers_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);


hooks/post-receive
--
IPFire 2.x development tree

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-30 11:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-30 11:56 [git.ipfire.org] IPFire 2.x development tree branch, master, updated. b76118c32ceb03b40945805e42bd7514f7007f1f Michael Tremer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox