[X2Go-Commits] python-x2go.git - build-baikal (branch) updated: 7c1a074b2bb0fde3707bdb9d4c9c2967ed24413d
X2Go dev team
git-admin at x2go.org
Wed Jan 8 15:27:38 CET 2014
The branch, build-baikal has been updated
via 7c1a074b2bb0fde3707bdb9d4c9c2967ed24413d (commit)
from 577aa381675055486ed0bfedf6c9b03c64c8de8b (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/log.py | 3 +++
x2go/session.py | 19 ++++++++++---------
x2go/sftpserver.py | 11 ++++++-----
3 files changed, 19 insertions(+), 14 deletions(-)
The diff of changes is:
diff --git a/x2go/log.py b/x2go/log.py
index 82c4e9b..db76d1b 100644
--- a/x2go/log.py
+++ b/x2go/log.py
@@ -93,6 +93,9 @@ class X2goLogger(object):
self.destination.write('%s[%s] %s: %s\n' % (self.name, self.progpid, self._loglevel_NAMES[loglevel].upper(), msg))
__call__ = message
+ def get_loglevel(self):
+ return self.loglevel
+
def set_loglevel(self, loglevel_name='none'):
"""\
Set log level by name.
diff --git a/x2go/session.py b/x2go/session.py
index 5ba91d5..ff104af 100644
--- a/x2go/session.py
+++ b/x2go/session.py
@@ -152,15 +152,16 @@ class X2goSession(object):
self.terminal_params['client_instance'] = _client_instance
- self.logger('X2go control session parameters for profile %s:' % profile_name, log.loglevel_DEBUG)
- for p in self.control_params:
- self.logger(' %s: %s' % (p, self.control_params[p]), log.loglevel_DEBUG)
- self.logger('X2go terminal session parameters for profile %s:' % profile_name, log.loglevel_DEBUG)
- for p in self.terminal_params:
- self.logger(' %s: %s' % (p,self.terminal_params[p]), log.loglevel_DEBUG)
- self.logger('X2go sshproxy parameters for profile %s:' % profile_name, log.loglevel_DEBUG)
- for p in self.sshproxy_params:
- self.logger(' %s: %s' % (p,self.sshproxy_params[p]), log.loglevel_DEBUG)
+ if self.logger.get_loglevel() & log.loglevel_DEBUG:
+ self.logger('X2go control session parameters for profile %s:' % profile_name, loglevel=log.loglevel_DEBUG)
+ for p in self.control_params:
+ self.logger(' %s: %s' % (p, self.control_params[p]), log.loglevel_DEBUG)
+ self.logger('X2go terminal session parameters for profile %s:' % profile_name, loglevel=log.loglevel_DEBUG)
+ for p in self.terminal_params:
+ self.logger(' %s: %s' % (p,self.terminal_params[p]), log.loglevel_DEBUG)
+ self.logger('X2go sshproxy parameters for profile %s:' % profile_name, loglevel=log.loglevel_DEBUG)
+ for p in self.sshproxy_params:
+ self.logger(' %s: %s' % (p,self.sshproxy_params[p]), loglevel=log.loglevel_DEBUG)
if control_session is None:
self.logger('initializing X2goControlSession', loglevel=log.loglevel_DEBUG)
diff --git a/x2go/sftpserver.py b/x2go/sftpserver.py
index 7fa44b7..89300f5 100644
--- a/x2go/sftpserver.py
+++ b/x2go/sftpserver.py
@@ -64,13 +64,14 @@ class _SSHServer(paramiko.ServerInterface):
self.current_local_user = defaults.CURRENT_LOCAL_USER
self.auth_key = auth_key
paramiko.ServerInterface.__init__(self, *args, **kwargs)
-
+ logger('initializing internal SSH server for handling incoming sFTP requests, allowing connections for user ,,%s\'\' only' % self.current_local_user, loglevel=log.loglevel_DEBUG)
def check_channel_request(self, kind, chanid):
"""\
Only allow session requests.
"""
+ self.logger('detected a channel request for sFTP', loglevel=log.loglevel_DEBUG_SFTPXFER)
if kind == 'session':
return paramiko.OPEN_SUCCEEDED
return paramiko.OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED
@@ -93,6 +94,7 @@ class _SSHServer(paramiko.ServerInterface):
Only allow public key authentication.
"""
+ self.logger('sFTP client asked for support auth methods, answering: publickey', loglevel=log.loglevel_DEBUG_SFTPXFER)
return 'publickey'
@@ -139,12 +141,10 @@ class _SFTPServerInterface(paramiko.SFTPServerInterface):
_tail = os.path.normpath('/'.join(_tail_components))
path = os.path.join('%s:' % _drive, '/', _tail)
else:
- path = os.path.normpath(os.path.join(self.CHROOT, self.canonicalize(path)))
+ path = self.CHROOT + self.canonicalize(path)
+ path = path.replace('//', '/')
return path
- def session_started(self):
- print 'SESSION STARTED: %s' % self.CHROOT
-
def list_folder(self, path):
"""\
List the contents of a folder.
@@ -487,6 +487,7 @@ def x2go_rev_forward_sftpchannel_handler(chan=None, auth_key=None, logger=None):
# set up sftp handler, server and event
event = threading.Event()
t.set_subsystem_handler('sftp', paramiko.SFTPServer, sftp_si=_SFTPServerInterface, chroot='/', logger=logger, server_event=event)
+ logger('registered sFTP subsystem handler', loglevel=log.loglevel_DEBUG_SFTPXFER)
server = _SSHServer(auth_key=auth_key, logger=logger)
# start ssh server session
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