mirror of https://github.com/apache/cloudstack.git
Explictly reject console-access request if it does not carry an access ticket, this usually happens in migration process while old console proxy is in use
This commit is contained in:
parent
f9133ecfdf
commit
74793925ed
|
|
@ -1247,8 +1247,13 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager,
|
|||
ConsoleAccessAuthenticationCommand cmd) {
|
||||
long vmId = 0;
|
||||
|
||||
String ticket = ConsoleProxyServlet.genAccessTicket(cmd.getHost(), cmd.getPort(), cmd.getSid(), cmd.getVmId());
|
||||
String ticketInUrl = cmd.getTicket();
|
||||
if(ticketInUrl == null) {
|
||||
s_logger.error("No access ticket found, you could be running an old console proxy. vmId: " + cmd.getVmId());
|
||||
return new ConsoleAccessAuthenticationAnswer(cmd, false);
|
||||
}
|
||||
|
||||
String ticket = ConsoleProxyServlet.genAccessTicket(cmd.getHost(), cmd.getPort(), cmd.getSid(), cmd.getVmId());
|
||||
if(!ticket.startsWith(ticketInUrl)) {
|
||||
s_logger.error("Access ticket expired or has been modified. vmId: " + cmd.getVmId());
|
||||
return new ConsoleAccessAuthenticationAnswer(cmd, false);
|
||||
|
|
|
|||
Loading…
Reference in New Issue