1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

feature #3175: Security Group 0 cannot be deleted

This commit is contained in:
Ruben S. Montero 2014-11-14 00:07:24 +01:00
parent b57ccf38ed
commit bf6eb1965c

View File

@ -379,6 +379,15 @@ int VirtualNetworkDelete::drop(int oid, PoolObjectSQL * object, string& error_ms
int SecurityGroupDelete::drop(int oid, PoolObjectSQL * object, string& error_msg)
{
if (object->get_oid() == 0)
{
error_msg = "The default security group (ID 0) cannot be deleted.";
object->unlock();
return -1;
}
SecurityGroup * sgroup = static_cast<SecurityGroup *>(object);
if ( sgroup->get_vms() > 0 )