[X2Go-Commits] x2goserver.git - build-main (branch) updated: 3.1.0.1-6-ge3dab38

X2Go dev team git-admin at x2go.org
Wed Dec 4 06:18:13 CET 2013


The branch, build-main has been updated
       via  e3dab38f75692668c0a276eab3c09a94655ee320 (commit)
      from  15a647adc8f64e964fd01a18369c2b5783c53157 (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              |   10 ++-
 x2goserver/bin/x2gogetapps    |  192 +++++++++++++++++++++++++++++++++++++++++
 x2goserver/bin/x2goruncommand |    7 ++
 x2goserver/bin/x2gostartagent |    6 +-
 4 files changed, 212 insertions(+), 3 deletions(-)
 create mode 100755 x2goserver/bin/x2gogetapps

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index fbf1141..f4050ec 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,12 +1,18 @@
-x2goserver (3.1.0.2-0~x2go1) UNRELEASED; urgency=low
+x2goserver (3.1.0.2-0~x2go1.1) UNRELEASED; urgency=low
 
+  [ Mike Gabriel ]
   * New upstream version (3.1.0.2):
     - Syslog warnings have to be named ,,warning'' not ,,warn''. 
     - Add usage output to x2goserver-run-extensions.
     - Fix syslog output of x2goserver-run-exentions.
     - Fix x2goserver extension calls in x2goruncommand.
 
- -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Wed, 07 Mar 2012 21:08:33 +0100
+  [ Oleksandr Shneyder ]
+  * New upstream version (3.1.0.2):
+    - support for "published applications".
+      Sponsored by Stefan Baur <postmaster at stefanbaur.de>
+
+ -- Oleksandr Shneyder <oleksandr.shneyder at treuchtlingen.de>  Thu, 08 Mar 2012 13:24:10 +0100
 
 x2goserver (3.1.0.1-0~x2go1) unstable; urgency=low
 
diff --git a/x2goserver/bin/x2gogetapps b/x2goserver/bin/x2gogetapps
new file mode 100755
index 0000000..f95a1ee
--- /dev/null
+++ b/x2goserver/bin/x2gogetapps
@@ -0,0 +1,192 @@
+#!/usr/bin/perl
+
+# Copyright (C) 2007-2012 X2Go Project - http://wiki.x2go.org
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Copyright (C) 2007-2012  Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de>
+# Copyright (C) 2007-2012  Heinz-Markus Graesing <heinz-m.graesing at obviously-nice.de>
+
+use strict;
+use Sys::Syslog qw( :standard :macros );
+use MIME::Base64 qw(encode_base64);
+
+use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use x2gologlevel;
+
+my @iconext=("png","svg","jpeg","jpg","xpm","bmp");
+
+my @icondirs=(
+"/usr/share/icons/hicolor/22x22/apps",
+"/usr/share/icons/hicolor/24x24/apps",
+"/usr/share/icons/hicolor/32x32/apps",
+"/usr/share/icons/hicolor/36x36/apps",
+"/usr/share/icons/hicolor/48x48/apps",
+"/usr/share/icons/hicolor/64x64/apps",
+"/usr/share/icons/hicolor/72x72/apps",
+"/usr/share/icons/hicolor/96x96/apps",
+"/usr/share/icons/hicolor/128x128/apps",
+"/usr/share/icons/hicolor/256x256/apps",
+"/usr/share/icons/hicolor/scalable/apps",
+"/usr/share/pixmaps",
+"/usr/share/icons/default.kde/22x22/apps",
+"/usr/share/icons/default.kde/24x24/apps",
+"/usr/share/icons/default.kde/32x32/apps",
+"/usr/share/icons/default.kde/36x36/apps",
+"/usr/share/icons/default.kde/48x48/apps",
+"/usr/share/icons/default.kde/64x64/apps",
+"/usr/share/icons/default.kde/72x72/apps",
+"/usr/share/icons/default.kde/96x96/apps",
+"/usr/share/icons/default.kde/128x128/apps",
+"/usr/share/icons/default.kde/256x256/apps",
+"/usr/share/icons/default.kde4/22x22/apps",
+"/usr/share/icons/default.kde4/24x24/apps",
+"/usr/share/icons/default.kde4/32x32/apps",
+"/usr/share/icons/default.kde4/36x36/apps",
+"/usr/share/icons/default.kde4/48x48/apps",
+"/usr/share/icons/default.kde4/64x64/apps",
+"/usr/share/icons/default.kde4/72x72/apps",
+"/usr/share/icons/default.kde4/96x96/apps",
+"/usr/share/icons/default.kde4/128x128/apps",
+"/usr/share/icons/default.kde4/256x256/apps"
+);
+
+sub findicon
+{
+	my $file=shift;
+	foreach(@iconext)
+	{
+		my $icon=findicon_ext("$file.$_");
+		if( $icon ne "" )
+		{
+			return "$icon";
+		}
+	}
+	return "";
+}
+
+sub findicon_ext
+{
+	my $file=shift;
+	foreach(@icondirs)
+	{
+		if( -e "$_/$file" )
+		{
+			return "$_/$file";
+		}
+	}
+	return "";
+}
+
+sub printicon
+{
+	my $file=shift;
+	if (open(I,"<$file"))
+	{
+		my $buf;
+		print "<icon>\n";
+		while (read(I, $buf, 60*57)) 
+		{
+			print encode_base64($buf);
+		}
+		print "</icon>\n";
+		close(I);
+	}
+	else
+	{
+		syslog ('info', "x2gogetapps:printicon - can't open file $file: $!");
+	}
+}
+
+sub proc_desktop_file
+{
+	my $file=shift;
+	if (open(F,"<$file"))
+	{
+		print("<desktop>\n");
+		while(!eof(F))
+		{
+			my $line=<F>;
+			if( $line=~m/^Categories/i || $line=~m/^Name/i || $line=~m/^Comment/i ||  $line=~m/^Exec/i)
+			{
+				print $line;
+			}
+			if( $line =~ m/^Icon/ )
+			{
+				my $icon=$line;
+				$icon =~ s/Icon=//;
+				chop($icon);
+				#$line is absolute path
+				if($icon =~ m/\//)
+				{
+					$icon=$icon;
+				}
+				#$line have format ext.
+				elsif ($line =~ m/\./)
+				{
+					$icon=findicon_ext($icon);
+				}
+				else
+				{
+					$icon=findicon($icon);
+				}
+				printicon($icon);
+			}
+		}
+		close (F);
+		print("</desktop>\n");
+	}
+	else
+	{
+		syslog ('info', "x2gogetapps:proc_desktop_file - can't open file $file: $!");
+	}
+}
+
+openlog($0,'cons,pid','user');
+setlogmask( LOG_UPTO(x2gologlevel()) );
+
+if ( @ARGV ) {
+	syslog('info', "x2gogetapps has been called with options: @ARGV");
+} else {
+	syslog('info', "x2gogetapps has been called without options");
+}
+
+my $file;
+my @dirs;
+ at dirs[0]="/etc/x2go/applications";
+my ($name, $pass, $uid, $gid, $quota, $comment, $gcos, $homedir, $shell, $expire) = getpwnam(getlogin || getpwuid($<));
+ at dirs[1]="$homedir/.x2go/applications";
+foreach(@dirs)
+{
+	my $dirname=$_;
+	if( opendir(DIR, $dirname))
+	{
+		while (defined($file = readdir(DIR))) 
+		{
+			if($file =~ m/.desktop/)
+			{
+				proc_desktop_file("$dirname/$file");
+			}
+		}
+		closedir(DIR);
+	}
+	else
+	{
+		syslog ('info', "x2gogetapps - can't opendir $dirname: $!");
+	}
+}
+# closing syslog 
+closelog;
diff --git a/x2goserver/bin/x2goruncommand b/x2goserver/bin/x2goruncommand
index c73cb6a..2f70633 100755
--- a/x2goserver/bin/x2goruncommand
+++ b/x2goserver/bin/x2goruncommand
@@ -122,6 +122,13 @@ then
 	IMEXIT="true"
 fi
 
+if [ "$X2GO_SESS_TYPE" == "P" ]
+then
+	IMEXIT="false"
+	EXEC="/bin/true"
+	X2GO_SESS_TYPE="R"
+fi
+
 # run x2goserver-extensions for pre-runcommand
 x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions "$X2GO_SESSION" pre-runcommand || true
 
diff --git a/x2goserver/bin/x2gostartagent b/x2goserver/bin/x2gostartagent
index 679852e..739a0c2 100755
--- a/x2goserver/bin/x2gostartagent
+++ b/x2goserver/bin/x2gostartagent
@@ -105,9 +105,13 @@ export NX_CLIENT="$X2GO_LIB_PATH/x2gosuspend-agent"
 COLORDEPTH=`echo "$X2GO_TYPE"|awk '{split($0,a,"-depth_"); print a[2]}'`
 
 SESSION_TYPE="D"
+NOEXITPARAM=""
 
 if [ "$X2GO_STYPE" == "R" ]; then
 	SESSION_TYPE="R"
+elif  [ "$X2GO_STYPE" == "P" ]; then
+	SESSION_TYPE="R"
+	NOEXITPARAM="-norootlessexit"
 elif  [ "$X2GO_STYPE" == "S" ]; then
 	SESSION_TYPE="S"
 fi
@@ -244,7 +248,7 @@ SESSION_WINDOW_TITLE="X2GO-${SESSION_NAME}"
 if  [ "$X2GO_STYPE" == "S" ]; then
 	x2goagent $X2GODPIOPTION_ -$SESSION_TYPE -auth "$XAUTHORITY" -shadow $SHADOW_DESKTOP -shadowmode $SHADOW_MODE -geometry ${X2GO_GEOMETRY} -name "${SESSION_WINDOW_TITLE}"  "${NX_AGENT}" 2>"${SESSION_DIR}/session.log" &
 else
-	x2goagent $X2GODPIOPTION_ $XDMCPOPT -$SESSION_TYPE -auth "$XAUTHORITY" -geometry ${X2GO_GEOMETRY} -name "${SESSION_WINDOW_TITLE}"  "${NX_AGENT}" 2>"${SESSION_DIR}/session.log" &
+	x2goagent $X2GODPIOPTION_ $XDMCPOPT -$SESSION_TYPE $NOEXITPARAM -auth "$XAUTHORITY" -geometry ${X2GO_GEOMETRY} -name "${SESSION_WINDOW_TITLE}"  "${NX_AGENT}" 2>"${SESSION_DIR}/session.log" &
 fi
 
 


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).




More information about the x2go-commits mailing list