dns.cgi: Fix handling of WARNINGs from kdig

There might be multiple warnings which must all be shown
to the user.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2020-01-07 14:41:13 +00:00
parent 71471d9bde
commit 984f14bdc4

View File

@@ -795,10 +795,6 @@ sub check_nameserver($$$$) {
my $output = join("", @output);
my $status = 0;
if ($output =~ m/WARNING: (.*)/) {
return $1;
}
if ($output =~ m/status: (\w+)/) {
$status = ($1 eq "NOERROR");
@@ -806,6 +802,18 @@ sub check_nameserver($$$$) {
if (!$status) {
return -1;
}
} else {
my $warning;
while ($output =~ m/WARNING: (.*)/g) {
# Add the current grabbed warning to the warning string.
$warning .= "$1\; ";
}
# Return the warning string, if we grabbed at least one.
if ($warning) {
return $warning;
}
}
my @flags = ();