[X2Go-Commits] python-x2go.git - twofactorauth (branch) updated: 0.0.44.2-3-g27abd53

X2Go dev team git-admin at x2go.org
Sat Sep 14 15:56:38 CEST 2013


The branch, twofactorauth has been updated
       via  27abd53ee202d4ff7fe0f69acf34be4caf205b34 (commit)
      from  878e1c9178a4a472c1f8a7729a3526d6aa5a836d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 x2go/backends/control/_stdout.py  |   10 ++++++++++
 x2go/backends/terminal/_stdout.py |    4 +++-
 2 files changed, 13 insertions(+), 1 deletion(-)

The diff of changes is:
diff --git a/x2go/backends/control/_stdout.py b/x2go/backends/control/_stdout.py
index cdcb01b..959ac9f 100644
--- a/x2go/backends/control/_stdout.py
+++ b/x2go/backends/control/_stdout.py
@@ -236,6 +236,16 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient):
         #return username in self._x2go_remote_group('x2gousers')
         return True
 
+    def remote_username(self):
+        """\
+        Returns the control session's remote username.
+
+        """
+        if self.get_transport() is not None:
+            return self.get_transport().get_username()
+        else:
+            return None
+
     @property
     def _x2go_session_auth_rsakey(self):
         if self._session_auth_rsakey is None:
diff --git a/x2go/backends/terminal/_stdout.py b/x2go/backends/terminal/_stdout.py
index 84076c1..5ee1ead 100644
--- a/x2go/backends/terminal/_stdout.py
+++ b/x2go/backends/terminal/_stdout.py
@@ -817,7 +817,7 @@ class X2goTerminalSessionSTDOUT(object):
         (stdin, stdout, stderr) = self.control_session._x2go_exec_command(cmd_line)
 
         self.session_info.initialize(stdout.read(),
-                                     username=self.control_session.get_transport().get_username(),
+                                     username=self.control_session.remote_username(),
                                      hostname=self.control_session.get_transport().getpeername(),
                                     )
 
@@ -879,6 +879,8 @@ class X2goTerminalSessionSTDOUT(object):
         self.session_info.remote_container = '%s/.x2go/C-%s' % (self.control_session._x2go_remote_home, 
                                                                 self.session_info.name,
                                                                )
+        # on a session resume the user name comes in as a user ID. We have to translate this...
+        self.session_info.username = self.control_session.remote_username()
         return self.ok()
 
     def suspend(self):


hooks/post-receive
-- 
python-x2go.git (Python X2Go Client API)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-x2go.git" (Python X2Go Client API).




More information about the x2go-commits mailing list