From 457da8b0738d793ffa969b9687fe363f755e6c5e Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Thu, 26 Jan 2023 21:16:55 -0500 Subject: [PATCH 1/2] Use xCAT::Utils:CheckVersion to compare BIND versions without using the version.pm --- perl-xCAT/xCAT/Utils.pm | 2 +- xCAT-server/lib/xcat/plugins/ddns.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index aac6da437..bb3827a16 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -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]; diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index d1e6f1fff..693632c92 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -1286,7 +1286,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"; } From 786d271c5fc1a0998634904cd5f35249312aecb6 Mon Sep 17 00:00:00 2001 From: Wai Yee Wong Date: Fri, 27 Jan 2023 10:26:19 -0500 Subject: [PATCH 2/2] remove use version --- xCAT-server/lib/xcat/plugins/ddns.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index 693632c92..ab0414d88 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -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