From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arne Fitzenreiter To: ipfire-scm@lists.ipfire.org Subject: [git.ipfire.org] IPFire 2.x development tree branch, core141, updated. f2d2c69787acc8ad3383d7482a15f0f8857f57ff Date: Thu, 30 Jan 2020 12:26:04 +0000 Message-ID: <487fhr3cm6z2yXP@people01.haj.ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4507391785932735200==" List-Id: --===============4507391785932735200== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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, core141 has been updated via f2d2c69787acc8ad3383d7482a15f0f8857f57ff (commit) via c75fd8c8c5638581b180abbd68ce8fc168b3bd1e (commit) via ccf83df93c8d7fedaaf8283880164ce12dd96bc3 (commit) via e8adbea97beb1107a48b3f804143e11ebf6228bb (commit) via 99cadb743af795134733ce2e229e53c3c0e7359b (commit) via b76118c32ceb03b40945805e42bd7514f7007f1f (commit) from 83165259b1db395e2bfecef0b584055583b7d99a (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 f2d2c69787acc8ad3383d7482a15f0f8857f57ff Author: Arne Fitzenreiter Date: Thu Jan 30 12:24:24 2020 +0000 dns.cgi: increase timeout to 5s =20 Signed-off-by: Arne Fitzenreiter commit c75fd8c8c5638581b180abbd68ce8fc168b3bd1e Author: Arne Fitzenreiter Date: Thu Jan 30 12:22:37 2020 +0000 convert-dns-settings: add ppp/settings to list of converted files =20 Signed-off-by: Arne Fitzenreiter commit ccf83df93c8d7fedaaf8283880164ce12dd96bc3 Merge: e8adbea97 83165259b Author: Arne Fitzenreiter Date: Thu Jan 30 12:20:46 2020 +0000 Merge branch 'core141' commit e8adbea97beb1107a48b3f804143e11ebf6228bb Author: Arne Fitzenreiter Date: Thu Jan 30 13:13:46 2020 +0100 general-functions.pl: Return unique list of nameservers =20 Signed-off-by: Arne Fitzenreiter commit 99cadb743af795134733ce2e229e53c3c0e7359b Author: Arne Fitzenreiter Date: Thu Jan 30 13:07:01 2020 +0100 ids-functions.pl: Fall back to $EXTERNAL_NET for DNS servers =20 When no DNS servers are configured (aka recursor mode), the DNS servers that unbound will try to contact can be anywhere. =20 Signed-off-by: Arne Fitzenreiter commit b76118c32ceb03b40945805e42bd7514f7007f1f Author: Arne Fitzenreiter Date: Thu Jan 30 12:51:31 2020 +0100 ids-functions.pl: Fix generating DNS_SERVERS =20 The configuration file has an invalid syntax which causes suricata to fail to start. =20 There was no comma inserted between DNS servers when there was more than two of them. This is now fixed in this patch.. =20 Signed-off-by: Michael Tremer Signed-off-by: Arne Fitzenreiter ----------------------------------------------------------------------- Summary of changes: config/cfgroot/general-functions.pl | 5 ++++- config/cfgroot/ids-functions.pl | 25 ++++--------------------- html/cgi-bin/dns.cgi | 2 +- src/scripts/convert-dns-settings | 1 + 4 files changed, 10 insertions(+), 23 deletions(-) Difference in files: diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-fun= ctions.pl index 448f4c635..41a0eac2d 100644 --- a/config/cfgroot/general-functions.pl +++ b/config/cfgroot/general-functions.pl @@ -29,6 +29,9 @@ $General::adminmanualurl =3D 'http://wiki.ipfire.org'; =20 require "${General::swroot}/network-functions.pl"; =20 +# Function to remove duplicates from an array +sub uniq { my %seen; grep !$seen{$_}++, @_ } + # # log ("message") use default 'ipcop' tag # log ("tag","message") use your tag @@ -1255,7 +1258,7 @@ sub get_nameservers () { } =20 # Return the array. - return @nameservers; + return &uniq(@nameservers); } =20 1; diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl index 3cfe837db..af8a927e0 100644 --- a/config/cfgroot/ids-functions.pl +++ b/config/cfgroot/ids-functions.pl @@ -712,32 +712,15 @@ sub generate_dns_servers_file() { my @nameservers =3D &General::get_nameservers(); =20 # Format dns servers declaration. - my $line =3D "\"\["; + my $line =3D ""; =20 # 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 =3D "$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 =3D "$line" . "\,"; - } - } + $line =3D 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 thr= ead each - # address which is not part of the HOME_NET as possible DNS server. - $line =3D "$line" . "!\$HOME_NET"; - + $line =3D "\$EXTERNAL_NET"; } =20 - # Close the line... - $line =3D "$line" . "\]\""; - # Open file to store the used DNS server addresses. open(FILE, ">$dns_servers_file") or die "Could not open $dns_servers_file. = $!\n"; =20 @@ -749,7 +732,7 @@ sub generate_dns_servers_file() { print FILE "#Autogenerated file. Any custom changes will be overwritten!\n"; =20 # Print the generated DNS declaration to the file. - print FILE "DNS_SERVERS:\t$line\n"; + print FILE "DNS_SERVERS:\t\"[$line]\"\n"; =20 # Close file handle. close(FILE); diff --git a/html/cgi-bin/dns.cgi b/html/cgi-bin/dns.cgi index 3b47f5ed4..4f3418a70 100755 --- a/html/cgi-bin/dns.cgi +++ b/html/cgi-bin/dns.cgi @@ -434,7 +434,7 @@ sub show_nameservers () { # # Simple send a request to unbound and check if it can resolve the # DNS test server. - my $dns_status_ret =3D &check_nameserver("127.0.0.1", "$dns_test_server", "= UDP", undef, "+timeout=3D1", "+retry=3D0"); + my $dns_status_ret =3D &check_nameserver("127.0.0.1", "$dns_test_server", "= UDP", undef, "+timeout=3D5", "+retry=3D0"); =20 if ($dns_status_ret eq "2") { $dns_status_string =3D "$Lang::tr{'working'}"; diff --git a/src/scripts/convert-dns-settings b/src/scripts/convert-dns-setti= ngs index 11efc7cba..945a15ef0 100755 --- a/src/scripts/convert-dns-settings +++ b/src/scripts/convert-dns-settings @@ -22,6 +22,7 @@ FILES=3D( /var/ipfire/ethernet/settings /var/ipfire/dns/settings + /var/ipfire/ppp/settings /var/ipfire/ppp/settings-* ) =20 hooks/post-receive -- IPFire 2.x development tree --===============4507391785932735200==--