From fe112cf8eaec6d308cd45023fd76ce150b981bcc Mon Sep 17 00:00:00 2001 From: mellor Date: Thu, 18 Nov 2010 02:14:21 +0000 Subject: [PATCH] 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 --- xCAT-server/lib/xcat/plugins/rollupdate.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/rollupdate.pm b/xCAT-server/lib/xcat/plugins/rollupdate.pm index a323835bc..9567af377 100644 --- a/xCAT-server/lib/xcat/plugins/rollupdate.pm +++ b/xCAT-server/lib/xcat/plugins/rollupdate.pm @@ -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