add the option check for litefile

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14795 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
daniceexi 2013-01-08 06:31:40 +00:00
parent e39dd3b483
commit 028c57b77f

View File

@ -257,6 +257,13 @@ sub process_request {
# the directory/file in litefile table must be the absolute path ("/***")
foreach my $entry (@$listNew) {
my @tmp = split (/\s+/, $entry);
# check the validity of the option
if ($tmp[1] !~ /^(tmpfs|persistent|localdisk|rw|ro|con|link|tmpfs,rw|link,ro|link,persistent|link,con)$/) {
$callback->({error=>[qq{ $tmp[2] has invalid option. The valid options: tmpfs persistent localdisk rw ro con link tmpfs,rw link,ro link,persistent link,con}], errorcode=>[1]});
return;
}
unless ($tmp[2] =~ m{^/}) {
$callback->({error=>[qq{ $tmp[2] is not one absolute path. }], errorcode=>[1]});
return;