You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2017/12/06 19:37:46 UTC

[GitHub] rafaelweingartner commented on a change in pull request #2352: CLOUDSTACK-10175: prevent VPC list leakage

rafaelweingartner commented on a change in pull request #2352: CLOUDSTACK-10175: prevent VPC list leakage
URL: https://github.com/apache/cloudstack/pull/2352#discussion_r155338301
 
 

 ##########
 File path: server/src/com/cloud/user/AccountManagerImpl.java
 ##########
 @@ -2472,6 +2464,11 @@ public void buildACLSearchParameters(Account caller, Long id, String accountName
                 if (projectId.longValue() == -1) {
                     if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL) {
                         permittedAccounts.addAll(_projectMgr.listPermittedProjectAccounts(caller.getId()));
+
+                        //permittedAccounts can be empty when the caller is not a part of any project (a domain account)
+                        if (permittedAccounts.isEmpty()) {
 
 Review comment:
   Is it possible for this `permittedAccounts`  be null?
   If not, the code is ok, otherwise it might be a good idea to use `CollectionUtils.isEmpty`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services