From unknown Mon Apr 13 07:31:05 2026
X-Loop: owner@bugs.x2go.org
Subject: Bug#566: [X2Go-Dev] Bug#566: X2Go Client for Windows 4.0.2.1 cannot create C:\Users\<username>\ssh\known_hosts file when the local Windows account username has non-Ascii characters
Reply-To: "George Trakatelis" <trakatelis@uom.edu.gr>, 566@bugs.x2go.org
Resent-From: "George Trakatelis" <trakatelis@uom.edu.gr>
Resent-To: x2go-dev@lists.x2go.org
Resent-CC: X2Go Developers <x2go-dev@lists.x2go.org>
X-Loop: owner@bugs.x2go.org
Resent-Date: Sun, 07 Sep 2014 10:05:01 +0000
Resent-Message-ID: <handler.566.B566.141008429710958@bugs.x2go.org>
Resent-Sender: owner@bugs.x2go.org
X-X2Go-PR-Message: followup 566
X-X2Go-PR-Package: x2goclient
X-X2Go-PR-Keywords: 
Received: via spool by 566-submit@bugs.x2go.org id=B566.141008429710958
          (code B ref 566); Sun, 07 Sep 2014 10:05:01 +0000
Received: (at 566) by bugs.x2go.org; 7 Sep 2014 10:04:57 +0000
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
	ymir.das-netzwerkteam.de
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID
	autolearn=ham version=3.3.2
Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id 13C375DEA7
	for <566@bugs.x2go.org>; Sun,  7 Sep 2014 12:04:55 +0200 (CEST)
Received: by mail-wg0-f45.google.com with SMTP id k14so13678876wgh.16
        for <566@bugs.x2go.org>; Sun, 07 Sep 2014 03:04:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=uom.edu.gr; s=google;
        h=from:to:cc:references:in-reply-to:subject:date:message-id
         :mime-version:content-type:thread-index:content-language;
        bh=l6WdbPDs3NCkk9qQ+/muUktkSkPtg8swGJoozEO3wkQ=;
        b=e5GJhXUgV+iE9e6DH6NDEPxLq3IuPqCYIt4+mw5evTXlG7463GXl2c3jk54UYgiaij
         BCwWAlzjGpMI1NNPv3C9zpU6pT/bR0IZan2oIq5znEJmAljrHI3BgNSMGN/6vgIScFMr
         P/8OgrJHd3ccpDLLIwc2h2OCqlvx4frPUUCtk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:to:cc:references:in-reply-to:subject:date
         :message-id:mime-version:content-type:thread-index:content-language;
        bh=l6WdbPDs3NCkk9qQ+/muUktkSkPtg8swGJoozEO3wkQ=;
        b=MOP3dLLAhvUjWcXPk0fAfOE9BOnY+y+XnrpkTK8/muSBA+xB2hETH6tjK/VvRdAsV6
         m7CsaFpbEUYyk5lqiY0RNtxt/YNE853iFgof/kFedz7Wzy2rY/MeVHYMgSYy32hCD2t4
         RR9dUVnO/KW9d8kw5Eza/g6HFEKXC8KL6whMa83KTck3t4Yav9oSXsYl8aa60h/WVXtj
         s3xrOchE+IsN2+VT3hJs7pfVGEIMZpOP7gMBUO0OswwvI7bO3zAnHWVcen40ZeG2mTq/
         Y91SYuwWqSsS4E1/eXiPsSsOwVqR5ZfigRJpo74I+hEJbTLjferb/4cokpisuW7CwKw4
         s7vQ==
X-Gm-Message-State: ALoCoQlIKzmej75Olrykb4BElHSHUqLjpE+y50wFyztpIFh11z+i/AztYCXqoVMhgOvdBLiL93VO
X-Received: by 10.180.92.73 with SMTP id ck9mr15376697wib.54.1410084295703;
        Sun, 07 Sep 2014 03:04:55 -0700 (PDT)
Received: from HomePC (46-4-59.adsl.cyta.gr. [46.103.4.59])
        by mx.google.com with ESMTPSA id lp1sm7879844wic.21.2014.09.07.03.04.54
        for <multiple recipients>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
        Sun, 07 Sep 2014 03:04:54 -0700 (PDT)
From: "George Trakatelis" <trakatelis@uom.edu.gr>
To: <566@bugs.x2go.org>
Cc: "'Michael DePaulo'" <mikedep333@gmail.com>
References: <000001cfb552$3193a8a0$94baf9e0$@gr> <handler.566.B.140775428816658.ack@bugs.x2go.org> <000001cfc60a$32831de0$978959a0$@gr> <20140901195103.Horde.HOAd34FDzvE7MwwNBCtaAg1@mail.das-netzwerkteam.de> <CAMKht8gaM7uupVMhTkPR3pg2jcO5sBRHCbYkMV8kCf0EvKK8sg@mail.gmail.com> <CAMKht8jxisag8A9F3yFBSg3BQ+PODLzrayu90S0G8OaQKZXtfQ@mail.gmail.com>
In-Reply-To: <CAMKht8jxisag8A9F3yFBSg3BQ+PODLzrayu90S0G8OaQKZXtfQ@mail.gmail.com>
Date: Sun, 7 Sep 2014 13:04:51 +0300
Message-ID: <000001cfca83$2b11d830$81358890$@edu.gr>
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="----=_NextPart_000_0001_01CFCA9C.505F1030"
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: Ac/KVmeIP277Q0h2Q7adOqoU8+lGqwAJUXLg
Content-Language: el

