From b6e70f22814c4c6a06534e1e685deeaf46b200aa Mon Sep 17 00:00:00 2001 From: Vijayendra Bhamidipati Date: Fri, 27 Jul 2012 15:15:32 -0700 Subject: [PATCH] CS-15217: Security: Malicious user is able to get the size of the cloud by enumerating IDs Description: New 3.0.x merge included a new instance of InvalidParameterValue exception being raised. Fixing it. --- server/src/com/cloud/network/NetworkManagerImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java index 9bb2ae3c147..805be6fa0bd 100755 --- a/server/src/com/cloud/network/NetworkManagerImpl.java +++ b/server/src/com/cloud/network/NetworkManagerImpl.java @@ -2528,8 +2528,8 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag _nicDao.expunge(nic.getId()); } } - - + + @Override public void checkVirtualNetworkCidrOverlap(Long zoneId, String cidr) { if (zoneId == null) { @@ -4668,13 +4668,13 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag idList.add(new IdentityProxy(networkOffering, networkOfferingId, "networkOfferingId")); throw new InvalidParameterValueException("Network offering with specified id is not in " + NetworkOffering.State.Enabled + " state, can't upgrade to it", idList); } - + //can't update from vpc to non-vpc network offering boolean forVpcNew = _configMgr.isOfferingForVpc(networkOffering); boolean vorVpcOriginal = _configMgr.isOfferingForVpc(_configMgr.getNetworkOffering(oldNetworkOfferingId)); if (forVpcNew != vorVpcOriginal) { String errMsg = forVpcNew ? "a vpc offering " : "not a vpc offering"; - throw new InvalidParameterValueException("Can't update as the new offering is " + errMsg); + throw new InvalidParameterValueException("Can't update as the new offering is " + errMsg, null); } //perform below validation if the network is vpc network