[X2Go-Commits] [python-x2go] 01/01: Don't blindly release gevent locked. We need to checked if a semaphore is locked in some case and only then release it. (Fixes: #1016).
git-admin at x2go.org
git-admin at x2go.org
Tue May 9 12:26:11 CEST 2017
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository python-x2go.
commit 3ed4fed3465e02c605c80e057c265ca4a5d4b2ac
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Tue May 9 12:24:20 2017 +0200
Don't blindly release gevent locked. We need to checked if a semaphore is locked in some case and only then release it. (Fixes: #1016).
---
debian/changelog | 3 +++
x2go/backends/control/plain.py | 15 ++++++++++-----
x2go/backends/terminal/plain.py | 3 ++-
x2go/session.py | 3 ++-
4 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index aeca116..cd549f0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,9 @@ python-x2go (0.5.0.5-0x2go1) UNRELEASED; urgency=low
[ Mike Gabriel ]
* New upstream version (0.5.0.5):
- documentation: Fix wording in docstring.
+ - Don't blindly release gevent locked. We need to checked if a
+ semaphore is locked in some case and only then release it.
+ (Fixes: #1016).
[ Mihai Moldovan ]
* New upstream version (0.5.0.5):
diff --git a/x2go/backends/control/plain.py b/x2go/backends/control/plain.py
index 73807e5..3dcc3ef 100644
--- a/x2go/backends/control/plain.py
+++ b/x2go/backends/control/plain.py
@@ -324,7 +324,8 @@ class X2GoControlSession(paramiko.SSHClient):
timer.cancel()
self.sftp_client = None
- self._transport_lock.release()
+ if self._transport_lock.locked():
+ self._transport_lock.release()
def _x2go_sftp_write(self, remote_path, content, timeout=20):
"""
@@ -380,7 +381,8 @@ class X2GoControlSession(paramiko.SSHClient):
timer.cancel()
self.sftp_client = None
- self._transport_lock.release()
+ if self._transport_lock.locked():
+ self._transport_lock.release()
def _x2go_sftp_remove(self, remote_path, timeout=20):
"""
@@ -431,7 +433,8 @@ class X2GoControlSession(paramiko.SSHClient):
timer.cancel()
self.sftp_client = None
- self._transport_lock.release()
+ if self._transport_lock.locked():
+ self._transport_lock.release()
def _x2go_exec_command(self, cmd_line, loglevel=log.loglevel_INFO, timeout=20, **kwargs):
"""
@@ -520,7 +523,8 @@ class X2GoControlSession(paramiko.SSHClient):
self._transport_lock.release()
raise x2go_exceptions.X2GoControlSessionException('the X2Go control session is not connected (while issuing SSH command=%s)' % cmd)
- self._transport_lock.release()
+ if self._transport_lock.locked():
+ self._transport_lock.release()
# sanitized X2Go relevant data, protect against data injection via .bashrc files
(_stdin, _stdout, _stderr) = _retval
@@ -1204,7 +1208,8 @@ class X2GoControlSession(paramiko.SSHClient):
self._session_auth_rsakey = None
# in any case, release out internal transport lock
- self._transport_lock.release()
+ if self._transport_lock.locked():
+ self._transport_lock.release()
# close SSH agent auth forwarding objects
if self.agent_handler is not None:
diff --git a/x2go/backends/terminal/plain.py b/x2go/backends/terminal/plain.py
index 786ad8d..1ea43ea 100644
--- a/x2go/backends/terminal/plain.py
+++ b/x2go/backends/terminal/plain.py
@@ -421,7 +421,8 @@ class X2GoTerminalSession(object):
- clear the session info
"""
- self._share_local_folder_lock.release()
+ if self._share_local_folder_lock.locked():
+ self._share_local_folder_lock.release()
self.release_telekinesis()
self.release_proxy()
self.session_window = None
diff --git a/x2go/session.py b/x2go/session.py
index d37c038..b1f836d 100644
--- a/x2go/session.py
+++ b/x2go/session.py
@@ -1374,7 +1374,8 @@ class X2GoSession(object):
self.terminated = None
self.faults = None
self.active = False
- self._lock.release()
+ if self._lock.locked():
+ self._lock.release()
self.unset_master_session()
try:
self.update_status(force_update=True)
--
Alioth's /srv/git/code.x2go.org/python-x2go.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/python-x2go.git
More information about the x2go-commits
mailing list