Summary: Prevent deletion of wrong iptables rules

Detail: A grep in security_group.py wasn't defined well enough, could
potentially delete rules for VMs other than intended

BUG-ID: CLOUDSTACK-309
Bugfix-for: master
Reviewed-by:
Reported-by: Francois Scala
Signed-off-by: John Kinsella <jlk@stratosec.co> 1363222521 -0700
This commit is contained in:
John Kinsella 2013-03-13 17:54:50 -07:00
parent 381f737e64
commit 1079d63b6f

View File

@ -344,7 +344,7 @@ def post_default_network_rules(vm_name, vm_id, vm_ip, vm_mac, vif, brname, dhcpS
def delete_rules_for_vm_in_bridge_firewall_chain(vmName):
vm_name = vmName
if vm_name.startswith('i-') or vm_name.startswith('r-'):
vm_name = '-'.join(vm_name.split('-')[:-1])
vm_name = '-'.join(vm_name.split('-')[:-1]) + "-def"
vmchain = vm_name