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 e025795559deb766a1461f847aa0ede4f2f08771 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Jun 21 01:57:04 2014 +0200 x2golistdesktops: Also detect sharable desktop sessions behind abstract kernel namespace sockets. --- debian/changelog | 2 ++ x2goserver/bin/x2golistdesktops | 27 ++++++++++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index e9e18c0..318268a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -37,6 +37,8 @@ x2goserver (4.0.1.16-0x2go1) UNRELEASED; urgency=low script. - More reliably sync the NX session state with the status information in the X2Go session DB. + - x2golistdesktops: Also detect sharable desktop sessions behind abstract + kernel namespace sockets. * debian/control, x2goserver.spec: + Update versioned D: x2goagent (>= 3.5.0.25). This assures that X2Go works with poly-instantiated /tmp directories. diff --git a/x2goserver/bin/x2golistdesktops b/x2goserver/bin/x2golistdesktops index 4c58c5f..b4134a8 100755 --- a/x2goserver/bin/x2golistdesktops +++ b/x2goserver/bin/x2golistdesktops @@ -60,26 +60,32 @@ my $rdisp=join("I",@rdisplays); $rdisp="I${rdisp}I"; my $uname=$ENV{'USER'}; -my $outp=`ls -1 /tmp/.X11-unix/`; -my @outp=split("\n","$outp"); +my $lines=`ss -lxu`; +my @lines=split("\n", "$lines"); + +my @outp = grep ( /(@| )\/tmp\/.X11-unix\/X.*/, @lines); +my @displays; for(my $i=0;$i<@outp;$i++) { my $display=@outp[$i]; - $display=~s/X/:/; + $display=~s|.*/tmp/.X11-unix/X([0-9]*).*|:$1|; my $checkdisp=$display; $checkdisp=~s/:/I/; $checkdisp="${checkdisp}I"; if (!( $rdisp =~ m/$checkdisp/ )) { - my $inf=`xwininfo -root -display $display 2> /dev/null`; - if ( $inf=~ m/geometry/) - { - print "$uname\@$display\n"; + if ( grep { $_ eq "$uname\@$display" } @displays ) { + } else { + my $inf=system_capture_stdout_output("xwininfo", "-root", "-display", "$display"); + if ( $inf=~ m/geometry/) + { + push (@displays, "$uname\@$display"); + } } } } -$outp=`ls -1 /tmp/ | grep x2godesktopsharing_`; +my $outp=`ls -1 /tmp/ | grep x2godesktopsharing_`; @outp=split("\n","$outp"); for(my $i=0;$i<@outp;$i++) @@ -87,9 +93,12 @@ for(my $i=0;$i<@outp;$i++) my @ln=split("\@",@outp[$i]); if ( @ln[1] ne $uname ) { - print "@ln[1]\@@ln[2]\n"; + push (@displays, "@ln[1]\@@ln[2]\n"); } } +if (@displays) { + print "@displays\n"; +} # closing syslog closelog; -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git