This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository x2goserver. from b319ec8 debian/changelog: sync with release/4.0.1.x. new da2ab9b x2goserver/lib/x2go{sqlitewrapper.pl,utils.pm}: allow arbitrary-length user names, user names starting with digits and drop $ as a valid user name character. Fixes: #1229. new 21dc027 x2goserver/bin/x2goruncommand: use dbus-run-session to start a new dbus user session if available. new f5dcc1a debian/control: depend upon dbus for dbus-run-session. new 2e44140 x2goserver.spec: pull in dbus-run-session if possible. new 284c322 x2goserver/bin/x2goresume-session: backport HOSTNAME changes from x2goserver/bin/x2gostartagent. new 76b8ce8 x2goserver/bin/x2goresume-session: catch errors while inserting values into database more gracefully. Fixes: #1230. new c5db6f7 x2goserver/bin/x2gostartagent: write hostname errors to stderr to make X2Go Client (and maybe PyHoca?) fail. new 9e5fe10 x2goserver/{bin/x2go{runcommand,suspend-session},sbin/x2gocleansessions}: remove hopefully redundant HOSTNAME export commands. The 8 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: X2Go/Utils.pm | 18 +++++------- debian/changelog | 19 +++++++++++++ debian/control | 3 +- x2goserver.spec | 22 +++++++++++++++ x2goserver/bin/x2goresume-session | 56 +++++++++++++++++++++++++++++++------- x2goserver/bin/x2goruncommand | 11 ++++++-- x2goserver/bin/x2gostartagent | 33 ++++++++++++++++++++-- x2goserver/bin/x2gosuspend-session | 1 - x2goserver/sbin/x2gocleansessions | 10 +++---- 9 files changed, 141 insertions(+), 32 deletions(-) -- Alioth's /srv/git/code.x2go.org/x2goserver.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 master in repository x2goserver. commit da2ab9b1cd273e10d5c995db2eb3ac76aeff0c6a Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Nov 1 06:47:37 2017 +0100 x2goserver/lib/x2go{sqlitewrapper.pl,utils.pm}: allow arbitrary-length user names, user names starting with digits and drop $ as a valid user name character. Fixes: #1229. Cherry-picked from release/4.0.1.x branch. X2Go/Utils.pm: backport user name regex changes. --- X2Go/Utils.pm | 18 +++++++----------- debian/changelog | 4 ++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/X2Go/Utils.pm b/X2Go/Utils.pm index f47c5b8..7f9e0a5 100644 --- a/X2Go/Utils.pm +++ b/X2Go/Utils.pm @@ -121,21 +121,17 @@ sub sanitizer { return $string; } else {return 0;} } elsif ($type eq "pnixusername") { - $string =~ s/[^a-zA-Z0-9\_\-\.]//g; - if ($string =~ /^([a-zA-Z\_][a-zA-Z0-9\_\-\.]{0,47}[\$]?)$/) { + $string =~ s/[^a-zA-Z0-9\.\_\-\@]//g; + if ($string =~ /^([a-zA-Z0-9\.\_][a-zA-Z0-9\.\_\-\@]*)$/) { $string = $1; - if ((length($1) > 0) and (length($1) < 48)){ - return $string; - } else {return 0;} + return $string; } else {return 0;} } elsif ($type eq "x2gosid") { - $string =~ s/[^a-zA-Z0-9\_\-\$\.\@]//g; - if ($string =~ /^([a-zA-Z0-9\_\-\$\.\@]*)$/) { + $string =~ s/[^a-zA-Z0-9\.\_\-\@]//g; + if ($string =~ /^([a-zA-Z0-9\.\_\-\@]*)$/) { $string = $1; - if ($string =~ /^([a-zA-Z\_][a-zA-Z0-9\_\-\.\@]{0,47}[\$]?)\-([\d]{2,4})\-([\d]{9,12})\_[a-zA-Z0-9\_\-\.]*\_dp[\d]{1,2}$/) { - if ((length($1) > 0) and (length($1) < 48)){ - return $string; - } else {return 0;} + if ($string =~ /^([a-zA-Z0-9\.\_][a-zA-Z0-9\.\_\-\@]*)\-([\d]{2,4})\-([\d]{9,12})\_[a-zA-Z0-9\.\_\-]*\_dp[\d]{1,2}$/) { + return $string; } else {return 0;} } else {return 0;} } elsif ($type eq "SOMETHINGELSE") { diff --git a/debian/changelog b/debian/changelog index 0890dfa..dc814eb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -195,6 +195,7 @@ x2goserver (4.1.0.0-0x2go1.2) UNRELEASED; urgency=low debugging capabilities to POD. - README.md: whitespace fixes and typo correction. - X2Go/Server/DB/SQLite3.pm: fix command name in error messages. + - X2Go/Utils.pm: backport user name regex changes. * x2goserver.spec: - Only create session DB in x2goserver's post install script. Do use proper Requires(post) statements to make sure perl-X2Go-Server-DB and @@ -291,6 +292,9 @@ x2goserver (4.0.1.21-0x2go1) UNRELEASED; urgency=medium - x2goserver/{bin/x2golistshadowsessions, lib/x2go{dbwrapper.pm,sqlitewrapper.pl}}: backport listshadowsessions* DB functions and unmark them as FIXME entries. + - x2goserver/lib/x2go{sqlitewrapper.pl,utils.pm}: allow arbitrary-length + user names, user names starting with digits and drop $ as a valid user + name character. Fixes: #1229. * x2goserver.spec: - Add mandatory perl-generators Build-Requires as per https://fedoraproject.org/wiki/Changes/Build_Root_Without_Perl -- Alioth's /srv/git/code.x2go.org/x2goserver.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 master in repository x2goserver. commit 21dc027805b14e7651300c16d13f0d6268836833 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Nov 1 08:36:50 2017 +0100 x2goserver/bin/x2goruncommand: use dbus-run-session to start a new dbus user session if available. Only for full desktop sessions. Backported from a Debian patch. Cherry-picked from release/4.0.1.x branch. --- debian/changelog | 3 +++ x2goserver/bin/x2goruncommand | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index dc814eb..7b20f55 100644 --- a/debian/changelog +++ b/debian/changelog @@ -295,6 +295,9 @@ x2goserver (4.0.1.21-0x2go1) UNRELEASED; urgency=medium - x2goserver/lib/x2go{sqlitewrapper.pl,utils.pm}: allow arbitrary-length user names, user names starting with digits and drop $ as a valid user name character. Fixes: #1229. + - x2goserver/bin/x2goruncommand: use dbus-run-session to start a new dbus + user session if available. Only for full desktop sessions. Backported + from a Debian patch. * x2goserver.spec: - Add mandatory perl-generators Build-Requires as per https://fedoraproject.org/wiki/Changes/Build_Root_Without_Perl diff --git a/x2goserver/bin/x2goruncommand b/x2goserver/bin/x2goruncommand index 5b5cf4f..c099ec5 100755 --- a/x2goserver/bin/x2goruncommand +++ b/x2goserver/bin/x2goruncommand @@ -364,8 +364,16 @@ if [ "$EXEC" != "" ] && [ -x "$EXEC" ]; then if x2gofeature X2GO_XSESSION &>/dev/null && [ "x$X2GO_SESS_TYPE" = "xD" ]; then STARTUP="$cmd$args" + + # Search for dbus-run-session and handle the non-existence (to some extent) gracefully. + typeset dbus_wrapper="$(type -P "dbus-run-session")" + "$X2GO_LIB_PATH/x2gosyslog" "$0" "notice" "launching session with Xsession-x2go mechanism, using STARTUP=\"$STARTUP\"" - XSESSION_EXEC="$cmd" STARTUP="/usr/bin/env LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ${STARTUP}" /etc/x2go/Xsession >> "$MESSAGE_FILE" 2>&1 + typeset dbus_wrapper_msg="available as ${dbus_wrapper}" + [[ -z "${dbus_wrapper}" ]] && dbus_wrapper_msg="not available" + "${X2GO_LIB_PATH}/x2gosyslog" "${0}" "notice" "dbus wrapper ${dbus_wrapper_msg}" + + XSESSION_EXEC="$cmd" STARTUP="/usr/bin/env LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ${STARTUP}" ${dbus_wrapper} /etc/x2go/Xsession >> "$MESSAGE_FILE" 2>&1 else "$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "executing command \"$cmd$args\"..." -- Alioth's /srv/git/code.x2go.org/x2goserver.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 master in repository x2goserver. commit f5dcc1a99056fed98c73101a5cae5f59710c13f9 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Nov 1 08:38:54 2017 +0100 debian/control: depend upon dbus for dbus-run-session. Cherry-picked from release/4.0.1.x branch. --- debian/changelog | 1 + debian/control | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 7b20f55..f98e676 100644 --- a/debian/changelog +++ b/debian/changelog @@ -343,6 +343,7 @@ x2goserver (4.0.1.21-0x2go1) UNRELEASED; urgency=medium * debian/control: - Whitespace fixes. - Add BD on dh-systemd. We'll need it for systemd integration. + - Depend upon dbus for dbus-run-session. * debian/rules: - Call the systemd addon to process and install the systemd service file. - Don't fail if we don't have the systemd addon. Systems that don't have diff --git a/debian/control b/debian/control index f357bfb..a39e781 100644 --- a/debian/control +++ b/debian/control @@ -256,7 +256,8 @@ Depends: ${misc:Depends}, x2goserver (>= ${source:Version}), x2goserver (<< ${source:Version}.1~), x11-common, - perl-modules + perl-modules, + dbus Description: X2Go Server (Xsession runner) X2Go is a server based computing environment with - session resuming -- Alioth's /srv/git/code.x2go.org/x2goserver.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 master in repository x2goserver. commit 2e44140cb830131d666643e27435324963bfff42 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Nov 1 08:40:13 2017 +0100 x2goserver.spec: pull in dbus-run-session if possible. Only available on Fedora, SLE12+ and OpenSuSE 13+. Cherry-picked from release/4.0.1.x branch. --- debian/changelog | 2 ++ x2goserver.spec | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/debian/changelog b/debian/changelog index f98e676..3c717f0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -338,6 +338,8 @@ x2goserver (4.0.1.21-0x2go1) UNRELEASED; urgency=medium of errors. Split these up into nested conditions. - There is no %trans scriptlet, we're using %posttrans, so the dependency should be specified as Requires(posttrans) as well. + - Pull in dbus-run-session if possible. Only available on Fedora, SLE12+ + and OpenSuSE 13+. * debian/po: - Tiny fixup on author name. * debian/control: diff --git a/x2goserver.spec b/x2goserver.spec index 1dbf44f..d8fc9b5 100644 --- a/x2goserver.spec +++ b/x2goserver.spec @@ -419,6 +419,28 @@ Requires: xinit %else Requires: xorg-x11-xinit %endif + +# dbus-run-session is tricky, so using a separate section for it. +# For *SuSE: +# It's only available on SLE 12+ and OpenSuSE 13+. +# With OpenSuSE Leap 42.3, it was migrated from dbus-1-x11 to dbus-1. +# For CentOS: +# Not available at all. +# For Fedora: +# Supported on all versions we care about as part of the dbus package. +%if 0%{?suse_version} +%if 0%{?suse_version} >= 1300 +%if 0%{?sle_version} >= 120300 && 0%{?is_opensuse} +Requires: dbus-1 +%else +Requires: dbus-1-x11 +%endif +%endif +%endif +%if 0%{?fedora} +Requires: dbus +%endif + %if 0%{?fedora} || 0%{?rhel} Group: Applications/Communications %else -- Alioth's /srv/git/code.x2go.org/x2goserver.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 master in repository x2goserver. commit 284c3222f62c3abd08081a6716df4caa18fc80e5 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Nov 1 09:33:28 2017 +0100 x2goserver/bin/x2goresume-session: backport HOSTNAME changes from x2goserver/bin/x2gostartagent. Cherry-picked from release/4.0.1.x branch. --- debian/changelog | 2 ++ x2goserver/bin/x2goresume-session | 47 ++++++++++++++++++++++++++++++--------- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3c717f0..4a2cdbb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -298,6 +298,8 @@ x2goserver (4.0.1.21-0x2go1) UNRELEASED; urgency=medium - x2goserver/bin/x2goruncommand: use dbus-run-session to start a new dbus user session if available. Only for full desktop sessions. Backported from a Debian patch. + - x2goserver/bin/x2goresume-session: backport HOSTNAME changes from + x2goserver/bin/x2gostartagent. * x2goserver.spec: - Add mandatory perl-generators Build-Requires as per https://fedoraproject.org/wiki/Changes/Build_Root_Without_Perl diff --git a/x2goserver/bin/x2goresume-session b/x2goserver/bin/x2goresume-session index 7babfc8..b8845f1 100755 --- a/x2goserver/bin/x2goresume-session +++ b/x2goserver/bin/x2goresume-session @@ -45,6 +45,33 @@ X2GO_ROOT="${HOME}/.x2go" X2GO_RESIZE=0 X2GO_FULLSCREEN=0 +# ${HOSTNAME} should be automatically set by bash via gethostname(2), IFF this +# variable is not already set in the environment. +# +# This leads to two problems: +# - export HOSTNAME="malbox"; x2gostartagent will override the actual system +# host name and lead to authorization failures when connecting to +# x2goagent/nxagent later on. +# - even if the above is not the case, the value returned by gethostname(2) +# could either be a FQDN, the short name or anything in between. glibc +# seems to return the short name on Linux, since it calls uname(2), which +# typically does not include a domain, but *BSD seems to default to +# the FQDN. We explicitly need the short name. +# +# Workaround: use hostname -s, which luckily is portable enough to be available +# on a wide variety of systems. +typeset current_host_name="" +current_host_name="$(hostname -s)" + +if [[ "${?}" -ne "0" ]]; then + typeset msg="Unable to retrieve machine's hostname. This is required. Aborting session startup." + "${X2GO_LIB_PATH}/x2gosyslog" "${0}" "err" "${msg}" + + # Make x2goclient fail. + echo "${msg}" >&2 + exit 1 +fi + # refresh up ssh-agent-forwarding socket file symlink X2GOSSH_AUTH_SOCK="$X2GO_ROOT/C-$SESSION_NAME/ssh-agent.PID" if [ -L "$X2GOSSH_AUTH_SOCK" ]; then @@ -157,17 +184,17 @@ USED_PORTS=$( #check if saved in DB ports free if grep -q "|${GR_PORT}|" <<<$SYSTEM_PORTS ; then $X2GO_LIB_PATH/x2gosyslog "$0" "debug" "port $GR_PORT is already in use" - $X2GO_LIB_PATH/x2gormport "$HOSTNAME" "$SESSION_NAME" "$GR_PORT" + "${X2GO_LIB_PATH}/x2gormport" "${current_host_name}" "${SESSION_NAME}" "${GR_PORT}" GR_PORT="" fi if grep -q "|${SOUND_PORT}|" <<<$SYSTEM_PORTS ; then $X2GO_LIB_PATH/x2gosyslog "$0" "debug" "port $SOUND_PORT is already in use" - $X2GO_LIB_PATH/x2gormport "$HOSTNAME" "$SESSION_NAME" "$SOUND_PORT" + "${X2GO_LIB_PATH}/x2gormport" "${current_host_name}" "${SESSION_NAME}" "${SOUND_PORT}" SOUND_PORT="" fi if grep -q "|${FS_PORT}|" <<<$SYSTEM_PORTS ; then $X2GO_LIB_PATH/x2gosyslog "$0" "debug" "port "$FS_PORT" is already in use" - $X2GO_LIB_PATH/x2gormport "$HOSTNAME" "$SESSION_NAME" "$FS_PORT" + "${X2GO_LIB_PATH}/x2gormport" "${current_host_name}" "${SESSION_NAME}" "${FS_PORT}" FS_PORT="" fi @@ -176,17 +203,17 @@ if [ "x$X2GO_TELEKINESIS_ENABLED" == "x1" ]; then TEKIDATA_PORT=`echo "$SESSIONINFO" | awk -F, {'print $16'}` if grep -q "|${TEKICTRL_PORT}|" <<<$SYSTEM_PORTS ; then $X2GO_LIB_PATH/x2gosyslog "$0" "debug" "port "$TEKICTRL_PORT" is already in use" - $X2GO_LIB_PATH/x2gormport "$HOSTNAME" "$SESSION_NAME" "$TEKICTRL_PORT" + "${X2GO_LIB_PATH}/x2gormport" "${current_host_name}" "${SESSION_NAME}" "${TEKICTRL_PORT}" TEKICTRL_PORT="" fi if grep -q "|${TEKIDATA_PORT}|" <<<$SYSTEM_PORTS ; then $X2GO_LIB_PATH/x2gosyslog "$0" "debug" "port "$TEKIDATA_PORT" is already in use" - $X2GO_LIB_PATH/x2gormport "$HOSTNAME" "$SESSION_NAME" "$TEKIDATA_PORT" + "${X2GO_LIB_PATH}/x2gormport" "${current_host_name}" "${SESSION_NAME}" "${TEKIDATA_PORT}" TEKIDATA_PORT="" fi else - $X2GO_LIB_PATH/x2gormport "$HOSTNAME" "$SESSION_NAME" "$TEKICTRL_PORT" - $X2GO_LIB_PATH/x2gormport "$HOSTNAME" "$SESSION_NAME" "$TEKIDATA_PORT" + "${X2GO_LIB_PATH}/x2gormport" "${current_host_name}" "${SESSION_NAME}" "${TEKICTRL_PORT}" + "${X2GO_LIB_PATH}/x2gormport" "${current_host_name}" "${SESSION_NAME}" "${TEKIDATA_PORT}" TEKICTRL_PORT="0" TEKIDATA_PORT="0" fi @@ -194,7 +221,7 @@ fi SSH_PORT=30000 #First ssh port 30001 #Get all used in system ports from X2Go database and netstat output -USED_PORTS=`$X2GO_LIB_PATH/x2gogetports "$HOSTNAME"; netstat -nt -all | awk '{ n=split($0,lines,"\n"); for(i=1;i<=n;i++){split (lines[i],words," ");delim=split(words[4],ports,":"); if(delim>1)printf ("|%s|\n",ports[delim])} }'` +USED_PORTS="$("${X2GO_LIB_PATH}/x2gogetports" "${current_host_name}"; netstat -nt -all | awk '{ n=split($0,lines,"\n"); for(i=1;i<=n;i++){split (lines[i],words," ");delim=split(words[4],ports,":"); if(delim>1)printf ("|%s|\n",ports[delim])} }')" while [ "$GR_PORT" == "" ] || [ "$SOUND_PORT" == "" ] || [ "$FS_PORT" == "" ] || [ "$TEKICTRL_PORT" == "" ] || [ "$TEKIDATA_PORT" == "" ]; do OUTPUT="" @@ -207,7 +234,7 @@ while [ "$GR_PORT" == "" ] || [ "$SOUND_PORT" == "" ] || [ "$FS_PORT" == "" ] || #check if port in /etc/services SERV=`grep $SSH_PORT /etc/services` if [ "$SERV" == "" ]; then - OUTPUT=`$X2GO_LIB_PATH/x2goinsertport "$HOSTNAME" "$SESSION_NAME" "$SSH_PORT"` + OUTPUT="$("${X2GO_LIB_PATH}/x2goinsertport" "${current_host_name}" "$SESSION_NAME" "$SSH_PORT")" fi done if [ "$GR_PORT" == "" ]; then @@ -277,7 +304,7 @@ fi X2GO_CLIENT=`echo "$SSH_CLIENT" | awk '{print $1}'` if [ "$X2GO_CLIENT" == "" ] then - X2GO_CLIENT="$HOSTNAME" + X2GO_CLIENT="${current_host_name}" fi echo "$NEWOPTIONS" >"${SESSION_DIR}/options" -- Alioth's /srv/git/code.x2go.org/x2goserver.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 master in repository x2goserver. commit 76b8ce8dfb7595b76384e1147c4ae6cabc193ee8 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Nov 1 09:34:53 2017 +0100 x2goserver/bin/x2goresume-session: catch errors while inserting values into database more gracefully. Fixes: #1230. Cherry-picked from release/4.0.1.x branch. --- debian/changelog | 2 ++ x2goserver/bin/x2goresume-session | 9 +++++++++ x2goserver/bin/x2gostartagent | 29 ++++++++++++++++++++++++++++- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 4a2cdbb..28f4447 100644 --- a/debian/changelog +++ b/debian/changelog @@ -300,6 +300,8 @@ x2goserver (4.0.1.21-0x2go1) UNRELEASED; urgency=medium from a Debian patch. - x2goserver/bin/x2goresume-session: backport HOSTNAME changes from x2goserver/bin/x2gostartagent. + - x2goserver/bin/x2go{resume-session,startagent}: catch errors while + inserting values into database more gracefully. Fixes: #1230. * x2goserver.spec: - Add mandatory perl-generators Build-Requires as per https://fedoraproject.org/wiki/Changes/Build_Root_Without_Perl diff --git a/x2goserver/bin/x2goresume-session b/x2goserver/bin/x2goresume-session index b8845f1..5e350f2 100755 --- a/x2goserver/bin/x2goresume-session +++ b/x2goserver/bin/x2goresume-session @@ -235,6 +235,15 @@ while [ "$GR_PORT" == "" ] || [ "$SOUND_PORT" == "" ] || [ "$FS_PORT" == "" ] || SERV=`grep $SSH_PORT /etc/services` if [ "$SERV" == "" ]; then OUTPUT="$("${X2GO_LIB_PATH}/x2goinsertport" "${current_host_name}" "$SESSION_NAME" "$SSH_PORT")" + + if [[ "${?}" -ne "0" ]]; then + typeset msg="Unable to insert new port into database; parameters: hostname (${current_host_name}), session name (${SESSION_NAME}) and port (${SSH_PORT})." + "${X2GO_LIB_PATH}/x2gosyslog" "${0}" "err" "${msg}" + + # Make x2goclient fail. + echo "${msg}" >&2 + exit 1 + fi fi done if [ "$GR_PORT" == "" ]; then diff --git a/x2goserver/bin/x2gostartagent b/x2goserver/bin/x2gostartagent index f005cd8..794853d 100755 --- a/x2goserver/bin/x2gostartagent +++ b/x2goserver/bin/x2gostartagent @@ -341,11 +341,29 @@ while [ "$OUTPUT" != "inserted" ]; do if [ -n "$SHADREQ_USER" ]; then $X2GO_LIB_PATH/x2gosyslog "$0" "debug" "initializing new shadow session with ID $SESSION_NAME" OUTPUT=`$X2GO_LIB_PATH/x2goinsertshadowsession "$X2GO_PORT" "${current_host_name}" "$SESSION_NAME" "$SHADREQ_USER"` + + if [[ "${?}" -ne "0" ]]; then + typeset msg="Unable to insert new session into database; parameters: port (${X2GO_PORT}), hostname (${current_host_name}), session name (${SESSION_NAME}) and user requesting desktop sharing permissions (${SHADREQ_USER})." + "${X2GO_LIB_PATH}/x2gosyslog" "${0}" "err" "${msg}" + + # Make x2goclient fail. + echo "${msg}" >&2 + exit 1 + fi else $X2GO_LIB_PATH/x2gosyslog "$0" "debug" "initializing new session with ID $SESSION_NAME" OUTPUT=`$X2GO_LIB_PATH/x2goinsertsession "$X2GO_PORT" "${current_host_name}" "$SESSION_NAME"` + + if [[ "${?}" -ne "0" ]]; then + typeset msg="Unable to insert new session into database; parameters: port (${X2GO_PORT}), hostname (${current_host_name}) and session name (${SESSION_NAME})." + "${X2GO_LIB_PATH}/x2gosyslog" "${0}" "err" "${msg}" + + # Make x2goclient fail. + echo "${msg}" >&2 + exit 1 + fi fi - fi + fi done if [ "x$X2GO_TELEKINESIS_ENABLED" == "x0" ] || [ "x$X2GO_STYPE" = "xS" ] || ! type -p telekinesis-server 1>/dev/null; then @@ -373,6 +391,15 @@ while [ "$GR_PORT" == "" ] || [ "$SOUND_PORT" == "" ] || [ "$FS_PORT" == "" ] || SERV=`grep $SSH_PORT /etc/services` if [ "$SERV" == "" ]; then OUTPUT=`$X2GO_LIB_PATH/x2goinsertport "${current_host_name}" "$SESSION_NAME" "$SSH_PORT"` + + if [[ "${?}" -ne "0" ]]; then + typeset msg="Unable to insert new port into database; parameters: hostname (${current_host_name}), session name (${SESSION_NAME}) and port (${SSH_PORT})." + "${X2GO_LIB_PATH}/x2gosyslog" "${0}" "err" "${msg}" + + # Make x2goclient fail. + echo "${msg}" >&2 + exit 1 + fi fi done -- Alioth's /srv/git/code.x2go.org/x2goserver.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 master in repository x2goserver. commit c5db6f75e00b8797088cf75a2156406945a46308 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Nov 1 09:43:21 2017 +0100 x2goserver/bin/x2gostartagent: write hostname errors to stderr to make X2Go Client (and maybe PyHoca?) fail. Cherry-picked from release/4.0.1.x branch. --- debian/changelog | 2 ++ x2goserver/bin/x2gostartagent | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 28f4447..0e59b87 100644 --- a/debian/changelog +++ b/debian/changelog @@ -302,6 +302,8 @@ x2goserver (4.0.1.21-0x2go1) UNRELEASED; urgency=medium x2goserver/bin/x2gostartagent. - x2goserver/bin/x2go{resume-session,startagent}: catch errors while inserting values into database more gracefully. Fixes: #1230. + - x2goserver/bin/x2gostartagent: write hostname errors to stderr to make + X2Go Client (and maybe PyHoca?) fail. * x2goserver.spec: - Add mandatory perl-generators Build-Requires as per https://fedoraproject.org/wiki/Changes/Build_Root_Without_Perl diff --git a/x2goserver/bin/x2gostartagent b/x2goserver/bin/x2gostartagent index 794853d..deb3a41 100755 --- a/x2goserver/bin/x2gostartagent +++ b/x2goserver/bin/x2gostartagent @@ -139,8 +139,10 @@ current_host_name="$(hostname -s)" if [[ "${?}" -ne "0" ]]; then typeset msg="Unable to retrieve machine's hostname. This is required. Aborting session startup." - echo "${msg}" "${X2GO_LIB_PATH}/x2gosyslog" "${0}" "err" "${msg}" + + # Make x2goclient fail. + echo "${msg}" >&2 exit 1 fi -- Alioth's /srv/git/code.x2go.org/x2goserver.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 master in repository x2goserver. commit 9e5fe109444c0f9672706bd61a2d140488f77ae3 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Nov 1 09:39:31 2017 +0100 x2goserver/{bin/x2go{runcommand,suspend-session},sbin/x2gocleansessions}: remove hopefully redundant HOSTNAME export commands. Cherry-picked from release/4.0.1.x branch. --- debian/changelog | 3 +++ x2goserver/bin/x2goruncommand | 1 - x2goserver/bin/x2gosuspend-session | 1 - x2goserver/sbin/x2gocleansessions | 10 +++++----- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0e59b87..f7398ab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -304,6 +304,9 @@ x2goserver (4.0.1.21-0x2go1) UNRELEASED; urgency=medium inserting values into database more gracefully. Fixes: #1230. - x2goserver/bin/x2gostartagent: write hostname errors to stderr to make X2Go Client (and maybe PyHoca?) fail. + - x2goserver/{bin/x2go{runcommand,suspend-session}, + sbin/x2gocleansessions}: remove hopefully redundant HOSTNAME export + commands. * x2goserver.spec: - Add mandatory perl-generators Build-Requires as per https://fedoraproject.org/wiki/Changes/Build_Root_Without_Perl diff --git a/x2goserver/bin/x2goruncommand b/x2goserver/bin/x2goruncommand index c099ec5..676b0cf 100755 --- a/x2goserver/bin/x2goruncommand +++ b/x2goserver/bin/x2goruncommand @@ -420,7 +420,6 @@ x2gofeature X2GO_DESKTOPSHARING >/dev/null && x2goterminate-desktopsharing "$X2G kill -TERM "$X2GO_AGENT_PID" "$X2GO_LIB_PATH/x2gochangestatus" 'F' "$X2GO_SESSION" > /dev/null -export HOSTNAME x2goumount-session "$X2GO_SESSION" # run logout scripts diff --git a/x2goserver/bin/x2gosuspend-session b/x2goserver/bin/x2gosuspend-session index 42047b5..2bd8d0a 100755 --- a/x2goserver/bin/x2gosuspend-session +++ b/x2goserver/bin/x2gosuspend-session @@ -53,7 +53,6 @@ x2gofeature X2GO_DESKTOPSHARING &>/dev/null && x2gosuspend-desktopsharing "$SESS # run x2goserver-extensions for pre-suspend x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions "$SESSION_NAME" pre-suspend || true -export HOSTNAME x2goumount-session "$SESSION_NAME" STATE=`$X2GO_LIB_PATH/x2gogetagentstate "$SESSION_NAME"` diff --git a/x2goserver/sbin/x2gocleansessions b/x2goserver/sbin/x2gocleansessions index dbaa7c4..74895b8 100755 --- a/x2goserver/sbin/x2gocleansessions +++ b/x2goserver/sbin/x2gocleansessions @@ -270,7 +270,7 @@ elsif ($pid == 0 ) unlink("/tmp/.X$display-lock"); } log_message('debug', "@sinfo[1]: unmounting all shares"); - system( "su", "@sinfo[11]", "-s", "/bin/sh", "-c", "export HOSTNAME && x2goumount-session @sinfo[1]"); + system( "su", "@sinfo[11]", "-s", "/bin/sh", "-c", "x2goumount-session @sinfo[1]"); #remove port forwarding system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "$x2go_lib_path/x2gormforward @sinfo[1]"); } @@ -305,7 +305,7 @@ elsif ($pid == 0 ) unlink("/tmp/.X$display-lock"); } log_message('debug', "@sinfo[1]: unmounting all shares"); - system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "export HOSTNAME && x2goumount-session @sinfo[1]"); + system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "x2goumount-session @sinfo[1]"); } else { @@ -316,7 +316,7 @@ elsif ($pid == 0 ) system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "$x2go_lib_path/x2gochangestatus S @sinfo[1]"); log_message('debug', "@sinfo[1]: is suspended, changing status from @sinfo[4] to S"); log_message('debug', "@sinfo[1]: unmounting all shares"); - system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "export HOSTNAME && x2goumount-session @sinfo[1]"); + system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "x2goumount-session @sinfo[1]"); #remove port forwarding system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "$x2go_lib_path/x2gormforward @sinfo[1]"); } @@ -328,7 +328,7 @@ elsif ($pid == 0 ) # If it didn't change into suspended state by then, suspend it "forcefully". if ($remembered_sessions_status_since_iterations{@sinfo[1]} == 1) { log_message('debug', "@sinfo[1]: unmounting all shares"); - system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "export HOSTNAME && x2goumount-session @sinfo[1]"); + system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "x2goumount-session @sinfo[1]"); system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "x2gosuspend-session @sinfo[1]"); log_message('debug', "@sinfo[1]: was found running and has now been suspended"); } @@ -344,7 +344,7 @@ elsif ($pid == 0 ) if (!session_has_terminated(@sinfo[1],@sinfo[11])) { log_message('debug', "@sinfo[1]: unmounting all shares"); - system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "export HOSTNAME && x2goumount-session @sinfo[1]"); + system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "x2goumount-session @sinfo[1]"); system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "x2goterminate-session @sinfo[1]"); log_message('debug', "@sinfo[1]: termination has been requested via the session DB"); #remove port forwarding -- Alioth's /srv/git/code.x2go.org/x2goserver.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git