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 3ed0ad01fdc699099858202861f409eae9779584 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Oct 22 11:07:29 2014 +0200 Fix missing session list output if state file does not exist on the machine that runs x2golistsessions(_root). --- debian/changelog | 2 ++ x2goserver/bin/x2golistsessions | 34 ++++++++++++++++----------------- x2goserver/sbin/x2golistsessions_root | 18 ++++++++--------- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3ee5c9a..4c89683 100644 --- a/debian/changelog +++ b/debian/changelog @@ -34,6 +34,8 @@ x2goserver (4.0.1.19-0x2go1) UNRELEASED; urgency=medium /tmp dirs. These files are not accessible for that x2golistsessions script and should simply be ignored. (Fixes: #638). - Provide pam_namespace support for has_agent_state_file() function. + - Fix missing session list output if state file does not exist on the machine + that runs x2golistsessions(_root). * debian/control: + Add D (x2goserver): libfile-which-perl. * x2goserver.spec: diff --git a/x2goserver/bin/x2golistsessions b/x2goserver/bin/x2golistsessions index ad544f7..0b09954 100755 --- a/x2goserver/bin/x2golistsessions +++ b/x2goserver/bin/x2golistsessions @@ -122,28 +122,28 @@ for (my $i=0;$i<@outp;$i++) @outp[$i] =~ s/ //g; @outp[$i] =~ s/\*/ /g; my @sinfo=split('\\|',"@outp[$i]"); - if (@sinfo[4]eq 'F') - { + if (@sinfo[4]eq 'F') { print "@outp[$i]\n"; - } - elsif (has_agent_state_file(@sinfo[1], @sinfo[11])) - { - if (@sinfo[4]eq 'R') + } else { + if (has_agent_state_file(@sinfo[1], @sinfo[11])) { - if(is_suspended(@sinfo[1], @sinfo[11])) + if (@sinfo[4]eq 'R') { - db_changestatus( 'S', @sinfo[1]); - @outp[$i] =~ s/\|R\|/\|S\|/; - system("x2goumount-session", "@sinfo[1]"); - system("$x2go_lib_path/x2gormforward", "@sinfo[1]"); + if(is_suspended(@sinfo[1], @sinfo[11])) + { + db_changestatus( 'S', @sinfo[1]); + @outp[$i] =~ s/\|R\|/\|S\|/; + system("x2goumount-session", "@sinfo[1]"); + system("$x2go_lib_path/x2gormforward", "@sinfo[1]"); + } } - } - elsif (@sinfo[4]eq 'S') - { - if(is_running(@sinfo[1], @sinfo[11])) + elsif (@sinfo[4]eq 'S') { - db_changestatus( 'R', @sinfo[1] ); - @outp[$i] =~ s/\|S\|/\|R\|/; + if(is_running(@sinfo[1], @sinfo[11])) + { + db_changestatus( 'R', @sinfo[1] ); + @outp[$i] =~ s/\|S\|/\|R\|/; + } } } print "@outp[$i]\n"; diff --git a/x2goserver/sbin/x2golistsessions_root b/x2goserver/sbin/x2golistsessions_root index c6502f9..f8928ab 100755 --- a/x2goserver/sbin/x2golistsessions_root +++ b/x2goserver/sbin/x2golistsessions_root @@ -96,18 +96,18 @@ my @outp=split("\n","$outp"); for (my $i=0;$i<@outp;$i++) { my @sinfo=split('\\|',"@outp[$i]"); - if (@sinfo[4]eq 'F') - { + if (@sinfo[4]eq 'F') { print "@outp[$i]\n"; - } - elsif (has_agent_state_file(@sinfo[1],@sinfo[11])) - { - if (@sinfo[4]eq 'R') + } else { + if (has_agent_state_file(@sinfo[1],@sinfo[11])) { - if (is_suspended(@sinfo[1],@sinfo[11])) + if (@sinfo[4]eq 'R') { - system("su", "-", "@sinfo[11]", "-c", "$x2go_lib_path/x2gochangestatus 'S' @sinfo[1] > /dev/null"); - @outp[$i] =~ s/\|R\|/\|S\|/; + if (is_suspended(@sinfo[1],@sinfo[11])) + { + system("su", "-", "@sinfo[11]", "-c", "$x2go_lib_path/x2gochangestatus 'S' @sinfo[1] > /dev/null"); + @outp[$i] =~ s/\|R\|/\|S\|/; + } } } print "@outp[$i]\n"; -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git