From unknown Fri Mar 29 11:44:04 2024 X-Loop: owner@bugs.x2go.org Subject: Bug#876: Problem with numeric user id Reply-To: brian , 876@bugs.x2go.org Resent-From: brian Resent-To: x2go-dev@lists.x2go.org Resent-CC: X2Go Developers X-Loop: owner@bugs.x2go.org Resent-Date: Sat, 16 May 2015 19:10:02 +0000 Resent-Message-ID: Resent-Sender: owner@bugs.x2go.org X-X2Go-PR-Message: report 876 X-X2Go-PR-Package: x2goserver X-X2Go-PR-Keywords: Received: via spool by submit@bugs.x2go.org id=B.143180311732513 (code B); Sat, 16 May 2015 19:10:02 +0000 Received: (at submit) by bugs.x2go.org; 16 May 2015 19:05:17 +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=0.0 required=5.0 tests=BAYES_20,T_DKIM_INVALID, URIBL_BLOCKED autolearn=ham version=3.3.2 X-Greylist: delayed 46786 seconds by postgrey-1.34 at ymir.das-netzwerkteam.de; Sat, 16 May 2015 21:05:14 CEST Received: from homiemail-a106.g.dreamhost.com (sub4.mail.dreamhost.com [69.163.253.135]) by ymir.das-netzwerkteam.de (Postfix) with ESMTP id 955D05DA82 for ; Sat, 16 May 2015 21:05:14 +0200 (CEST) Received: from homiemail-a106.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a106.g.dreamhost.com (Postfix) with ESMTP id 0DE6A2005D005 for ; Sat, 16 May 2015 12:05:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=fodvo.org; h=message-id :date:from:mime-version:to:subject:content-type; s=fodvo.org; bh=I2EDMtxWP4K5ksPhv9nE3YBaOmo=; b=FYuSnXa/dQq+lL4XX91BAZrsCmBX l4vG9tBu0W+sRQx1o4HixyDvwiVpa26vzqvxZh9YQwx8GcN47ImrAYKJTh7YLWDc 24bAvcY0z+30rk5zZ5WR62s0bF9ePiw52du9g5e97TXCOzpuHsLXFbpVcyQFWUFE WTvY3DfAtIE1q9I= Received: from [10.20.0.11] (unknown [216.160.0.218]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: brian@fodvo.org) by homiemail-a106.g.dreamhost.com (Postfix) with ESMTPSA id CECEE2005CF2E for ; Sat, 16 May 2015 12:05:12 -0700 (PDT) Message-ID: <555794E7.10906@fodvo.org> Date: Sat, 16 May 2015 14:05:11 -0500 From: brian User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: submit@bugs.x2go.org Content-Type: multipart/mixed; boundary="------------050505060608080503090208" This is a multi-part message in MIME format. --------------050505060608080503090208 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Package: x2goserver Version: 4.01.19 Server Fedora 21 x2goserver-4.0.1.19-1.fc21.x86_64 Client Fedora 20 x2goclient-4.0.3.1-1.fc20.x86_64 I had this working fine, and then one day the client would hang in a greyed out manner waiting to connect. Several hours of tracing through the scripts, I learned the server x2gostartagent script was simply infinite looping through sessions and /usr/lib64/x2go/x2gosqlitewrapper.pl insertsession was rejecting them all. I suspected the problem may be when I changed my user id on the server from alpha-numeric to all numeric... Yes I know traditional UNIX/Linux user ids are supposed to start with at least 1 alpha character, but working for a large corp where MS Active Directory runs everything, they have successfully standardized all Windows and Linux user accounts to 6 digit numerics. You don't have to convince me this was a BAD idea, but way above my pay grade. So when I changed my server to match (and yes Fedora will accept a numeric user id even without AD authentication, but it will warn against it), the failure started. One more test I ran a connect as 'root' and it connected right away, so I knew where the problem was. Digging through x2gosqlitewrapper.pl I noticed a lot of perl regex and found the sanitizer function, line 67. When I replaced it with if ($string =~ /^([a-zA-Z0-9\_] .... everything started working again. Diff file attached. --------------050505060608080503090208 Content-Type: text/x-patch; name="x2gosqlitewrapper.pl.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="x2gosqlitewrapper.pl.diff" 67c67 < if ($string =~ /^([a-zA-Z\_][a-zA-Z0-9\_\-\.\@]{0,47}[\$]?)\-([\d]{2,4})\-([\d]{9,12})\_[a-zA-Z0-9\_\-\.]*\_dp[\d]{1,2}$/) { --- > if ($string =~ /^([a-zA-Z0-9\_][a-zA-Z0-9\_\-\.\@]{0,47}[\$]?)\-([\d]{2,4})\-([\d]{9,12})\_[a-zA-Z0-9\_\-\.]*\_dp[\d]{1,2}$/) { --------------050505060608080503090208--