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

X2Go dev team git-admin at x2go.org
Fri Jan 3 20:50:51 CET 2014


The branch, build-baikal has been updated
       via  cfbadbad8aa07a623c38313799170feae6f63936 (commit)
      from  d8bf461f9299ce7f2b5c61ce4f6e7330f2ab2974 (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         |    8 +++-----
 x2goserver/bin/x2goprint |   27 ++++++++++++++++++++++-----
 2 files changed, 25 insertions(+), 10 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index c7cb3f6..8a9626e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,6 @@
 x2goserver (3.0.99.5-0~x2go3) UNRELEASED; urgency=low
 
-  [Mike Gabriel]
+  [ Mike Gabriel ]
   * Rename x2goumount_session calls to x2goumount-session calls in x2goserver
     internal scripts.
   * React to bug #627990, prefer man2html-base over man2html.
@@ -34,11 +34,9 @@ x2goserver (3.0.99.5-0~x2go3) UNRELEASED; urgency=low
   * Silence x2golistsessions on missing session.log files.
   * Create x2goprint user/group on package installation, add same info to 
     INSTALL howto.
-  * Change permissions on x2goprint, using 2755:root:x2goprint (setgid).
-  * Change X2go printing concept: use setgit and a sgid wrapper instead of sudo.
-  * Makefile update for x2goprint setgid wrapper.
+  * Add sanity checks to x2goprint, script can only be run as root.
 
-  [Martin Oehler]
+  [ Martin Oehler ]
   * Removes old debug code fragment, fixes x2golistsessions parsing.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Sun, 05 Jun 2011 20:44:32 +0200
diff --git a/x2goserver/bin/x2goprint b/x2goserver/bin/x2goprint
index ea35584..89028af 100755
--- a/x2goserver/bin/x2goprint
+++ b/x2goserver/bin/x2goprint
@@ -28,16 +28,33 @@ use strict;
 use lib `echo -n \$(x2gobasepath)/lib/x2go`;
 use x2godbwrapper;
 
-if (scalar(@ARGV) ==1)
+sub check_root
 {
-	db_listsessions_all @ARGV[0];
+	my ($uname, $pass, $uid, $pgid, $quota, $comment, $gcos, $homedir, $shell, $expire) = getpwuid($<);
+	my $realuser=$uname;
+	if ($realuser ne "root")
+	{
+		die "$realuser, you cannot use x2goprint as non-root user...";
+	}
 }
-elsif (scalar(@ARGV) != 4)
+
+sub usage
 {
-	print STDERR "ERROR: Usage:\nx2goprint user session file titleFile\nx2goprint user\n";
-	exit 1;
+	if (scalar(@ARGV) == 1)
+	{
+		system ("su @ARGV[0] -c \"x2golistsessions --all-servers\"");
+		exit 0;
+	}
+	elsif (scalar(@ARGV) != 4)
+	{
+		print STDERR "ERROR: Usage:\nx2goprint user session file titleFile\nx2goprint user\n";
+		exit 1;
+	}
 }
 
+check_root();
+usage();
+
 my ($user, $session, $file, $titleFile)=@ARGV;
 
 my ($tm,$tm,$uid,$gid,$tm,$tm,$tm,$homedir)=getpwnam("x2goprint");


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