Skip to content

Commit

Permalink
Merge pull request #7320 from peterwywong/ddns
Browse files Browse the repository at this point in the history
Use xCAT::Utils:CheckVersion to compare BIND versions without using version.pm
  • Loading branch information
besawn committed Jan 31, 2023
2 parents 730cafb + 786d271 commit 4b221d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion perl-xCAT/xCAT/Utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2201,7 +2201,7 @@ sub CheckVersion
my $index = 0;
my $max_index = ($len_a > $len_b) ? $len_a : $len_b;

for ($index = 0 ; $index <= $max_index ; $index++)
for ($index = 0 ; $index < $max_index ; $index++)
{
my $val_a = ($len_a < $index) ? 0 : $a[$index];
my $val_b = ($len_b < $index) ? 0 : $b[$index];
Expand Down
3 changes: 1 addition & 2 deletions xCAT-server/lib/xcat/plugins/ddns.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use xCAT::SvrUtils;
use Socket;
use Fcntl qw/:flock/;
use Data::Dumper;
use version;

# This is a rewrite of DNS management using nsupdate rather than
# direct zone mangling
Expand Down Expand Up @@ -1286,7 +1285,7 @@ sub update_namedconf {
my $bind_version_cmd="/usr/sbin/named -v | cut -d' ' -f2 | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+'";
my @bind_version =xCAT::Utils->runcmd($bind_version_cmd, 0);
# Turn off DNSSEC if running with bind vers 9.16.6 or higher
if ((scalar @bind_version > 0) && (version->parse($bind_version[0]) >= version->parse(9.16.6))) {
if ((scalar @bind_version > 0) && (xCAT::Utils::CheckVersion($bind_version[0], "9.16.6") >= 0)) {
push @newnamed, "\tdnssec-enable no;\n";
push @newnamed, "\tdnssec-validation no;\n";
}
Expand Down

0 comments on commit 4b221d5

Please sign in to comment.