You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by nv...@apache.org on 2022/04/08 00:31:36 UTC

[cloudstack] branch main updated: api: Prevent modifying acl rules order for default ACLs (#6187)

This is an automated email from the ASF dual-hosted git repository.

nvazquez pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/main by this push:
     new c1c381fcd16 api: Prevent modifying acl rules order for default ACLs (#6187)
c1c381fcd16 is described below

commit c1c381fcd16ae9ed44e5bb47a18121ab4b2b534c
Author: Pearl Dsilva <pe...@gmail.com>
AuthorDate: Fri Apr 8 06:01:29 2022 +0530

    api: Prevent modifying acl rules order for default ACLs (#6187)
---
 server/src/main/java/com/cloud/network/vpc/NetworkACLServiceImpl.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/server/src/main/java/com/cloud/network/vpc/NetworkACLServiceImpl.java b/server/src/main/java/com/cloud/network/vpc/NetworkACLServiceImpl.java
index 53e113f9509..0b3d4a86a4e 100644
--- a/server/src/main/java/com/cloud/network/vpc/NetworkACLServiceImpl.java
+++ b/server/src/main/java/com/cloud/network/vpc/NetworkACLServiceImpl.java
@@ -1145,6 +1145,9 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
         }
         NetworkACLVO acl = _networkACLDao.findById(aclId);
         Vpc vpc = _entityMgr.findById(Vpc.class, acl.getVpcId());
+        if (vpc == null) {
+            throw new InvalidParameterValueException("Re-ordering rules for a default ACL is prohibited");
+        }
         Account caller = CallContext.current().getCallingAccount();
         _accountMgr.checkAccess(caller, null, true, vpc);
     }