[X2Go-Commits] x2goserver.git - build-baikal (branch) updated: 3.0.99-2-214-g39feab0

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


The branch, build-baikal has been updated
       via  39feab07aa3bfaa30de5f35e7f13f2c61d435e66 (commit)
      from  103e231b27adfe1f557cfd097eb1c4eeb853dbe4 (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/x2goserver.install                      |    1 -
 debian/x2goserver.postinst                     |   12 ++--
 debian/x2goserver.postrm                       |    3 -
 x2goserver/VERSION.x2goserver                  |    2 +-
 x2goserver/{lib/x2goprint.pl => bin/x2goprint} |    2 +-
 x2goserver/lib/x2gosqlitewrapper.pl            |    2 +
 x2goserver/x2goprint.c                         |   79 ------------------------
 7 files changed, 10 insertions(+), 91 deletions(-)
 rename x2goserver/{lib/x2goprint.pl => bin/x2goprint} (97%)
 delete mode 100644 x2goserver/x2goprint.c

The diff of changes is:
diff --git a/debian/x2goserver.install b/debian/x2goserver.install
index 9b7c34c..5f1395a 100644
--- a/debian/x2goserver.install
+++ b/debian/x2goserver.install
@@ -5,5 +5,4 @@ x2goserver/etc/x2gosql/sql              /etc/x2go/x2gosql/
 x2goserver/etc/x2goserver.conf          /etc/x2go/
 x2goserver/VERSION.x2goserver           /usr/share/x2go/versions/
 x2goserver/x2gosqlitewrapper            /usr/lib/x2go/
-x2goserver/x2goprint                    /usr/bin/
 
diff --git a/debian/x2goserver.postinst b/debian/x2goserver.postinst
index c3b5a3f..961fdc1 100755
--- a/debian/x2goserver.postinst
+++ b/debian/x2goserver.postinst
@@ -121,13 +121,13 @@ case "$1" in
 		# egid x2goprint needs write access to the spool dir
 		chmod 0770 /var/spool/x2goprint
 
-		### setgid section for x2goprint (X2go printing)
-
-		# the x2goprint command can only be run by users that are in group x2goprint
-		if ! dpkg-statoverride --list /usr/bin/x2goprint >/dev/null; then
-		    dpkg-statoverride --add --update root x2goprint 2755 /usr/bin/x2goprint
+		# we may be upgrading versions of x2goserver that had
+		# /usr/bin/x2goprint was set to setuid x2goprint.
+		if dpkg-statoverride --list /usr/bin/x2goprint >/dev/null; then
+			dpkg-statoverride --remove /usr/bin/x2goprint
+			chown root:root /usr/bin/x2goprint
+			chmod 0755 /usr/bin/x2goprint
 		fi
-		;;
 
 
 	abort-upgrade|abort-remove|abort-deconfigure)
diff --git a/debian/x2goserver.postrm b/debian/x2goserver.postrm
index 423d45e..e99c2c9 100755
--- a/debian/x2goserver.postrm
+++ b/debian/x2goserver.postrm
@@ -28,9 +28,6 @@ case "$1" in
 		getent group x2gouser >/dev/null && delgroup x2gouser
 		getent group x2gousers >/dev/null && delgroup x2gousers
 
-		if dpkg-statoverride --list /usr/bin/x2goprint >/dev/null; then
-			dpkg-statoverride --remove /usr/bin/x2goprint
-		fi
 		getent passwd x2goprint >/dev/null && deluser x2goprint
 		getent group x2goprint >/dev/null && delgroup x2goprint
 		;;
