This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository pyhoca-cli. from ac94526 update debian/changelog new d417c62 Add --forward-sshagent / -A cmdline option for enabling SSH agent forwarding. new bee1402 debian/changelog: Add closure for #1287. new 34715b3 Entirely rewrite PyHocaCLI.authenticate() function. (Fixes: #1308). new 56fc651 pyhoca-clI: Reserve -l as username option. Just like in OpenSSH. new 0dabf4e pyhoca-cli: Add -i as alias for --ssh-privkey. Just like in OpenSSH. new 0171816 pyhoca-cli: Fake SSH like login with additional [host] as positional argument. new 1191860 pyhoca-cli: Extract username from host parameter, if an @ is in the host string. new dadb385 Switch from time.sleep() to gevent.sleep(). new 75f53ca Set specific 'Passphrase: ' prompt (not 'Password: ') when we query for SSH key passphrases. new e8dacb1 Fix --share-local-folders (aka -F) option and really mount shared folders. (Fixes: #984). new 61199c5 debian/control: The fix for --share-local-folders requires a fixed Python X2Go (>= 0.6.0.1). The 11 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: debian/changelog | 12 ++- debian/control | 2 +- pyhoca-cli | 22 +++++- pyhoca/cli/frontend.py | 199 ++++++++++++++++++++++++++++++++++++++++--------- 4 files changed, 189 insertions(+), 46 deletions(-) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pyhoca-cli.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository pyhoca-cli. commit d417c628e0ece776a3c0343110070dadcbee176a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Sep 18 09:12:18 2018 +0200 Add --forward-sshagent / -A cmdline option for enabling SSH agent forwarding. --- debian/changelog | 7 ++++--- pyhoca-cli | 6 +++++- pyhoca/cli/frontend.py | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8c76a86..f0e152a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -pyhoca-cli (0.5.99.1-0x2go1) UNRELEASED; urgency=medium +pyhoca-cli (0.5.99.1-0x2go2) UNRELEASED; urgency=medium * New upstream version (0.5.99.1). - Port to Python3. @@ -11,6 +11,8 @@ pyhoca-cli (0.5.99.1-0x2go1) UNRELEASED; urgency=medium auto-detect the client-side keyboard in the X2Go session just fine. - pyhoca-cli main programme: Check for DISPLAY env var being set and having a usable / expectable value. + - Add --forward-sshagent / -A cmdline option for enabling SSH agent + forwarding. * debian/rules: + Build for Python3, not Python2. + Switch to pybuild DH build system. @@ -25,9 +27,8 @@ pyhoca-cli (0.5.99.1-0x2go1) UNRELEASED; urgency=medium + Drop D (pyhoca-cli): python3-argparse. Part of stdlib in Python3 these days. * debian/{control,compat}: Bump to DH version level 9. - * - -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Sat, 12 May 2018 20:37:21 +0000 + -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Tue, 18 Sep 2018 09:10:58 +0200 pyhoca-cli (0.5.0.4-0x2go1) unstable; urgency=medium diff --git a/pyhoca-cli b/pyhoca-cli index 447969b..1856777 100755 --- a/pyhoca-cli +++ b/pyhoca-cli @@ -170,6 +170,9 @@ x2go_options = [ {'args':['--terminate-on-ctrl-c'], 'default': False, 'action': 'store_true', 'help': 'terminate the connected session when pressing CTRL+C (instead of suspending the session)', }, {'args':['--auth-attempts'], 'default': 3, 'help': 'number of authentication attempts before authentication fails (default: 3)', }, ] +ssh_options = [ + {'args':['-A', '--forward-sshagent'], 'default': False, 'action': 'store_true', 'help': 'forward SSH agent authentication socket', }, + ] print_options = [ {'args':['--print-action'], 'default': 'PDFVIEW', 'choices': PRINT_ACTIONS, 'help': 'action to be performed for incoming X2Go print jobs (default: \'PDFVIEW\')', }, {'args':['--pdfview-cmd'], 'default': None, 'help': 'PDF viewer command for displaying incoming X2Go print jobs (default: \'%s\'); this option selects \'--print-action PDFVIEW\'' % DEFAULT_PDFVIEW_CMD,}, @@ -250,13 +253,14 @@ Possible values for the --pack NX option are: p_actionopts = p.add_argument_group('client actions') p_debugopts = p.add_argument_group('debug options') p_x2goopts = p.add_argument_group('X2Go options') + p_sshopts = p.add_argument_group('SSH options') p_printopts = p.add_argument_group('X2Go print options') p_brokeropts = p.add_argument_group('X2Go Session Broker client options') p_nxopts = p.add_argument_group('NX options') p_backendopts = p.add_argument_group('Python X2Go backend options (for experts only)') p_compatopts = p.add_argument_group('compatibility options') - for (p_group, opts) in ((p_x2goopts, x2go_options), (p_printopts, print_options), (p_brokeropts, broker_options), (p_actionopts, action_options), (p_debugopts, debug_options), (p_nxopts, nx_options), (p_backendopts, backend_options), (p_compatopts, compat_options)): + for (p_group, opts) in ((p_x2goopts, x2go_options), (p_sshopts, ssh_options), (p_printopts, print_options), (p_brokeropts, broker_options), (p_actionopts, action_options), (p_debugopts, debug_options), (p_nxopts, nx_options), (p_backendopts, backend_options), (p_compatopts, compat_options)): for opt in opts: args = opt['args'] diff --git a/pyhoca/cli/frontend.py b/pyhoca/cli/frontend.py index 6e54164..a73dc2f 100644 --- a/pyhoca/cli/frontend.py +++ b/pyhoca/cli/frontend.py @@ -459,6 +459,7 @@ class PyHocaCLI(x2go.X2GoClient): print_action=self.args.print_action, print_action_args=self.args.print_action_args, share_local_folders=self.args.share_local_folders, + forward_sshagent=self.args.forward_sshagent, cmd=self.args.command) def authenticate(self): -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pyhoca-cli.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository pyhoca-cli. commit bee1402138e91941bbcbf9e0e16034ea7682273d Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Sep 18 09:12:46 2018 +0200 debian/changelog: Add closure for #1287. --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f0e152a..11ecdc9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ pyhoca-cli (0.5.99.1-0x2go2) UNRELEASED; urgency=medium * New upstream version (0.5.99.1). - - Port to Python3. + - Port to Python3. (Fixes: #1287). - Add --force-password command line switch to override SSH key detection code. - Add --try-resume cmd line option and feature. -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pyhoca-cli.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository pyhoca-cli. commit 34715b3f19c32462696fb202513297f5ace37771 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Sep 18 13:10:40 2018 +0200 Entirely rewrite PyHocaCLI.authenticate() function. (Fixes: #1308). --- debian/changelog | 1 + pyhoca-cli | 2 + pyhoca/cli/frontend.py | 177 +++++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 151 insertions(+), 29 deletions(-) diff --git a/debian/changelog b/debian/changelog index 11ecdc9..d0b46a4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,7 @@ pyhoca-cli (0.5.99.1-0x2go2) UNRELEASED; urgency=medium a usable / expectable value. - Add --forward-sshagent / -A cmdline option for enabling SSH agent forwarding. + - Entirely rewrite PyHocaCLI.authenticate() function. (Fixes: #1308). * debian/rules: + Build for Python3, not Python2. + Switch to pybuild DH build system. diff --git a/pyhoca-cli b/pyhoca-cli index 1856777..7bf6138 100755 --- a/pyhoca-cli +++ b/pyhoca-cli @@ -372,6 +372,8 @@ Possible values for the --pack NX option are: _dummy = int(a.auth_attempts) except ValueError: runtime_error ("value for cmd line argument --auth-attempts has to be of type integer", parser=p, exitcode=1) + if int(a.auth_attempts) < 1: + a.auth_attempts = "1" if a.server: diff --git a/pyhoca/cli/frontend.py b/pyhoca/cli/frontend.py index a73dc2f..4dbe643 100644 --- a/pyhoca/cli/frontend.py +++ b/pyhoca/cli/frontend.py @@ -468,7 +468,22 @@ class PyHocaCLI(x2go.X2GoClient): """ connected = False - force_password_auth = False + + if self.args.password: + password = self.args.password + self.args.password = None + cmdline_password = True + force_password_auth = True + else: + password = None + cmdline_password = False + force_password_auth = False + + if self.args.force_password: + force_password_auth = True + + passphrase = None + passphrase_unlock_counter = 3 _username = self.args.username or self._X2GoClient__get_session_username(self.x2go_session_hash) @@ -477,53 +492,157 @@ class PyHocaCLI(x2go.X2GoClient): _username = self.session_profiles.get_broker_username() try: - _auth_count = self.auth_attempts +1 + _auth_count = self.auth_attempts while not connected and _auth_count: + try: - if self.args.force_password: - self.args.password = getpass.getpass() - self._X2GoClient__connect_session(self.x2go_session_hash, username=_username, password=self.args.password, force_password_auth=force_password_auth) + + # decrement authentication counter... + _auth_count -= 1 + + # show interactive password prompt + if force_password_auth and not cmdline_password: + + password = getpass.getpass() + + # workaround for Python bug: http://bugs.python.org/issue11236 + try: + if password is not None and '\x03' in password: + raise KeyboardInterrupt() + except KeyboardInterrupt: + self._runtime_error('Authentication cancelled by user by hitting Ctrl-C at password prompt', exitcode=-200) + + if not password: + self._pyhoca_logger('password is empty, please re-try... (hit Ctrl-C plus ENTER to cancel)', loglevel=x2go.loglevel_WARN, ) + _auth_count += 1 + continue + + # connection attempt with remote X2Go Server + self._X2GoClient__connect_session(self.x2go_session_hash, username=_username, password=password, passphrase=passphrase, force_password_auth=force_password_auth) + + # we succeeeded connected = True - force_password_auth = False + + # this will end the loop (as connected is set to True) + continue + except x2go.PasswordRequiredException as e: - self._pyhoca_logger('unlock SSH key file (%s)' % self.args.ssh_privkey, loglevel=x2go.loglevel_NOTICE, ) - self.args.password = getpass.getpass() + + # x2go.PasswordRequiredException: This exception gets raised if an SSH pubkey is protected by a passphrase + + if not force_password_auth and passphrase_unlock_counter >= 1: + if passphrase == '': + self._pyhoca_logger('empty SSH key passphrase (%s), try again...' % self.args.ssh_privkey, loglevel=x2go.loglevel_WARN, ) + self._pyhoca_logger('unlock SSH key file (%s)' % self.args.ssh_privkey, loglevel=x2go.loglevel_NOTICE, ) + passphrase = getpass.getpass() + passphrase_unlock_counter -= 1 + # undo auth counter decrement + _auth_count += 1 + continue + + if not force_password_auth and _auth_count >= 1: + self._pyhoca_logger('unlocking of SSH key failed, proceeding with interactive login', loglevel=x2go.loglevel_WARN, ) + force_password_auth = True + password = None + passphrase = None + except x2go.AuthenticationException as e: - force_password_auth = True - self._pyhoca_logger('passwordless login for ,,%s\'\' failed' % _username, loglevel=x2go.loglevel_WARN, ) - self._pyhoca_logger('proceeding to interactive login for user ,,%s\'\'' % _username, loglevel=x2go.loglevel_NOTICE, ) + + # x2go.AuthenticationException: This exception gets raised if the authentication failed + + if force_password_auth: + self._pyhoca_logger('password based login for ,,%s\'\' failed [AuthException]' % _username, loglevel=x2go.loglevel_WARN, ) + else: + self._pyhoca_logger('passwordless login for ,,%s\'\' failed [AuthException]' % _username, loglevel=x2go.loglevel_WARN, ) + + # if the previous login attempt was pubkey based, enforce interactive login for the next round... + if not password and _auth_count >= 1: + self._pyhoca_logger('proceeding to interactive login for user ,,%s\'\'' % _username, loglevel=x2go.loglevel_NOTICE, ) + force_password_auth = True + # undo auth counter decrement + _auth_count += 1 + + # a password was provided via the command line + elif password and cmdline_password and _auth_count >= 1: + self._pyhoca_logger('cmdline provided password failed, proceeding to interactive login for user ,,%s\'\'' % _username, loglevel=x2go.loglevel_WARN, ) + force_password_auth = True + cmdline_password = False + + # else, if the previous attempt was already interactive, offer re-trying + elif force_password_auth and _auth_count >= 1: + self._pyhoca_logger('please re-try login for user ,,%s\'\'' % _username, loglevel=x2go.loglevel_NOTICE, ) + + passphrase = None + password = None + except x2go.BadHostKeyException: + + # let's bail out here immediately... + self._runtime_error('SSH host key verification for remote host [%s]:%s failed' % (self.args.server, self.args.remote_ssh_port), exitcode=-254) + except x2go.SSHException as e: - if str(e) not in ('not a valid DSA private key file', 'Incompatible ssh peer (no acceptable kex algorithm)', 'No authentication methods available'): - self._runtime_error(str(e), exitcode=253) - force_password_auth = True - self._pyhoca_logger('passwordless login for ,,%s\'\' failed' % _username, loglevel=x2go.loglevel_WARN, ) - self._pyhoca_logger('proceeding to interactive login for user ,,%s\'\'' % _username, loglevel=x2go.loglevel_NOTICE, ) - if force_password_auth: - self.args.password = getpass.getpass() + # this bit only captures problems with the SSH key file, other + # SSHExceptions are simply ignored (and we proceed to interactive login) + + if str(e).lower().startswith('could not deserialize key data') \ + : + + # this error gets thrown when the passphrase for unlocking the SSH privkey was wrong + + if not force_password_auth and passphrase_unlock_counter >= 1: + if passphrase is not None and passphrase != '': + self._pyhoca_logger('wrong SSH key passphrase (%s), try again...' % self.args.ssh_privkey, loglevel=x2go.loglevel_WARN, ) + self._pyhoca_logger('unlock SSH key file (%s)' % self.args.ssh_privkey, loglevel=x2go.loglevel_NOTICE, ) + passphrase = getpass.getpass() + passphrase_unlock_counter -= 1 + # undo auth counter decrement + _auth_count += 1 + continue + + if not force_password_auth and _auth_count >= 1: + self._pyhoca_logger('unlocking of SSH key failed, proceeding with interactive login', loglevel=x2go.loglevel_WARN, ) + force_password_auth = True + password = None + passphrase = None + + elif not str(e).lower().startswith('not a valid dsa private key file') or \ + not str(e).lower().startswith('not a valid rsa private key file') or \ + not str(e).lower().startswith('incompatible ssh peer (no acceptable kex algorithm)') or \ + not str(e).lower().startswith('no authentication methods available') \ + : + + if force_password_auth: + self._pyhoca_logger('password based login for ,,%s\'\' failed [SSHException]' % _username, loglevel=x2go.loglevel_WARN, ) + else: + self._pyhoca_logger('passwordless login for ,,%s\'\' failed [SSHException]' % _username, loglevel=x2go.loglevel_WARN, ) + + # let's bail out here... + self._runtime_error(str(e), exitcode=253) - # workaround for Python bug: http://bugs.python.org/issue11236 - try: - if self.args.password is not None and '\x03' in self.args.password: - raise KeyboardInterrupt() - except KeyboardInterrupt: - self._runtime_error('Authentication cancelled by user by hitting Ctrl-C at password prompt', exitcode=-200) + else: - _auth_count -= 1 + self._pyhoca_logger('[SSHException] the following error will be ignored: %s' % str(e), loglevel=x2go.loglevel_WARN) + self._pyhoca_logger('proceeding to interactive login for user ,,%s\'\'' % _username, loglevel=x2go.loglevel_NOTICE, ) + force_password_auth = True + password = None + passphrase = None - if not connected and not _auth_count: + if not connected and _auth_count <= 0: if self.auth_attempts >= 2: self._runtime_error('authentication failed, too many failures during interactive login', exitcode=-201) elif self.auth_attempts == 1: - self._runtime_error('interactive authentication failed', exitcode=-202) - else: - self._runtime_error('non-interactive authentication failed', exitcode=-203) + self._runtime_error('authentication failed', exitcode=-202) + except socket.error as e: self._runtime_error('a socket error occured while establishing the connection: %s' % str(e), exitcode=-245) + # drop clear text passwords... + password = None + passphrase = None + def MainLoop(self): """\ Start the main loop of this application. -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pyhoca-cli.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository pyhoca-cli. commit 56fc65147d191fde97a6ccb33b3a40fca3c7a9be Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Sep 18 11:32:36 2018 +0000 pyhoca-clI: Reserve -l as username option. Just like in OpenSSH. --- pyhoca-cli | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyhoca-cli b/pyhoca-cli index 7bf6138..989774b 100755 --- a/pyhoca-cli +++ b/pyhoca-cli @@ -136,7 +136,7 @@ action_options = [ {'args':['-T','--terminate'], 'default': None, 'metavar': 'SESSION_NAME', 'help': 'terminate running X2Go session SESSION_NAME', }, {'args':['-L','--list-sessions'], 'default': False, 'action': 'store_true', 'help': 'list user\'s X2Go sessions on server', }, {'args':['--list-desktops'], 'default': False, 'action': 'store_true', 'help': 'list X2Go desktop sessions that are available for sharing', }, - {'args':['-l','--list-profiles'], 'default': False, 'action': 'store_true', 'help': 'list user\'s X2Go pre-configured session profiles', }, + {'args':['--list-profiles'], 'default': False, 'action': 'store_true', 'help': 'list user\'s X2Go pre-configured session profiles', }, {'args':['-P','--session-profile'], 'default': None, 'help': 'load x2goclient session profiles and use the session profile SESSION_PROFILE', }, ] if _X2GOCLIENT_OS == "Linux": @@ -156,7 +156,7 @@ debug_options = [ x2go_options = [ # NOT IMPLEMENTED {'args':['--config'], 'default': '~/.x2goclient/sessions', 'help': 'x2goclient config file containing x2go session settings (default: ~/.x2goclient/sessions)', }, {'args':['-c','--command'], 'default': 'TERMINAL', 'help': 'command to run with -R mode on server (default: xterm)', }, - {'args':['-u','--username'], 'default': None, 'help': 'username for the session (default: current user)', }, + {'args':['-l', '-u','--username'], 'default': None, 'help': 'username for the session (default: current user)', }, {'args':['--password'], 'default': None, 'help': 'user password for session authentication', }, {'args':['--force-password'], 'default': False, 'action': 'store_true', 'help': 'enforce username/password authentication', }, {'args':['-p','--remote-ssh-port'], 'default': '22', 'help': 'remote SSH port (default: 22)', }, -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pyhoca-cli.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository pyhoca-cli. commit 0dabf4eaa4b118d7652ca7baf34bec3e9c81a865 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Sep 18 11:33:43 2018 +0000 pyhoca-cli: Add -i as alias for --ssh-privkey. Just like in OpenSSH. --- pyhoca-cli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyhoca-cli b/pyhoca-cli index 989774b..2a69593 100755 --- a/pyhoca-cli +++ b/pyhoca-cli @@ -160,7 +160,7 @@ x2go_options = [ {'args':['--password'], 'default': None, 'help': 'user password for session authentication', }, {'args':['--force-password'], 'default': False, 'action': 'store_true', 'help': 'enforce username/password authentication', }, {'args':['-p','--remote-ssh-port'], 'default': '22', 'help': 'remote SSH port (default: 22)', }, - {'args':['-k','--ssh-privkey'], 'default': None, 'help': 'use file \'SSH_PRIVKEY\' as private key for the SSH connection (e.g. ~/.ssh/id_rsa)', }, + {'args':['-i', '-k','--ssh-privkey'], 'default': None, 'help': 'use file \'SSH_PRIVKEY\' as private key for the SSH connection (e.g. ~/.ssh/id_rsa)', }, {'args':['--add-to-known-hosts'], 'default': False, 'action': 'store_true', 'help': 'add RSA host key fingerprint to ~/.ssh/known_hosts if authenticity of server can\'t be established (default: not set)', }, {'args':['--sound'], 'default': 'pulse', 'choices': ('pulse', 'esd', 'none'), 'help': 'X2Go server sound system (default: \'pulse\')', }, {'args':['--printing'], 'default': False, 'action': 'store_true', 'help': 'use X2Go printing (default: disabled)', }, -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pyhoca-cli.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository pyhoca-cli. commit 0171816c2793862fd2a8abbac7ce1716ffed8470 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Sep 18 11:49:23 2018 +0000 pyhoca-cli: Fake SSH like login with additional [host] as positional argument. --- pyhoca-cli | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyhoca-cli b/pyhoca-cli index 2a69593..60373fa 100755 --- a/pyhoca-cli +++ b/pyhoca-cli @@ -267,6 +267,8 @@ Possible values for the --pack NX option are: del opt['args'] p_group.add_argument(*args, **opt) + p.add_argument('host', nargs='?', default=None, help='host to connect to (as alternative to --server option)') + a = p.parse_args() if a.debug: @@ -294,6 +296,8 @@ Possible values for the --pack NX option are: if not (a.session_profile or a.list_profiles): + if a.host and not a.server: a.server = a.host + # the --server (or --session-profile) option is required for most operations if not a.server and not a.from_stdin: runtime_error ("argument --server (or --session-profile) is required", parser=p, exitcode=1) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pyhoca-cli.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository pyhoca-cli. commit 119186045a7c4760fd6b855ebe9c3b680a50d63f Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Sep 18 11:53:38 2018 +0000 pyhoca-cli: Extract username from host parameter, if an @ is in the host string. --- pyhoca-cli | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyhoca-cli b/pyhoca-cli index 60373fa..b7c93bd 100755 --- a/pyhoca-cli +++ b/pyhoca-cli @@ -290,6 +290,10 @@ Possible values for the --pack NX option are: if a.version: version() + if not a.username and "@" in a.host: + a.username = a.host.split('@')[0] + a.host = '@'.join(a.host.split('@')[1:]) + # if no username is given we use the uid under which this programme is run if a.username is None and not a.session_profile: a.username = current_user -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pyhoca-cli.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository pyhoca-cli. commit dadb385f8654516fcdd5d4f7e875df822541195e Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Sep 18 16:37:21 2018 +0000 Switch from time.sleep() to gevent.sleep(). --- pyhoca/cli/frontend.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pyhoca/cli/frontend.py b/pyhoca/cli/frontend.py index 4dbe643..7a85410 100644 --- a/pyhoca/cli/frontend.py +++ b/pyhoca/cli/frontend.py @@ -25,9 +25,8 @@ import x2go import sys import os import copy -import time import getpass -from gevent import socket +from gevent import socket, sleep # for debugging import pprint @@ -696,7 +695,7 @@ class PyHocaCLI(x2go.X2GoClient): i=0 while 0 < self.get_session(self.x2go_session_hash).get_progress_status() < 100: - time.sleep(1) + sleep(1) i+=1 if self._X2GoClient__session_ok(self.x2go_session_hash): @@ -720,11 +719,11 @@ class PyHocaCLI(x2go.X2GoClient): session_duration = 0 while self._X2GoClient__session_ok(self.x2go_session_hash): - time.sleep(2) + sleep(2) session_duration +=2 # wait a little while before telling the user what has happened - time.sleep(2) + sleep(2) # refresh session status so we can be most accurate on what we report below self._X2GoClient__list_sessions(self.x2go_session_hash) @@ -741,19 +740,19 @@ class PyHocaCLI(x2go.X2GoClient): if self.args.share_desktop: self._pyhoca_logger("Terminating X2Go shared desktop session %s" % session_name, loglevel=x2go.loglevel_INFO, ) self._X2GoClient__terminate_session(self.x2go_session_hash) - time.sleep(2) + sleep(2) self._pyhoca_logger("X2Go session %s has been terminated" % session_name, loglevel=x2go.loglevel_NOTICE, ) elif self.args.terminate_on_ctrl_c: self._pyhoca_logger("Terminating X2Go session %s" % session_name, loglevel=x2go.loglevel_INFO, ) self._X2GoClient__terminate_session(self.x2go_session_hash) # giving nxproxy's SSH tunnel some time to settle - time.sleep(2) + sleep(2) self._pyhoca_logger("X2Go session %s has been terminated" % session_name, loglevel=x2go.loglevel_NOTICE, ) else: self._pyhoca_logger("Suspending X2Go session %s" % session_name, loglevel=x2go.loglevel_INFO, ) self._X2GoClient__suspend_session(self.x2go_session_hash) # giving nxproxy's SSH tunnel some time to settle - time.sleep(2) + sleep(2) self._pyhoca_logger("X2Go session %s has been suspended" % session_name, loglevel=x2go.loglevel_NOTICE, ) except x2go.X2GoSessionException as e: -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pyhoca-cli.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository pyhoca-cli. commit 75f53ca91bd6ce55448e8b6166862f1b48e37df1 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Sep 18 16:39:29 2018 +0000 Set specific 'Passphrase: ' prompt (not 'Password: ') when we query for SSH key passphrases. --- pyhoca/cli/frontend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyhoca/cli/frontend.py b/pyhoca/cli/frontend.py index 7a85410..4d94bf5 100644 --- a/pyhoca/cli/frontend.py +++ b/pyhoca/cli/frontend.py @@ -533,7 +533,7 @@ class PyHocaCLI(x2go.X2GoClient): if passphrase == '': self._pyhoca_logger('empty SSH key passphrase (%s), try again...' % self.args.ssh_privkey, loglevel=x2go.loglevel_WARN, ) self._pyhoca_logger('unlock SSH key file (%s)' % self.args.ssh_privkey, loglevel=x2go.loglevel_NOTICE, ) - passphrase = getpass.getpass() + passphrase = getpass.getpass('Passphrase: ') passphrase_unlock_counter -= 1 # undo auth counter decrement _auth_count += 1 @@ -594,7 +594,7 @@ class PyHocaCLI(x2go.X2GoClient): if passphrase is not None and passphrase != '': self._pyhoca_logger('wrong SSH key passphrase (%s), try again...' % self.args.ssh_privkey, loglevel=x2go.loglevel_WARN, ) self._pyhoca_logger('unlock SSH key file (%s)' % self.args.ssh_privkey, loglevel=x2go.loglevel_NOTICE, ) - passphrase = getpass.getpass() + passphrase = getpass.getpass('Passphrase: ') passphrase_unlock_counter -= 1 # undo auth counter decrement _auth_count += 1 -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pyhoca-cli.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository pyhoca-cli. commit e8dacb1ff7ef2435ee68e83b59d91bfb22a04395 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Sep 18 18:41:38 2018 +0200 Fix --share-local-folders (aka -F) option and really mount shared folders. (Fixes: #984). --- debian/changelog | 2 ++ pyhoca/cli/frontend.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index d0b46a4..1e88d5a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,8 @@ pyhoca-cli (0.5.99.1-0x2go2) UNRELEASED; urgency=medium - Add --forward-sshagent / -A cmdline option for enabling SSH agent forwarding. - Entirely rewrite PyHocaCLI.authenticate() function. (Fixes: #1308). + - Fix --share-local-folders (aka -F) option and really mount shared folders. + (Fixes: #984). * debian/rules: + Build for Python3, not Python2. + Switch to pybuild DH build system. diff --git a/pyhoca/cli/frontend.py b/pyhoca/cli/frontend.py index 4d94bf5..01732cf 100644 --- a/pyhoca/cli/frontend.py +++ b/pyhoca/cli/frontend.py @@ -438,6 +438,8 @@ class PyHocaCLI(x2go.X2GoClient): if self.args.xinerama: xinerama = self.args.xinerama + allow_share_local_folders = bool(self.args.share_local_folders) + # setup up the manually configured X2Go session self.x2go_session_hash = self._X2GoClient__register_session(args.server, port=int(self.args.remote_ssh_port), known_hosts=ssh_known_hosts_filename, @@ -458,6 +460,7 @@ class PyHocaCLI(x2go.X2GoClient): print_action=self.args.print_action, print_action_args=self.args.print_action_args, share_local_folders=self.args.share_local_folders, + allow_share_local_folders=allow_share_local_folders, forward_sshagent=self.args.forward_sshagent, cmd=self.args.command) @@ -698,6 +701,9 @@ class PyHocaCLI(x2go.X2GoClient): sleep(1) i+=1 + session = self._X2GoClient__get_session(self.x2go_session_hash) + session.set_master_session() + if self._X2GoClient__session_ok(self.x2go_session_hash): profile_name = self._X2GoClient__get_session_profile_name(self.x2go_session_hash) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pyhoca-cli.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository pyhoca-cli. commit 61199c57ed64f652d3b2b495cb96112d7605e94b Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Sep 18 18:42:27 2018 +0200 debian/control: The fix for --share-local-folders requires a fixed Python X2Go (>= 0.6.0.1). --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 8ba8f89..a683ce7 100644 --- a/debian/control +++ b/debian/control @@ -23,7 +23,7 @@ Depends: ${misc:Depends}, ${python3:Depends}, python3, - python3-x2go (>=0.5.99.1-0~), + python3-x2go (>=0.6.0.1-0~), python3-setproctitle, Suggests: mteleplayer-clientside, -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pyhoca-cli.git