[virt-tools-list] [PATCH v2 virt-viewer] rhbz#1007306 - Don't free session if we're re-trying auth

Marc-André Lureau mlureau at redhat.com
Wed Feb 12 23:30:50 UTC 2014


ack

----- Original Message -----
> deactivate() is called in response to a failed authentication attempt. If the
> session is cleared here, when a user attempts to re-authenticate, it will
> issue
> a warning and will not actually work. So only clear the session here if we're
> not going to re-try authentication.
> ---
> 
> Fix critial warning mentioned by Marc-Andre
> 
>  src/virt-viewer-app.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> index 0369706..efa012a 100644
> --- a/src/virt-viewer-app.c
> +++ b/src/virt-viewer-app.c
> @@ -1251,7 +1251,6 @@ virt_viewer_app_deactivate(VirtViewerApp *self,
> gboolean connect_error)
>  
>      if (priv->session) {
>          virt_viewer_session_close(VIRT_VIEWER_SESSION(priv->session));
> -        g_clear_object(&priv->session);
>      }
>  
>      priv->connected = FALSE;
> @@ -1267,8 +1266,10 @@ virt_viewer_app_deactivate(VirtViewerApp *self,
> gboolean connect_error)
>      if (priv->authretry) {
>          priv->authretry = FALSE;
>          g_idle_add(virt_viewer_app_retryauth, self);
> -    } else
> +    } else {
> +        g_clear_object(&priv->session);
>          virt_viewer_app_deactivated(self, connect_error);
> +    }
>  
>  }
>  
> --
> 1.8.5.3
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
> 




More information about the virt-tools-list mailing list