This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch release/4.0.1.x in repository x2goserver. from 8614849 x2goserver.spec: add correct Group: to x2goserver-logcheck package. new 6e1ea9e x2goserver/lib: new wrapper script x2goqueryconfig to fetch a config value out of the global x2goserver.conf file. new ad90563 x2goserver/etc/x2goserver.conf: add x2goagent.port_randomization configuration option. new c072251 x2goserver/bin/x2gostartagent: use x2goagent.port_randomization configuration value. The 3 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 | 9 ++++++ x2goserver/bin/x2gostartagent | 18 +++++------ x2goserver/etc/x2goserver.conf | 17 ++++++++++ .../lib/{x2gochangestatus => x2goqueryconfig} | 36 +++++++++++++--------- 4 files changed, 56 insertions(+), 24 deletions(-) copy x2goserver/lib/{x2gochangestatus => x2goqueryconfig} (59%) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goserver.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch release/4.0.1.x in repository x2goserver. commit ad9056356e9000ebeb00fd3d892e25c23673bb0c Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jan 1 06:02:37 2018 +0100 x2goserver/etc/x2goserver.conf: add x2goagent.port_randomization configuration option. Can be set to either "host-based" or "pure-random". --- debian/changelog | 3 +++ x2goserver/etc/x2goserver.conf | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/debian/changelog b/debian/changelog index 519e2f9..2074b7c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,9 @@ x2goserver (4.0.1.23-0x2go1) UNRELEASED; urgency=medium problem that required this workaround has been fixed a long time ago. - x2goserver/lib: new wrapper script x2goqueryconfig to fetch a config value out of the global x2goserver.conf file. + - x2goserver/etc/x2goserver.conf: add x2goagent.port_randomization + configuration option. Can be set to either "host-based" or + "pure-random". * x2goserver.spec: - RPMify x2goserver-xsession description. - Remove qt4 stuff, we're not using the framework here. diff --git a/x2goserver/etc/x2goserver.conf b/x2goserver/etc/x2goserver.conf index c9fe270..fa69e79 100644 --- a/x2goserver/etc/x2goserver.conf +++ b/x2goserver/etc/x2goserver.conf @@ -8,6 +8,23 @@ # SSHFS umask for client-side folder sharing. Leave uncommented to keep the server's default umask #umask="0117" +[x2goagent] +# Value can be either "host-based" or "pure-random". +# This is currently a workaround for a bug in X2Go Client, that uses a 1:1 +# mapping of source to destination ports for SSH tunnels. +# This leads to problems if opening two (or more) instances of X2Go Client +# and connecting to two machines that use the same tunneling ports. +# Such a scenario is easy to trigger: make sure that both machines have run +# no active sessions, than spawn one session on each machine. +# Connecting to both at the same time will not be possible without a means +# of randomization. +# The randomization can either be "host-based", in which case the port will +# be set to 30000 + (128 * last octet of IPv4 address) and does the job if +# the last octet of the machine's IPv4 address is known to be unique, or +# "pure-random" which uses the (not so truly random) bash ${RANDOM} +# variable to fully randomize the port, i.e., 30000 + random(0..32767). +port_randomization="pure-random" + [log] # possible levels are: emerg, alert, crit, err, warning, notice, info, debug loglevel=notice -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goserver.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch release/4.0.1.x in repository x2goserver. commit 6e1ea9e72568d4c317481fad09245a012b02096d Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jan 1 05:09:36 2018 +0100 x2goserver/lib: new wrapper script x2goqueryconfig to fetch a config value out of the global x2goserver.conf file. --- debian/changelog | 2 ++ x2goserver/lib/x2goqueryconfig | 46 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/debian/changelog b/debian/changelog index 967fbe2..519e2f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ x2goserver (4.0.1.23-0x2go1) UNRELEASED; urgency=medium * New upstream version (4.0.1.23): - x2goserver/bin/x2gostartagent: reenable XFIXES extension. The initial problem that required this workaround has been fixed a long time ago. + - x2goserver/lib: new wrapper script x2goqueryconfig to fetch a config + value out of the global x2goserver.conf file. * x2goserver.spec: - RPMify x2goserver-xsession description. - Remove qt4 stuff, we're not using the framework here. diff --git a/x2goserver/lib/x2goqueryconfig b/x2goserver/lib/x2goqueryconfig new file mode 100755 index 0000000..c67a7fe --- /dev/null +++ b/x2goserver/lib/x2goqueryconfig @@ -0,0 +1,46 @@ +#!/usr/bin/perl + +# Copyright (C) 2017-2018 X2Go Project - https://wiki.x2go.org +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +use strict; + +use Config::Simple; + +my $section = shift or die "Missing section argument"; +my $key = shift or die "Missing key argument"; + +if (!(length ($section))) { + die "Invalid (empty) section argument"; +} + +if (!(length ($key))) { + die "Invalid (empty) key argument"; +} + +my $Config = new Config::Simple (syntax => 'ini'); +$Config->read ('/etc/x2go/x2goserver.conf'); + +my $val = $Config->param("$section.$key"); + +if (defined ($val)) { + print "$val\n"; + exit 0; +} +else { + exit 1; +} -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goserver.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch release/4.0.1.x in repository x2goserver. commit c07225145f43c34217c11549ed986b86e7242e8a Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jan 1 06:04:30 2018 +0100 x2goserver/bin/x2gostartagent: use x2goagent.port_randomization configuration value. Currently only a value of "host-based" is directly mapped to the host-based algorithm, while any other value (or a failure of failure) are mapped to the "pure-random" code path. --- debian/changelog | 4 ++++ x2goserver/bin/x2gostartagent | 18 +++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2074b7c..abaa2da 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,10 @@ x2goserver (4.0.1.23-0x2go1) UNRELEASED; urgency=medium - x2goserver/etc/x2goserver.conf: add x2goagent.port_randomization configuration option. Can be set to either "host-based" or "pure-random". + - x2goserver/bin/x2gostartagent: use x2goagent.port_randomization + configuration value. Currently only a value of "host-based" is directly + mapped to the host-based algorithm, while any other value (or a failure + of failure) are mapped to the "pure-random" code path. * x2goserver.spec: - RPMify x2goserver-xsession description. - Remove qt4 stuff, we're not using the framework here. diff --git a/x2goserver/bin/x2gostartagent b/x2goserver/bin/x2gostartagent index ad82703..15e44ee 100755 --- a/x2goserver/bin/x2gostartagent +++ b/x2goserver/bin/x2gostartagent @@ -68,20 +68,20 @@ X2GO_LIB_PATH="$(x2gopath libexec)"; $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@" -# FIXME: this should be configurable option in x2goserver.conf. -# If you use hosts on a /24 network, you should probably set "0" here, -# as the addresses are unique. -# Each hosts SSH_PORT will be set to 30.000 + (128 * last octet of IP address) -# This results in no collisions on a /24 network with at least 128 ports -# for each host available for different sessions. -# If you select "1" here, the SSH_PORT will be set to 30000 + random(0..32767) +# Refer to x2goserver.conf. typeset -i randomize_ssh_port="1" +typeset randomize_ssh_port_config_value='' + +randomize_ssh_port_config_value="$(${X2GO_LIB_PATH}/x2goqueryconfig "x2goagent" "port_randomization")" + +# Failures or incorrect values are implicitly caught by the default value. +[[ "${randomize_ssh_port_config_value}" = "host-based" ]] && randomize_ssh_port='0' if [ "${randomize_ssh_port}" = "1" ]; then - ${X2GO_LIB_PATH}/x2gosyslog "$0" "debug" "SSH port randomization requested." + ${X2GO_LIB_PATH}/x2gosyslog "$0" "debug" "Full SSH port randomization requested." SSH_PORT="$(get_random_port)" else - ${X2GO_LIB_PATH}/x2gosyslog "$0" "debug" "IP-based SSH port initialization requested." + ${X2GO_LIB_PATH}/x2gosyslog "$0" "debug" "host-based SSH port initialization requested." typeset ip_address="$(get_server_ip_address)" if [ "$?" = "0" ]; then -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goserver.git