[X2Go-Commits] x2gobroker.git - build-main (branch) updated: 0.0.0.5-46-g20c45b2

X2Go dev team git-admin at x2go.org
Sun May 19 13:03:22 CEST 2013


The branch, build-main has been updated
       via  20c45b24317270cad9d201b307f2a2041bf8b57d (commit)
      from  fee39f5a3c8de2ab8ac1d3c32e534a568aa50f74 (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 |   26 +++++++++-----------------
 1 file changed, 9 insertions(+), 17 deletions(-)

The diff of changes is:
diff --git a/lib/x2gobroker-agent.pl b/lib/x2gobroker-agent.pl
index 1e98d9d..9511858 100755
--- a/lib/x2gobroker-agent.pl
+++ b/lib/x2gobroker-agent.pl
@@ -61,16 +61,14 @@ sub AddAuthKey
 	$authkeyfile =~ s/%%/%/;
 
 	my $authkeydir = dirname($authkeyfile);
-
-	# make sure dir and file for authorized_keys do exist
-	if ( ! -d $authkeydir )
+	if ( ! $authkeyfile =~ m/\/.*/ )
 	{
-		system ("su - $uid -c \"mkdir -p $authkeydir\"");
-	}
-	if( ! -e $authkeyfile  )
-	{
-		system ("su - $uid -c \"touch $authkeyfile\"");
+		$authkeyfile = "$home/$authkeyfile";
 	}
+
+	# make sure dir and file for authorized_keys do exist
+	system ("su - $uid -c \"mkdir -p $authkeydir\"");
+	system ("su - $uid -c \"touch $authkeyfile\"");
 	my $authorized_keys = `su - $uid -c \"cat $authkeyfile\"`;
 	if ( ! ( $authorized_keys =~ m/$pubkey/ ) )
 	{
@@ -86,17 +84,11 @@ sub DelAuthKey
 	$authkeyfile =~ s/%u/$uid/;
 	$authkeyfile =~ s/%h/$home/;
 	$authkeyfile =~ s/%%/%/;
-
-	my $authkeydir = dirname($authkeyfile);
-
-	if( -e $authkeyfile  )
+	if ( ! $authkeyfile =~ m/\/.*/ )
 	{
-		my $authorized_keys = `su - $uid -c \"cat $authkeyfile\"`;
-		if ( ! ( $authorized_keys =~ m/$pubkey/ ) )
-		{
-			system("su - $uid -c \"sed -e s/'$pubkey'// -i $authkeyfile\"");
-		}
+		$authkeyfile = "$home/$authkeyfile";
 	}
+	system("su - $uid -c \"sed -e s\!'$pubkey'\!''\! -i $authkeyfile\" 1>/dev/null 2>/dev/null");
 }
 
 $< = $>;


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