[X2Go-Commits] [x2goclient] 62/94: reintroducing the --password option secured by setproctitle
git-admin at x2go.org
git-admin at x2go.org
Fri Dec 15 21:04:46 CET 2023
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to annotated tag 0.1.4.0
in repository x2goclient.
commit 3ec0c5db1f8eb5c03d8aeeb2a2a09257ac691e81
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Tue May 17 11:47:52 2011 +0200
reintroducing the --password option secured by setproctitle
---
pyhoca-cli | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/pyhoca-cli b/pyhoca-cli
index 3e4c220f..8911499a 100755
--- a/pyhoca-cli
+++ b/pyhoca-cli
@@ -51,16 +51,18 @@ from x2go.defaults import DEFAULT_PDFSAVE_LOCATION
from x2go.defaults import DEFAULT_PRINTCMD_CMD
from pyhoca.cli import current_home, PyHocaCLI, runtime_error
+from x2go import X2GOCLIENT_OS as _X2GOCLIENT_OS
# version information
PROG_NAME = os.path.basename(sys.argv[0])
PROG_PID = os.getpid()
-
-from x2go import X2GOCLIENT_OS as _X2GOCLIENT_OS
+PROG_OPTIONS = sys.argv[1:]
+_password_index = PROG_OPTIONS.index('--password')+1
+PROG_OPTIONS[_password_index] = "XXXXXXXX"
if _X2GOCLIENT_OS in ('Linux', 'Mac'):
import setproctitle
- setproctitle.setproctitle(PROG_NAME)
+ setproctitle.setproctitle("%s %s" % (PROG_NAME, " ".join(PROG_OPTIONS)))
from pyhoca.cli import __VERSION__ as _version
VERSION=_version
@@ -104,6 +106,7 @@ 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':['--password'], 'default': None, 'help': 'user password for session 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':['--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)', },
@@ -187,6 +190,9 @@ Possible values for the --pack NX option are:
if a.libdebug_sftpxfer:
liblogger.enable_debug_sftpxfer()
+ if a.password and _X2GOCLIENT_OS == "Windows"
+ runtime_error("The --password option is forbidden on Windows platforms", parser=p, exitcode=222)
+
if a.version:
version()
@@ -194,9 +200,6 @@ Possible values for the --pack NX option are:
if a.username is None and not a.session_profile:
a.username = current_user
- # statically no password from the command line
- a.password = None
-
# time-to-wait needs to be an integer
try:
a.time_to_wait = int(a.time_to_wait)
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
More information about the x2go-commits
mailing list