mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-10 02:55:55 +02:00
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:
@@ -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 = ();
|
||||
|
||||
Reference in New Issue
Block a user