This is a multi-part message in MIME format.

------=_NextPart_000_0001_01CFCA9C.505F1030
Content-Type: text/plain;
	charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Hi Mike,

1st, Ok.

2nd, You guessed right, so I have attached the very same file.

3rd, Your findings really puzzled me, so I did the following:

a. Installed German keyboard. Hit ';' to produce an accented letter
and -to my surprise- got =C3=B6. So I thought =C3=B6lexandr was the =
right name to test for username.

b. Created user =C3=B6lexandr and logged in as that user.
The patch did not work, as you mentioned.

c. As toLocal8Bit() returns the local 8-bit representation of a string,
I changed the system locale for non-unicode programs to German.
Now the patch worked!

I think the patch solves the problem for the Windows users who use =
English
as a foreign language and prefer having (non-Ascii) usernames in their =
native language.

-George

PS. A better title for the bug would be

X2Go Client for Windows 4.0.2.1 cannot create =
C:\Users\<username>\ssh\known_hosts file when the local Windows account =
username has non-Ascii characters


-----=CE=91=CF=81=CF=87=CE=B9=CE=BA=CF=8C =
=CE=BC=CE=AE=CE=BD=CF=85=CE=BC=CE=B1-----
=CE=91=CF=80=CF=8C: Michael DePaulo [mailto:mikedep333@gmail.com]=20
=CE=91=CF=80=CE=BF=CF=83=CF=84=CE=BF=CE=BB=CE=AE: =
=CE=9A=CF=85=CF=81=CE=B9=CE=B1=CE=BA=CE=AE, 7 =
=CE=A3=CE=B5=CF=80=CF=84=CE=B5=CE=BC=CE=B2=CF=81=CE=AF=CE=BF=CF=85 2014 =
7:44 =CF=80=CE=BC
=CE=A0=CF=81=CE=BF=CF=82: Mike Gabriel; 566@bugs.x2go.org
=CE=9A=CE=BF=CE=B9=CE=BD.: trakatelis@uom.gr; George Trakatelis
=CE=98=CE=AD=CE=BC=CE=B1: Re: [X2Go-Dev] Bug#566: Bug#566: X2Go Client =
for Windows 4.0.2.1 cannon create C:\Users\<username>\ssh\known_hosts =
file when the local Windows account username has non-English characters

Hi George,

1st, please use either "diff -c" or "git diff" to prepare the patch.
You can even use "git diff" on a files/folders that are outisde of a git =
source tree.

2nd, I tried what I think was your patch. I've attached the change I =
used, it is outputted with "git diff". I used the x2goclient master =
branch (4.0.3.0.)

Unfortunately, it failed to fix the bug. I did not experience any =
regressions though.

I tested it on both a Windows XP 32-bit SP3 machine and a Windows 8.1 =
64-bit machine (with the latest required updates & optional updates from =
MS.)

3rd, the username I used was =
"=CE=B4=CE=BF=CE=BA=CE=B9=CE=BC=CE=B1=CF=83=CF=84=CE=B9=CE=BA=CF=8C =
=CF=87=CF=81=CE=AE=CF=83=CF=84=CE=B7". That is how Google Translate =
translated "test user" into Greek. Because it is not easy for me to type =
that name into the Windows login prompt, I simply ran commands like the =
following to test it:
runas =
"/user:=CE=B4=CE=BF=CE=BA=CE=B9=CE=BC=CE=B1=CF=83=CF=84=CE=B9=CE=BA=CF=8C=
 =CF=87=CF=81=CE=AE=CF=83=CF=84=CE=B7" =
"c:\x2gobuilds\x2goclient\dist\x2goclient.exe"

-Mike

------=_NextPart_000_0001_01CFCA9C.505F1030
Content-Type: application/octet-stream;
	name="bug566.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="bug566.patch"

diff --git a/sshmasterconnection.cpp b/sshmasterconnection.cpp=0A=
index 827eefe..90cf9c7 100755=0A=
--- a/sshmasterconnection.cpp=0A=
+++ b/sshmasterconnection.cpp=0A=
@@ -518,7 +518,7 @@ void SshMasterConnection::run()=0A=
     }=0A=
 =0A=
 #ifdef Q_OS_WIN=0A=
-    ssh_options_set ( my_ssh_session, SSH_OPTIONS_SSH_DIR, =
(mainWnd->getHomeDirectory()+"/ssh").toAscii());=0A=
+    ssh_options_set ( my_ssh_session, SSH_OPTIONS_SSH_DIR, =
(mainWnd->getHomeDirectory()+"/ssh").toLocal8Bit());=0A=
     if (kerberos)=0A=
     {=0A=
         parseKnownHosts();=0A=
@@ -627,7 +627,7 @@ void SshMasterConnection::run()=0A=
     }=0A=
     ssh_options_set ( my_ssh_session, SSH_OPTIONS_USER, user.toAscii() =
);=0A=
 #ifdef Q_OS_WIN=0A=
-    ssh_options_set ( my_ssh_session, SSH_OPTIONS_SSH_DIR, =
(mainWnd->getHomeDirectory()+"/ssh").toAscii());=0A=
+    ssh_options_set ( my_ssh_session, SSH_OPTIONS_SSH_DIR, =
(mainWnd->getHomeDirectory()+"/ssh").toLocal8Bit());=0A=
 =0A=
 #ifdef DEBUG=0A=
     x2goDebug<<"setting SSH DIR to =
"<<mainWnd->getHomeDirectory()+"/ssh";=0A=

------=_NextPart_000_0001_01CFCA9C.505F1030--
