Tomas Jelinek has uploaded a new change for review.

Change subject: userportal: error flow of RDP RdpPluginImpl broken
......................................................................

userportal: error flow of RDP RdpPluginImpl broken

There were the following issues which caused the error not to be propagated:
- a regression caused by 625b7452d840793df5e72764193c98c5ba121cdf
  which did bring back the crashing of IE if the RDP connection is not
  successful (originally fixed by fa10641c3484ea10d0b1b33ef8e3d656b5e6dd35).

- by the same commit (625b7452d840793df5e72764193c98c5ba121cdf) the new method
  setParentModel has been introduced but it was not called. It caused a NPE on
  RdpPluginImpl.rdpDisconnected:66. Fixed by calling this method on the
  relevant places.

- after autologin the Frontend.getInstance().getLoginPassword() returns null
  which causes NPE on RdpPluginImpl:113 when setting this pass to
  ClearTextPassword. Fixed at AbstractRdp level because the null password for
  DbUser class can still be relevant - just needs to be handled differently on
  AbstractRdp level.

Change-Id: I85fc3b32c4f544f23864db2aefa5ebcd4d896b75
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1014710
Signed-off-by: Tomas Jelinek <[email protected]>
---
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/AbstractRdp.java
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/RdpPluginImpl.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/RdpConsoleModel.java
3 files changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/52/20952/1

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/AbstractRdp.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/AbstractRdp.java
index 6563ccd..346e1d4 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/AbstractRdp.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/AbstractRdp.java
@@ -31,7 +31,8 @@
     }
 
     public String getUserPassword() {
-        return Frontend.getInstance().getLoginPassword();
+        String password = Frontend.getInstance().getLoginPassword();
+        return password != null ? password : ""; //$NON-NLS-1$
     }
 
     public String getUserDomainController() {
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/RdpPluginImpl.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/RdpPluginImpl.java
index 5ca6544..5f14111 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/RdpPluginImpl.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/RdpPluginImpl.java
@@ -126,7 +126,6 @@
                                      var extendedDiscReason = 
MsRdpClient.ExtendedDisconnectReason;
                                      var errorCodeEventArgs = 
@org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs::new(I)(disconnectCode);
                                      
[email protected]::raise(Ljava/lang/Object;Lorg/ovirt/engine/ui/uicompat/EventArgs;)(model,
 errorCodeEventArgs);
-                                     
$wnd.document.body.removeChild(MsRdpClient);
                                  }
 
                                  MsRdpClient.attachEvent('OnConnected', 
OnConnected);
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/RdpConsoleModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/RdpConsoleModel.java
index 216e792..f92c6a1 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/RdpConsoleModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/RdpConsoleModel.java
@@ -35,10 +35,13 @@
                 setrdp((IRdp) 
TypeResolver.getInstance().resolve(IRdpNative.class));
                 break;
             case Plugin:
-                setrdp((IRdp) 
TypeResolver.getInstance().resolve(IRdpPlugin.class));
+                IRdpPlugin plugin = (IRdpPlugin) 
TypeResolver.getInstance().resolve(IRdpPlugin.class);
+                plugin.setParentModel(this);
+                setrdp(plugin);
                 break;
             default:
                 IRdpPlugin impl = (IRdpPlugin) 
TypeResolver.getInstance().resolve(IRdpPlugin.class);
+                impl.setParentModel(this);
                 
setrdp(consoleUtils.isBrowserPluginSupported(ConsoleProtocol.RDP) ? impl
                         : (IRdp) 
TypeResolver.getInstance().resolve(IRdpNative.class));
                 break;


-- 
To view, visit http://gerrit.ovirt.org/20952
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I85fc3b32c4f544f23864db2aefa5ebcd4d896b75
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to