mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-26 10:52:57 +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 $output = join("", @output);
|
||||||
|
|
||||||
my $status = 0;
|
my $status = 0;
|
||||||
if ($output =~ m/WARNING: (.*)/) {
|
|
||||||
return $1;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($output =~ m/status: (\w+)/) {
|
if ($output =~ m/status: (\w+)/) {
|
||||||
$status = ($1 eq "NOERROR");
|
$status = ($1 eq "NOERROR");
|
||||||
@@ -806,6 +802,18 @@ sub check_nameserver($$$$) {
|
|||||||
if (!$status) {
|
if (!$status) {
|
||||||
return -1;
|
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 = ();
|
my @flags = ();
|
||||||
|
|||||||
Reference in New Issue
Block a user