diff --git a/x2goserver/VERSION.x2goserver b/x2goserver/VERSION.x2goserver
index 34936c7..36a9e31 100644
--- a/x2goserver/VERSION.x2goserver
+++ b/x2goserver/VERSION.x2goserver
@@ -1 +1 @@
-3.0.99.5
\ No newline at end of file
+3.0.99.6
\ No newline at end of file
diff --git a/x2goserver/lib/x2goprint.pl b/x2goserver/bin/x2goprint
similarity index 97%
rename from x2goserver/lib/x2goprint.pl
rename to x2goserver/bin/x2goprint
index 8b913ea..ea35584 100755
--- a/x2goserver/lib/x2goprint.pl
+++ b/x2goserver/bin/x2goprint
@@ -30,7 +30,7 @@ use x2godbwrapper;
 
 if (scalar(@ARGV) ==1)
 {
-	system ("su @ARGV[0] -c \"x2golistsessions --all-servers\" ");
+	db_listsessions_all @ARGV[0];
 }
 elsif (scalar(@ARGV) != 4)
 {
diff --git a/x2goserver/lib/x2gosqlitewrapper.pl b/x2goserver/lib/x2gosqlitewrapper.pl
index 9e40d3e..79f10af 100755
--- a/x2goserver/lib/x2gosqlitewrapper.pl
+++ b/x2goserver/lib/x2gosqlitewrapper.pl
@@ -279,6 +279,7 @@ elsif($cmd eq  "listsessions")
 
 elsif($cmd eq  "listsessions_all")
 {
+        my $user=shift and $realuser = $user;
 	my @strings;
 	my $sth=$dbh->prepare("select agent_pid, session_id, display, server, status,
 	                       substr(strftime('%d.%m.%Y*%H:%M:%S',init_time),0,6)||substr(strftime('%d.%m.%Y*%H:%M:%S',init_time),9,11),
@@ -287,6 +288,7 @@ elsif($cmd eq  "listsessions_all")
 	                       uname,
 	                       strftime('%s','now','localtime') - strftime('%s',init_time),fs_port from  sessions 
 	                       where status !='F' and uname=? and  (  session_id not like '%XSHAD%')  order by status desc");
+	
 	$sth->execute($realuser)or die;
 	fetchrow_printall_array($sth);
 }
diff --git a/x2goserver/x2goprint.c b/x2goserver/x2goprint.c
deleted file mode 100644
index 9151d17..0000000
--- a/x2goserver/x2goprint.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * This file is part of the  X2go Project - http://www.x2go.org
- * Copyright (C) 2011 Mike Gabriel <mike.gabriel at das-netzwerkteam.de> 
- * Copyright (C) 2011 Moritz 'Morty' Strübe <morty at gmx.net>
- *
- * 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.
- *
- * 
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <libgen.h>
-#include <errno.h>
-
-
-int main( int argc, char *argv[] ) {
-	char * x2goprint = NULL;
-	size_t path_max;
-	
-/*
-	The following snippet is taken from the realpath manpage
-*/
-#ifdef PATH_MAX
-	path_max = PATH_MAX;
-#else
-	path_max = pathconf (".", _PC_PATH_MAX);
-	if (path_max <= 0){
-		path_max = 4096;
-	}
-#endif
-	{
-		// allocate dynamic buffer in stack: this needs C99 or gnu??
-		char buffer[path_max];
-		ssize_t rvrl;
-		int rvap;
-
-		// resolve link of /proc/self/exe to find out where we are
-		rvrl = readlink("/proc/self/exe", buffer, path_max);
-		if(rvrl == -1){
-			perror("readlink(\"/proc/self/exe\",buffer,path_max)");
-			exit(EXIT_FAILURE);
-		}
-		if(rvrl >= path_max){
-			fprintf(stderr, "Could not resolve the path of this file using \"/proc/self/exe\". The path is too long (> %i)", path_max);
-			exit(EXIT_FAILURE);
-		}
-
-		// derive the full path of x2goprint.pl from path of this binary
-		rvap = asprintf(&x2goprint, "%s/lib/x2go/%s", dirname(dirname(buffer)), "x2goprint.pl");
-		if(rvap == -1){
-			fprintf(stderr, "Failed to allocate memory calling asprintf\n");
-			exit(EXIT_FAILURE);
-		}
-
-		// execute the script, running with user-rights of this binary 
-		execv(x2goprint, argv);
-
-	}
-
-	// ...fail
-	fprintf(stderr, "Failed to execute %s: %s\n", x2goprint, strerror(errno));
-	return EXIT_FAILURE;
-
-}


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