Subject: Bug#1230: x2go fails unhelpfully when a session fails to start

From: "Norman Gray" <[email-masked]>
Date: Fri, 27 Oct 2017 18:02:20 +0100

Package: x2goserver
Version: 4.0.1.20

When a username is rejected by the 'valid username' test (see separate 
bug report<https://bugs.x2go.org/cgi-bin/bugreport.cgi?bug=1229>), the 
session doesn't fail, but simply seems to hang, giving no feedback about 
the problem, nor, as far as I can see, reporting anything in the logs.

To reproduce, attempt to log in using a username such as '123x'.  The 
session doesn't complete the setup, leaving the user at a blank screen.

Suggestion: a user-visible error message should be produced, and an 
informative message sent to the system log.

Best wishes,

Norman

-- 
Norman Gray  :  https://nxg.me.uk

---

From: Mihai Moldovan <[email-masked]>
Date: Thu, 2 Nov 2017 20:08:41 +0100

Control: tag -1 -pending
Control: notfixed -1 4.0.1.21

> informative message sent to the system log.

I've tried catching errors while inserting values into the database, but it
turns out that doing this is not easily possible, since the current code relies
on brute-force adding of new DB entries and ignoring errors until it succeeds.
If a hard error occurs that will make any insertion fail, of course this will
loop forever.

I'll need to implement something more sophisticated that detects hard errors
which will always lead to failures.

Mihai

---

From: Mihai Moldovan <[email-masked]>
Date: Fri, 28 Feb 2020 15:36:56 +0100 (CET)

tag #1230 pending
fixed #1230 4.0.1.23
thanks

Hi!

X2Go issue #1230 (src:x2goserver) reported by you has been
fixed in X2Go Git. You can see the changelog below, and you can
check the diff of the fix at:

    http://code.x2go.org/gitweb?p=x2goserver.git;a=commitdiff;h=7a76b291

The issue will most likely be fixed in src:x2goserver (4.0.1.23).

light+love
X2Go Git Admin (on behalf of the sender of this mail)

---
commit 7a76b291ed589775ee5d84c34b677fd621ce6d11
Author: Mihai Moldovan <[email-masked]>
Date:   Thu Jan 4 06:16:51 2018 +0100

    x2goserver/bin/x2go{startagent,resume-session}: use x2gogetfreeport instead of duplicating the same code everywhere. Fixes: #1230.
    
    Also, rely on it returning a valid value and try at most 10 times to
    fetch a usable port value, then error out and make the session startup
    or resumption fail.

diff --git a/debian/changelog b/debian/changelog
index 818e823e..f8582d47 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -51,6 +51,11 @@ x2goserver (4.0.1.23-0x2go1) UNRELEASED; urgency=medium
       quotes on the lib path line.
     - x2goserver/bin/x2goresume-session: properly randomize first port, just
       like in x2gostartagent.
+    - x2goserver/bin/x2go{startagent,resume-session}: use x2gogetfreeport
+      instead of duplicating the same code everywhere. Fixes: #1230. Also,
+      rely on it returning a valid value and try at most 10 times to fetch a
+      usable port value, then error out and make the session startup or
+      resumption fail.
   * x2goserver.spec:
     - RPMify x2goserver-xsession description.
     - Remove qt4 stuff, we're not using the framework here.

---

From: Mihai Moldovan <[email-masked]>
Date: Fri, 28 Feb 2020 16:34:27 +0100 (CET)

tag #1230 pending
fixed #1230 4.0.1.23
thanks

Hi!

light+love

---