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 20:54:24 UTC

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

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

 ##########
 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:
   There are multiple places which call `AccountManagerImpl#buildACLSearchParameters` and all of them have `List<Long> permittedAccounts = new ArrayList<Long>();`. So technically there's no need to check for null or use `CollectionUtils`.

----------------------------------------------------------------
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