defect 3106074: fix rollupdate policy table check

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8200 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
mellor 2010-11-18 02:14:21 +00:00
parent 0e0c5d3da5
commit fe112cf8ea

View File

@ -1163,10 +1163,13 @@ sub check_policy {
foreach my $rule (@$policies) {
if ( $rule->{name} &&
(($rule->{name} eq "*") || ($rule->{name} eq $userid)) ) {
if ( $rule->{commands} &&
(($rule->{commands} eq "*") || ($rule->{commands} =~ /$xcatcmd/)) ){
return 0; # match found
}
if ( $rule->{commands} ) {
if (($rule->{commands} eq "") || ($rule->{commands} eq "*") || ($rule->{commands} =~ /$xcatcmd/) ){
return 0; # match found
}
} else {
return 0; # default match if commands is unset
}
}
}
return 1; # no match found