Skip to content

Commit 93ff791

Browse files
author
prachi
committed
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.
1 parent e6f6437 commit 93ff791

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎server/src/com/cloud/template/TemplateManagerImpl.java‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,13 @@ public boolean attachIso(long isoId, long vmId) {
11321132
}
11331133

11341134
//check permissions
1135-
_accountMgr.checkAccess(caller, null, true, iso, vm);
1135+
//check if caller has access to VM and ISO
1136+
//and also check if the VM's owner has access to the ISO.
1137+
1138+
_accountMgr.checkAccess(caller, null, false, iso, vm);
1139+
1140+
Account vmOwner = _accountDao.findById(vm.getAccountId());
1141+
_accountMgr.checkAccess(vmOwner, null, false, iso, vm);
11361142

11371143
State vmState = vm.getState();
11381144
if (vmState != State.Running && vmState != State.Stopped) {

0 commit comments

Comments
 (0)