From e8759accfcfa3deafdd13fa68e1593663132252d Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Sat, 14 Dec 2019 10:03:09 -0500 Subject: [PATCH] Remove load from file in noderange support The feature cannot be practically done in a secure fashion, and is not widely reported to be used. --- perl-xCAT/xCAT/NodeRange.pm | 17 +---------------- xCAT-client/pods/man3/noderange.3.pod | 23 ++++------------------- 2 files changed, 5 insertions(+), 35 deletions(-) diff --git a/perl-xCAT/xCAT/NodeRange.pm b/perl-xCAT/xCAT/NodeRange.pm index e28bac035..63edd20bb 100644 --- a/perl-xCAT/xCAT/NodeRange.pm +++ b/perl-xCAT/xCAT/NodeRange.pm @@ -666,22 +666,7 @@ sub noderange { if ($atom eq '') { next; } if ($atom =~ /^\^(.*)$/) { # get a list of nodes from a file - open(NRF, $1); - while () { - my $line = $_; - unless ($line =~ m/^[\^#]/) { - $line =~ m/^([^: ]*)/; - my $newrange = $1; - chomp($newrange); - $recurselevel++; - my @filenodes = noderange($newrange, $verify, $exsitenode, %options); - foreach (@filenodes) { - $nodes{$_} = 1; - } - } - } - close(NRF); - next; + die "Read from file is no longer supported"; } my %newset = map { $_ => 1 } expandatom($atom, $verify, %options); # expand the atom and make each entry in the resulting array a key in newset diff --git a/xCAT-client/pods/man3/noderange.3.pod b/xCAT-client/pods/man3/noderange.3.pod index aa8a6a4b6..57570ef50 100644 --- a/xCAT-client/pods/man3/noderange.3.pod +++ b/xCAT-client/pods/man3/noderange.3.pod @@ -20,8 +20,6 @@ I /node.* - ^/tmp/nodes - node10+5 10-15,-13 @@ -40,7 +38,7 @@ If you invoke xCAT B from a shell you may need to quote the B if the shell would otherwise treat the punctuation marks in the B as control operators. The affected punctuation marks may include Asterisk (`*'), Left Square Bracket (`[') , Right Square Bracket -(`]'), Circumflex Accent (`^'), and Overline (`~'). +(`]'), and Overline (`~'). B is a comma-separated list. Each token (text between commas) in the list can be any of the forms listed below: @@ -84,25 +82,12 @@ A regular expression match of nodes or groups: The path of a file containing noderanges of nodes or groups: - ^/tmp/nodelist - -where /tmp/nodelist can contain entries like: - - #my node list (this line ignored) - ^/tmp/foo #ignored - node01 #node comment - node02 - node03 - node10-node20 - /group[456].* - -node50 - Node ranges can contain any combination: - node01-node30,node40,^/tmp/nodes,/node[13].*,2-10,node50+5 + node01-node30,node40,/node[13].*,2-10,node50+5 Any individual B may be prefixed with an exclusion operator -(default -) with the exception of the file operator (default ^). This will cause +(default -). This will cause that individual noderange to be subtracted from the total resulting list of nodes. The intersection operator @ calculates the intersection of the left and @@ -240,7 +225,7 @@ Generate a list of nodes in the 1st two frames: =head1 B The special characters used by xCAT B are also special characters -to many shell programs. In particular, the characters `*', `[', `]', `^', +to many shell programs. In particular, the characters `*', `[', `]', and `~' may have to be escaped from the shell. =head1 B