[gnome-boxes] ssh-display: Run ssh with username when specified



commit ab208458ceba9a1f8396b845f595ea406bd5be45
Author: Daniel Ostrowski <daniel j ostrowski gmail com>
Date:   Fri May 31 21:23:01 2019 -0400

    ssh-display: Run ssh with username when specified
    
    When a user adds a box that is accessed via ssh, the URL to the box
    given by the user can optionally contain a name for the account to use
    on the remote box.
    
    In the logic that creates the parameters for the invocation of ssh, the
    specified username is mistakenly not supplied as part of one of the
    parameters. That is, when gnome-boxes is supplied the URL
    "ssh://root example com" gnome-boxes will execute the command
    "ssh example.com" instead of "ssh root example com".
    
    All the logic and parsing needed is already in place. This commit fixes
    a typo that caused the username to be excluded from the ssh command
    whenever a username was specified, instead of the other way around.
    
    https://gitlab.gnome.org/GNOME/gnome-boxes/issues/359

 src/ssh-display.vala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/ssh-display.vala b/src/ssh-display.vala
index 7d46ac09..bf7a9a0f 100644
--- a/src/ssh-display.vala
+++ b/src/ssh-display.vala
@@ -74,7 +74,7 @@ public override void connect_it (owned Display.OpenFDFunc? open_fd = null) {
 
         display.show_all ();
 
-        var prefix = this.user == "" ? this.user + "@" : "";
+        var prefix = this.user != "" ? this.user + "@" : "";
         string[] ssh_connect_cmd = {
             "ssh", prefix + this.host,
         };


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]