-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CLOUDSTACK-10175: prevent VPC list leakage #2352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
rafaelweingartner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@khos2ow thanks for the PR.
I have only one small comment in the code.
I also have one other question for you ,are you using the ApacheCloudStack code formatter?
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Coding+conventions
| 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()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and yes, I'm using the same code formatter (checked in the repo) in Eclipse and not the eclipse.epf.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
So, it seems that the code was not formatted properly before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say so.
|
@DaanHoogland @PaulAngus @rhtyd would you please review/merge this PR? |
|
@rhtyd Can you review this? |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1411 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-1823)
|
|
@khos2ow the test_deploy_virtio_scsi_vm related failures are new, rest are known issues and ignorable. can you check? |
|
@rhtyd yes I will. |
|
@khos2ow any update? |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1496 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-1931)
|
rohityadavcloud
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, code and test results.
|
Merged this based on two code review lgtms and test results (0 errors). |
This PR fixes the issue in which there's a leak when doing API call for listing VPC with domain account and projectId=-1.
Note for reviewers: The code formatting changed so many lines in the commit but the actual change is in line 2467-2471.