The branch, build-baikal has been updated via 9d54d62536cb70a10e9f6705182688fc66c0f82b (commit) from 5773567bf183f2c1bf2d57fd5f05df8d086ce2ff (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: debian/changelog | 25 +++++++++++++++++++++ debian/rules | 1 + x2golistdesktops | 53 +++++++++++++++++++++++++++++++++++++++++++++ x2gomountdirs | 59 +++++++++++++++++++++++++++++++++++++++++++++++--- x2gopgwrapper | 26 ++++++++++++++++++++++ x2gopgwrapper_local | 4 ++-- x2gopgwrapper_net | 4 ++-- x2gopgwrapper_sqlite | 4 ++-- x2gostartagent | 55 +++++++++++++++++++++++++++++++++++++++++++++- 9 files changed, 221 insertions(+), 10 deletions(-) create mode 100755 x2golistdesktops The diff of changes is: diff --git a/debian/changelog b/debian/changelog index 410488f..7e4db68 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,28 @@ +x2goserver (3.0.1-9) unstable; urgency=low + + * changes in x2gomountdir to use with plasmoid + + -- Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> Mon, 07 Jun 2010 18:51:50 +0200 + +x2goserver (3.0.1-8) unstable; urgency=low + + * changes in db warppers - do not show shadow sessions in listsessions and listsessions_all + + -- Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> Tue, 01 Jun 2010 19:08:53 +0200 + +x2goserver (3.0.1-7) unstable; urgency=low + + * support for fs encodings in x2gomountdirs + + -- Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> Thu, 06 May 2010 18:34:42 +0200 + +x2goserver (3.0.1-6) unstable; urgency=low + + * fixed access mode for key in x2gomountdirs + * supoort for session sharing + + -- Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> Wed, 10 Feb 2010 10:52:34 +0100 + x2goserver (3.0.1-5) unstable; urgency=high * force mcookie auth for x2goagent diff --git a/debian/rules b/debian/rules index e02fb55..983e78f 100755 --- a/debian/rules +++ b/debian/rules @@ -57,6 +57,7 @@ install: build install x2gocmdexitmessage $(CURDIR)/debian/x2goserver/usr/bin/ install x2gogetservers $(CURDIR)/debian/x2goserver/usr/bin/ install x2golistsessions $(CURDIR)/debian/x2goserver/usr/bin/ + install x2golistdesktops $(CURDIR)/debian/x2goserver/usr/bin/ install x2golistsessions_root $(CURDIR)/debian/x2goserver/usr/bin/ install x2golistsessions_sql $(CURDIR)/debian/x2goserver/usr/bin/ install x2gomountdirs $(CURDIR)/debian/x2goserver/usr/bin/ diff --git a/x2golistdesktops b/x2golistdesktops new file mode 100755 index 0000000..4e5d050 --- /dev/null +++ b/x2golistdesktops @@ -0,0 +1,53 @@ +#!/usr/bin/perl +use strict; +use Sys::Hostname; + +my $serv=shift; +if( ! $serv) +{ + $serv=hostname; +} + +my $rsess=`x2golistsessions x2goserver |grep _stR`; +my @rsess=split("\n","$rsess"); +my @rdisplays; +for(my $i=0;$i<@rsess;$i++) +{ + my @sinfo=split("\\|",@rsess[$i]); + @rdisplays[$i]=@sinfo[2]; +} + +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"); +for(my $i=0;$i<@outp;$i++) +{ + my $display=@outp[$i]; + $display=~s/X/:/; + 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"; + } + } +} + +$outp=`ls -1 /tmp/ | grep x2godesktopsharing_`; +@outp=split("\n","$outp"); + +for(my $i=0;$i<@outp;$i++) +{ + my @ln=split("\@",@outp[$i]); + if( @ln[1] ne $uname ) + { + print "@ln[1]\@@ln[2]\n"; + } +} diff --git a/x2gomountdirs b/x2gomountdirs index fce9ef4..0a5bbb3 100755 --- a/x2gomountdirs +++ b/x2gomountdirs @@ -62,6 +62,8 @@ open (F,">$key.ident"); print F "$host $rsa_identity"; close(F); +chmod(0600,"$key"); +chmod(0600,"$key.ident"); my $mdir="/tmp/$ENV{'USER'}_media"; my $ldir="$ENV{'HOME'}/media"; @@ -74,6 +76,26 @@ if(! -e $mdir) } chmod(0700,$mdir); +if(! -e "$mdir/disk") +{ + mkdir("$mdir/disk"); +} +chmod(0700,"$mdir/disk"); + +if(! -e "$mdir/cd") +{ + mkdir("$mdir/cd"); +} +chmod(0700,"$mdir/cd"); + +if(! -e "$mdir/rm") +{ + mkdir("$mdir/rm"); +} +chmod(0700,"$mdir/rm"); + +my $plasmstamp=$mdir."/".$session.".plasmoid"; + if(! -e $spooldir) { mkdir($spooldir); @@ -126,6 +148,19 @@ for(my $i=0;$i<@dirs;$i++) if($type ne "dir") { $p=~s/\/ramdrive\/mnt\///; + if($p =~ m/CDROM/) + { + $mdir=$mdir."/cd"; + } + else + { + $mdir=$mdir."/rm"; + } + + } + else + { + $mdir=$mdir."/disk"; } $p=~s/\//_/g; $p=~s/ /_/g; @@ -140,11 +175,29 @@ for(my $i=0;$i<@dirs;$i++) print "result: $outp"; if($outp =~ m/INSERT/) { - print "inserted,\nsshfs -o IdentityFile=$key,UserKnownHostsFile=$key.ident $user\@$host:\"@dirs[$i]\" \"$mntpath\" -p $port\n"; - if(system("sshfs -o ServerAliveInterval=300,Cipher=blowfish,IdentityFile=$key,UserKnownHostsFile=$key.ident $user\@$host:\"@dirs[$i]\" \"$mntpath\" -p $port 2>>~/mounts.log")==0) + my $code_conv=$ENV{'X2GO_ICONV'}; + if($code_conv ne "") + { + $code_conv="-o $code_conv"; + } + print "inserted,\nsshfs $code_conv -o IdentityFile=$key,UserKnownHostsFile=$key.ident $user\@$host:\"@dirs[$i]\" \"$mntpath\" -p $port\n"; + if(system("sshfs $code_conv -o ServerAliveInterval=300,Cipher=blowfish,IdentityFile=$key,UserKnownHostsFile=$key.ident $user\@$host:\"@dirs[$i]\" \"$mntpath\" -p $port 2>>~/mounts.log")==0) { print "mount @dirs[$i] ok\n"; - if(! $printspool) + + # check if kde4 plasmoid running + my $useplasmoid=0; + if( -e $plasmstamp ) + { + open(STMP,"<$plasmstamp"); + my $stamp=<STMP>; + close (STMP); + if(abs($stamp-time())<15) + { + $useplasmoid=1; + } + } + if(! $printspool && ! $useplasmoid) { my $fname="$ENV{'HOME'}/Desktop"; my $p=@dirs[$i]; diff --git a/x2gopgwrapper b/x2gopgwrapper index 0f9ac5e..bfad849 100755 --- a/x2gopgwrapper +++ b/x2gopgwrapper @@ -1,4 +1,30 @@ #!/bin/bash + +if [ "$1" == "startshadowagent" ] +then + + CLIENT=$2 + + SHADOW_SET=${11} + + SHADOW_MODE=`echo "$SHADOW_SET"|awk '{split($0,a,"XSHAD"); print a[1]}'` + SHADOW_USER=`echo "$SHADOW_SET"|awk '{split($0,a,"XSHAD"); print a[2]}'` + SHADOW_DESKTOP=`echo "$SHADOW_SET"|awk '{split($0,a,"XSHAD"); print a[3]}'` + + ANSWER=`su $SHADOW_USER -c "DISPLAY=$SHADOW_DESKTOP x2godesktopsharing client ACCESS $SUDO_USER $CLIENT"` + + if [ "$ANSWER" != "GRANT" ] + then + echo "DEN" + exit + fi + OUTPUT=`su $SHADOW_USER -c "SSH_CLIENT=$CLIENT x2gostartagent $3 $4 $5 $6 $7 $8 $9 ${10} ${11}"` + echo $OUTPUT + PID=`echo $OUTPUT | awk '{print $3}'` + ANSWER=`su $SHADOW_USER -c "DISPLAY=$SHADOW_DESKTOP x2godesktopsharing client AGENT $PID $SUDO_USER $CLIENT"` + exit +fi + SQLHOST=`cat /etc/x2go/sql` if [ "$SQLHOST" == "local" ] then diff --git a/x2gopgwrapper_local b/x2gopgwrapper_local index 721cb7e..5f9abb1 100755 --- a/x2gopgwrapper_local +++ b/x2gopgwrapper_local @@ -23,7 +23,7 @@ listsessions) to_char(init_time,'DD.MM.YY*HH24:MI:SS'),cookie,client,gr_port,\ sound_port,to_char(last_time,'DD.MM.YY*HH24:MI:SS'),uname,\ to_char(now()-init_time,'SSSS'),fs_port from sessions \ - where status !='F' and server='$2' and uname='$UNAME' order by status desc;"|psql -t x2go_sessions + where status !='F' and server='$2' and uname='$UNAME' and ( session_id not like '%XSHAD%') order by status desc;"|psql -t x2go_sessions ;; listsessions_all) @@ -31,7 +31,7 @@ listsessions_all) to_char(init_time,'DD.MM.YY*HH24:MI:SS'),cookie,client,gr_port,\ sound_port,to_char(last_time,'DD.MM.YY*HH24:MI:SS'),uname,\ to_char(now()-init_time,'SSSS'),fs_port from sessions \ - where status !='F' and uname='$UNAME' order by status desc;"|psql -t x2go_sessions + where status !='F' and uname='$UNAME' and ( session_id not like '%XSHAD%') order by status desc;"|psql -t x2go_sessions ;; listsessionsroot) diff --git a/x2gopgwrapper_net b/x2gopgwrapper_net index a3b9275..c779836 100755 --- a/x2gopgwrapper_net +++ b/x2gopgwrapper_net @@ -25,7 +25,7 @@ listsessions) to_char(init_time,'DD.MM.YY*HH24:MI:SS'),cookie,client,gr_port,\ sound_port,to_char(last_time,'DD.MM.YY*HH24:MI:SS'),uname,\ to_char(now()-init_time,'SSSS'),fs_port from sessions \ - where status !='F' and server='$3' and uname='$UNAME' order by status desc;\"|psql -t x2go_sessions" + where status !='F' and server='$3' and uname='$UNAME' and ( session_id not like '%XSHAD%') order by status desc;\"|psql -t x2go_sessions" ;; listsessions_all) @@ -33,7 +33,7 @@ listsessions_all) to_char(init_time,'DD.MM.YY*HH24:MI:SS'),cookie,client,gr_port,\ sound_port,to_char(last_time,'DD.MM.YY*HH24:MI:SS'),uname,\ to_char(now()-init_time,'SSSS'),fs_port from sessions \ - where status !='F' and uname='$UNAME' order by status desc;\"|psql -t x2go_sessions" + where status !='F' and uname='$UNAME' and ( session_id not like '%XSHAD%') order by status desc;\"|psql -t x2go_sessions" ;; listsessionsroot) diff --git a/x2gopgwrapper_sqlite b/x2gopgwrapper_sqlite index 31edb49..4c0bb32 100755 --- a/x2gopgwrapper_sqlite +++ b/x2gopgwrapper_sqlite @@ -27,7 +27,7 @@ listsessions) substr(strftime('%d.%m.%Y*%H:%M:%S',last_time),0,6)||substr(strftime('%d.%m.%Y*%H:%M:%S',last_time),9,11),\ uname,\ strftime('%s','now','localtime') - strftime('%s',init_time),fs_port from sessions \ - where status !='F' and server='$2' and uname='$UNAME' order by status desc;"|sqlite $DATABASE + where status !='F' and server='$2' and uname='$UNAME' and ( session_id not like '%XSHAD%') order by status desc;"|sqlite $DATABASE ;; listsessions_all) @@ -37,7 +37,7 @@ listsessions_all) substr(strftime('%d.%m.%Y*%H:%M:%S',last_time),0,6)||substr(strftime('%d.%m.%Y*%H:%M:%S',last_time),9,11),\ uname,\ strftime('%s','now','localtime') - strftime('%s',init_time),fs_port from sessions \ - where status !='F' and uname='$UNAME' order by status desc;"|sqlite $DATABASE + where status !='F' and uname='$UNAME' and ( session_id not like '%XSHAD%') order by status desc;"|sqlite $DATABASE ;; listsessionsroot) diff --git a/x2gostartagent b/x2gostartagent index 92e6986..0dea745 100755 --- a/x2gostartagent +++ b/x2gostartagent @@ -18,6 +18,38 @@ X2GO_CMD=$9 X2GO_RESIZE=0 X2GO_FULLSCREEN=0 +if [ "$X2GO_STYPE" == "S" ] +then + + SHADOW_MODE=`echo "$X2GO_CMD"|awk '{split($0,a,"XSHAD"); print a[1]}'` + SHADOW_USER=`echo "$X2GO_CMD"|awk '{split($0,a,"XSHAD"); print a[2]}'` + SHADOW_DESKTOP=`echo "$X2GO_CMD"|awk '{split($0,a,"XSHAD"); print a[3]}'` + + echo "suser $SHADOW_USER user $USER " >> /tmp/uagent + + if [ "$SHADOW_USER" != "$USER" ] + then + OUTPUT=`sudo x2gopgwrapper startshadowagent $X2GO_CLIENT $@` + if [ "$OUTPUT" == "DEN" ] + then + echo "ACCESS DENIED" + exit -1 + fi + X2GO_COOKIE=`echo $OUTPUT | awk '{print $2}'` + X2GO_PORT=`echo $OUTPUT | awk '{print $1}'` + xauth add ${HOSTNAME}/unix:${X2GO_PORT} MIT-MAGIC-COOKIE-1 ${X2GO_COOKIE} + xauth add ${HOSTNAME}:${X2GO_PORT} MIT-MAGIC-COOKIE-1 ${X2GO_COOKIE} + + echo $X2GO_PORT + echo $X2GO_COOKIE + echo $OUTPUT | awk '{print $3}' + echo $OUTPUT | awk '{print $4}' + echo $OUTPUT | awk '{print $5}' + echo $OUTPUT | awk '{print $6}' + echo $OUTPUT | awk '{print $7}' + exit + fi +fi LIMIT=`x2gosessionlimit` LWORD=`echo $LIMIT | awk '{print $1}'` @@ -64,6 +96,7 @@ do if [ "$COLORDEPTH" != "" ] then SESSION_NAME="$SESSION_NAME"_st${SESSION_TYPE}${X2GO_CMD}_dp${COLORDEPTH} + SESSION_NAME=`echo "$SESSION_NAME" | sed -e "s/:/PP/g"` fi OUTPUT=`sudo x2gopgwrapper insertsession $X2GO_PORT $HOSTNAME $SESSION_NAME` fi @@ -118,6 +151,12 @@ then X2GO_RESIZE=1 X2GO_FULLSCREEN=1 fi +if [ "$X2GO_STYPE" == "S" ] +then + X2GO_GEOMETRY=`DISPLAY=$SHADOW_DESKTOP xwininfo -root | grep geometry` + X2GO_GEOMETRY=`echo "$X2GO_GEOMETRY" | sed -e "s/ //g"` + X2GO_GEOMETRY=`echo "$X2GO_GEOMETRY" | sed -e "s/-geometry//"` +fi SESSION_DIR=${X2GO_ROOT}/C-${SESSION_NAME} @@ -184,8 +223,22 @@ else X2GODPIOPTION_="-dpi $X2GODPI" fi -LD_LIBRARY_PATH=$X2GO_LIB x2goagent $X2GODPIOPTION_ -$SESSION_TYPE -auth ~/.Xauthority -geometry ${X2GO_GEOMETRY} -name "X2GO-${SESSION_NAME}" ${NX_AGENT} 2>${SESSION_DIR}/session.log & +if [ "$X2GOXDMCP" == "" ] +then + XDMCPOPT="" +else + XDMCPOPT="-query $X2GOXDMCP" +fi +if [ "$X2GO_STYPE" == "S" ] +then + LD_LIBRARY_PATH=$X2GO_LIB x2goagent $X2GODPIOPTION_ -$SESSION_TYPE -auth ~/.Xauthority \ + -S -shadow $SHADOW_DESKTOP -shadowmode $SHADOW_MODE \ + -geometry ${X2GO_GEOMETRY} -name "X2GO-${SESSION_NAME}" ${NX_AGENT} 2>${SESSION_DIR}/session.log & +else + LD_LIBRARY_PATH=$X2GO_LIB x2goagent $X2GODPIOPTION_ $XDMCPOPT -$SESSION_TYPE -auth ~/.Xauthority \ + -geometry ${X2GO_GEOMETRY} -name "X2GO-${SESSION_NAME}" ${NX_AGENT} 2>${SESSION_DIR}/session.log & +fi X2GO_AGENT_PID=$! hooks/post-receive -- x2goserver.git (X2Go Server) This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "x2goserver.git" (X2Go Server).