[gnome-boxes/release-gnome-3-32-2: 3/5] ssh-display: Run ssh with username when specified



commit 6c0932e3c1044a910b5d3ad039836566e1e8aedc
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 36c52c5f..9551f7f2 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", @"-p $port", prefix + this.host,
         };


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