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 b2f033b x2goserver/{bin/x2golistshadowsessions,lib/x2go{dbwrapper.pm,sqlitewrapper.pl}}: backport listshadowsessions* DB functions and unmark them as FIXME entries. new 780622a 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 6415a7d x2goserver/bin/x2goruncommand: use dbus-run-session to start a new dbus user session if available. new cf548ef debian/control: depend upon dbus for dbus-run-session. new 4445a14 x2goserver.spec: pull in dbus-run-session if possible. new 6d87b74 x2goserver/bin/x2goresume-session: backport HOSTNAME changes from x2goserver/bin/x2gostartagent. new 80d2f2d x2goserver/bin/x2goresume-session: catch errors while inserting values into database more gracefully. Fixes: #1230. new 0c103b8 x2goserver/bin/x2gostartagent: write hostname errors to stderr to make X2Go Client (and maybe PyHoca?) fail. new 6e4ea44 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: debian/changelog | 18 ++++++++++++++ debian/control | 3 ++- x2goserver.spec | 22 +++++++++++++++++ x2goserver/bin/x2goresume-session | 48 ++++++++++++++++++++++++++++++++----- x2goserver/bin/x2goruncommand | 11 +++++++-- x2goserver/bin/x2gostartagent | 23 ++++++++++++++++-- x2goserver/bin/x2gosuspend-session | 1 - x2goserver/lib/x2gosqlitewrapper.pl | 10 ++++---- x2goserver/lib/x2goutils.pm | 10 ++++---- x2goserver/sbin/x2gocleansessions | 10 ++++---- 10 files changed, 127 insertions(+), 29 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 release/4.0.1.x in repository x2goserver. commit 80d2f2d9068f4bcdfeb98cf675a8505301bb7130 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. --- debian/changelog | 2 ++ x2goserver/bin/x2goresume-session | 9 +++++++++ x2goserver/bin/x2gostartagent | 19 ++++++++++++++++++- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b707326..533bd80 100644 --- a/debian/changelog +++ b/debian/changelog @@ -54,6 +54,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 8ac0fa6..292b09c 100755 --- a/x2goserver/bin/x2goresume-session +++ b/x2goserver/bin/x2goresume-session @@ -207,6 +207,15 @@ while [ "$GR_PORT" == "" ] || [ "$SOUND_PORT" == "" ] || [ "$FS_PORT" == "" ]; d 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 96783e7..a6062b4 100755 --- a/x2goserver/bin/x2gostartagent +++ b/x2goserver/bin/x2gostartagent @@ -333,7 +333,15 @@ while [ "$OUTPUT" != "inserted" ]; do SESSION_NAME=`echo "$SESSION_NAME" | perl -pe "s/[^a-zA-Z0-9\.\_\-\@]//g"` OUTPUT=`$X2GO_LIB_PATH/x2goinsertsession "$X2GO_PORT" "${current_host_name}" "$SESSION_NAME"` - fi + 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 done @@ -356,6 +364,15 @@ while [ "$GR_PORT" == "" ] || [ "$SOUND_PORT" == "" ] || [ "$FS_PORT" == "" ]; d 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 release/4.0.1.x in repository x2goserver. commit 780622ac76ed677e3c59aa65a6e487062e2ec31e 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. --- debian/changelog | 3 +++ x2goserver/lib/x2gosqlitewrapper.pl | 10 ++++------ x2goserver/lib/x2goutils.pm | 10 ++++------ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4d63a80..19045ff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -46,6 +46,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 diff --git a/x2goserver/lib/x2gosqlitewrapper.pl b/x2goserver/lib/x2gosqlitewrapper.pl index 4604c6e..49afad6 100755 --- a/x2goserver/lib/x2gosqlitewrapper.pl +++ b/x2goserver/lib/x2gosqlitewrapper.pl @@ -61,13 +61,11 @@ sub sanitizer { 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/x2goserver/lib/x2goutils.pm b/x2goserver/lib/x2goutils.pm index 9104f77..ebbcf2e 100644 --- a/x2goserver/lib/x2goutils.pm +++ b/x2goserver/lib/x2goutils.pm @@ -40,13 +40,11 @@ sub sanitizer { 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") { -- 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 release/4.0.1.x in repository x2goserver. commit 6415a7d98a819218ac6266d078e34de60f395528 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. --- debian/changelog | 3 +++ x2goserver/bin/x2goruncommand | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 19045ff..f6104f2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -49,6 +49,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 f807375..a71a117 100755 --- a/x2goserver/bin/x2goruncommand +++ b/x2goserver/bin/x2goruncommand @@ -315,8 +315,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 release/4.0.1.x in repository x2goserver. commit cf548ef109148e74457308c0a22f6a9186472ba5 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Nov 1 08:38:54 2017 +0100 debian/control: depend upon dbus for dbus-run-session. --- debian/changelog | 1 + debian/control | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f6104f2..ac5554a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -97,6 +97,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 3aea9e0..3c8c802 100644 --- a/debian/control +++ b/debian/control @@ -169,7 +169,8 @@ Depends: ${misc:Depends}, x2goserver (>= ${source:Version}), x2goserver (<< ${source:Version}.1~), x11-common, - perl-modules + perl-modules, + dbus Description: X2Go server daemon scripts (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 release/4.0.1.x in repository x2goserver. commit 4445a14e686533eb6bdce6320287dcb0ab819250 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+. --- debian/changelog | 2 ++ x2goserver.spec | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/debian/changelog b/debian/changelog index ac5554a..d20b570 100644 --- a/debian/changelog +++ b/debian/changelog @@ -92,6 +92,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 b800a25..2981fb7 100644 --- a/x2goserver.spec +++ b/x2goserver.spec @@ -277,6 +277,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 release/4.0.1.x in repository x2goserver. commit 6d87b749f5fd108498a44a243045186b03fde49f 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. --- debian/changelog | 2 ++ x2goserver/bin/x2goresume-session | 39 +++++++++++++++++++++++++++++++++------ 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index d20b570..b707326 100644 --- a/debian/changelog +++ b/debian/changelog @@ -52,6 +52,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 a90edc8..8ac0fa6 100755 --- a/x2goserver/bin/x2goresume-session +++ b/x2goserver/bin/x2goresume-session @@ -44,6 +44,33 @@ X2GO_ROOT="${HOME}/.x2go" X2GO_RESIZE=1 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 @@ -149,24 +176,24 @@ 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 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" == "" ]; do OUTPUT="" @@ -179,7 +206,7 @@ while [ "$GR_PORT" == "" ] || [ "$SOUND_PORT" == "" ] || [ "$FS_PORT" == "" ]; d #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 @@ -245,7 +272,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 release/4.0.1.x in repository x2goserver. commit 0c103b87fdabb73468efe43c983537d8f836ed2b 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. --- debian/changelog | 2 ++ x2goserver/bin/x2gostartagent | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 533bd80..d1bbbf7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -56,6 +56,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 a6062b4..2275f6b 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 release/4.0.1.x in repository x2goserver. commit 6e4ea44e48f46bcb0bc168ea007210ad1ad955b4 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. --- 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 d1bbbf7..78a7d70 100644 --- a/debian/changelog +++ b/debian/changelog @@ -58,6 +58,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 a71a117..efd250c 100755 --- a/x2goserver/bin/x2goruncommand +++ b/x2goserver/bin/x2goruncommand @@ -371,7 +371,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 8baac01..b7b7663 100755 --- a/x2goserver/bin/x2gosuspend-session +++ b/x2goserver/bin/x2gosuspend-session @@ -44,7 +44,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 721ea62..7983c0a 100755 --- a/x2goserver/sbin/x2gocleansessions +++ b/x2goserver/sbin/x2gocleansessions @@ -282,7 +282,7 @@ elsif ($pid == 0 ) unlink("/tmp/.X$display-lock"); } syslog('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]"); } @@ -306,7 +306,7 @@ elsif ($pid == 0 ) unlink("/tmp/.X$display-lock"); } syslog('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 { @@ -317,7 +317,7 @@ elsif ($pid == 0 ) system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "$x2go_lib_path/x2gochangestatus S @sinfo[1]"); syslog('debug', "@sinfo[1]: is suspended, changing status from @sinfo[4] to S"); syslog('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]"); } @@ -329,7 +329,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) { syslog('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]"); syslog('debug', "@sinfo[1]: was found running and has now been suspended"); } @@ -345,7 +345,7 @@ elsif ($pid == 0 ) if (!has_terminated(@sinfo[1],@sinfo[11])) { syslog('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]"); syslog('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