[X2Go-Commits] x2gobroker.git - tmp (branch) updated: 0.0.0.5-20-g8efcb47

X2Go dev team git-admin at x2go.org
Tue Apr 23 21:08:54 CEST 2013


The branch, tmp has been updated
       via  8efcb47747dd16ce1ad139c0cc47a5e4ebea6e9a (commit)
      from  687fc56ef8103ed2404a29ad00d14e5e7eaf5cf7 (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:
 lib/x2gobroker-agent.pl |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

The diff of changes is:
diff --git a/lib/x2gobroker-agent.pl b/lib/x2gobroker-agent.pl
index e6f1d3b..f1e3bad 100755
--- a/lib/x2gobroker-agent.pl
+++ b/lib/x2gobroker-agent.pl
@@ -65,13 +65,14 @@ sub AddAuthKey
 	# make sure dir and file for authorized_keys do exist
 	if ( ! -d $authkeydir )
 	{
-		system ("su - $uid -c mkdir -p $authkeydir");
+		system ("su - $uid -c \"mkdir -p $authkeydir\"");
 	}
 	if( ! -e $authkeyfile  )
 	{
-		system ("su - $uid -c touch $authkeyfile");
+		system ("su - $uid -c \"touch $authkeyfile\"");
 	}
-	if ( ! system("su - $uid -c cat $authkeyfile | grep $pubkey 1>/dev/null") )
+	my $authorized_keys = `su - $uid -c \"cat $authkeyfile\"`;
+	if ( ! ( $authorized_keys =~ m/$pubkey/ ) )
 	{
 		system("su - $uid -c \"echo $pubkey >> $authkeyfile\"");
 	}
@@ -90,10 +91,11 @@ sub DelAuthKey
 
 	if( -e $authkeyfile  )
 	{
-		if ( ! system("su - $uid -c cat $authkeyfile | grep $pubkey 1>/dev/null") )
+		my $authorized_keys = `su - $uid -c \"cat $authkeyfile\"`;
+		if ( ! ( $authorized_keys =~ m/$pubkey/ ) )
 		{
-			system("su - $uid -c \"cat $authkeyfile.tmp | grep -v $pubkey > $authkeyfile.tmp\"");
-			system("su - $uid -c mv $authkeyfile.tmp $authkeyfile");
+			system("su - $uid -c \"cat $authkeyfile.tmp | grep -v '$pubkey' > $authkeyfile.tmp\"");
+			system("su - $uid -c \"mv $authkeyfile.tmp $authkeyfile\"");
 		}
 	}
 }


hooks/post-receive
-- 
x2gobroker.git (HTTP(S) Session broker for X2Go)

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 "x2gobroker.git" (HTTP(S) Session broker for X2Go).




More information about the x2go-commits mailing list