Skip to content

Commit c8a0c40

Browse files
committed
CLOUDSTACK-2477: [GSLB] CloudStack currently allows admin to map LB rule
of one account to GSLB rule of a different account ensuring account id of GSLB rule and LB rule are same
1 parent 2b93969 commit c8a0c40

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ public boolean assignToGlobalLoadBalancerRule(AssignToGlobalLoadBalancerRuleCmd
204204

205205
_accountMgr.checkAccess(caller, null, true, loadBalancer);
206206

207+
if (gslbRule.getAccountId() != loadBalancer.getAccountId()) {
208+
throw new InvalidParameterValueException("GSLB rule and load balancer rule does not belong to same account");
209+
}
210+
207211
if (loadBalancer.getState() == LoadBalancer.State.Revoke) {
208212
throw new InvalidParameterValueException("Load balancer ID " + loadBalancer.getUuid() + " is in revoke state");
209213
}

0 commit comments

Comments
 (0)