From 93ff791497e01bacdcd371d3fef33807df104918 Mon Sep 17 00:00:00 2001 From: prachi Date: Wed, 25 Jan 2012 18:17:53 -0800 Subject: [PATCH] Bug 13314 - acton-bet3:vmware/xen:fail to attach "VMware Tools Installer ISO" to instance Changes: - 'sameOwner' check cannot be used for ISO's - So need to make two access checks: See if caller has access to VM and ISO and also check if the VM's owner has access to the ISO. --- server/src/com/cloud/template/TemplateManagerImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java index 7c2be4793ae..ac9c203765b 100755 --- a/server/src/com/cloud/template/TemplateManagerImpl.java +++ b/server/src/com/cloud/template/TemplateManagerImpl.java @@ -1132,7 +1132,13 @@ public class TemplateManagerImpl implements TemplateManager, Manager, TemplateSe } //check permissions - _accountMgr.checkAccess(caller, null, true, iso, vm); + //check if caller has access to VM and ISO + //and also check if the VM's owner has access to the ISO. + + _accountMgr.checkAccess(caller, null, false, iso, vm); + + Account vmOwner = _accountDao.findById(vm.getAccountId()); + _accountMgr.checkAccess(vmOwner, null, false, iso, vm); State vmState = vm.getState(); if (vmState != State.Running && vmState != State.Stopped) {