[X2Go-Commits] [x2goserver] 01/04: x2goserver/sbin/x2gocleansessions: re-fetch the current sessions' status before handling it.

git-admin at x2go.org git-admin at x2go.org
Mon Jun 22 00:13:32 CEST 2015


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2goserver.

commit 2108538530130044766907444e4b55fb2901ae8b
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Sun Jun 21 22:39:05 2015 +0200

    x2goserver/sbin/x2gocleansessions: re-fetch the current sessions' status before handling it.
    
    Using the "cached" value from the initial x2golistsessions run may be
    desynchronized with the actual current value. Avoids a race condition
    logging users out after they attached to a session.
    
    Cherry-picked from release/4.0.1.x branch.
---
 debian/changelog                  |    5 +++++
 x2goserver/sbin/x2gocleansessions |    3 +++
 2 files changed, 8 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 125de2d..d4b36cb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -187,6 +187,11 @@ x2goserver (4.0.1.20-0x2go1) UNRELEASED; urgency=low
       file. Only check the primary and secondary groups as returned by
       getgid()/getgroups(). Fixes long delays in session startup on machines
       with a gazillion of groups.
+    - x2goserver/sbin/x2gocleansessions: re-fetch the current sessions' status
+      before handling it. Using the "cached" value from the initial
+      x2golistsessions run may be desynchronized with the actual current
+      value. Avoids a race condition logging users out after they attached to a
+      session.
   * x2goserver.spec:
     - Add sudo and logcheck as BuildRequires and Requires. Don't own
       directories that are owned by sudo and logcheck. Logcheck is not
diff --git a/x2goserver/sbin/x2gocleansessions b/x2goserver/sbin/x2gocleansessions
index 83e57a1..11c98a3 100755
--- a/x2goserver/sbin/x2gocleansessions
+++ b/x2goserver/sbin/x2gocleansessions
@@ -189,6 +189,9 @@ elsif ($pid == 0 )
 
 			#print @sinfo[1], ': ', $remembered_sessions_since{@sinfo[1]},' ',$remembered_sessions_status{@sinfo[1]},"\n";
 
+			# Update current status once per session. Avoids race conditions.
+			@sinfo[4] = system_capture_stdout_output ("$x2go_lib_path/x2gogetstatus", "@sinfo[1]");
+
 			if (@sinfo[4]eq 'F')
 			{
 				log_message('debug', "@sinfo[1] is blocked");

--
Alioth's /srv/git/code.x2go.org/x2goserver.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git


More information about the x2go-commits mailing list