public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
From: Michael Tremer <git@ipfire.org>
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, master, updated. b76118c32ceb03b40945805e42bd7514f7007f1f
Date: Thu, 30 Jan 2020 11:56:32 +0000	[thread overview]
Message-ID: <487f2n0dn6z2yXP@people01.haj.ipfire.org> (raw)

[-- 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

                 reply	other threads:[~2020-01-30 11:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=487f2n0dn6z2yXP@people01.haj.ipfire.org \
    --to=git@ipfire.org \
    --cc=ipfire-scm@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox