[X2Go-Commits] [x2gobroker] 01/07: x2gobroker-agent: be more precise when checking public key existence and removing public keys

git-admin at x2go.org git-admin at x2go.org
Fri Mar 28 23:58:41 CET 2014


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2gobroker.

commit f99c628cdccb7b693de28b9cffa378f153374c02
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Mon Mar 24 11:53:48 2014 +0100

    x2gobroker-agent: be more precise when checking public key existence and removing public keys
---
 lib/x2gobroker-agent.pl |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/x2gobroker-agent.pl b/lib/x2gobroker-agent.pl
index ccb8ebb..c1fb216 100755
--- a/lib/x2gobroker-agent.pl
+++ b/lib/x2gobroker-agent.pl
@@ -83,7 +83,7 @@ sub AddAuthKey
 	system ("sudo", "-u", "$uid", "--", "mkdir", "-p", "$authkeydir");
 	system ("sudo", "-u", "$uid", "--", "touch", "$authkeyfile");
 	my $authorized_keys = `sudo -u $uid -- cat "$authkeyfile"`;
-	if ( ! ( $authorized_keys =~ m/$pubkey/ ) )
+	if ( ! ( $authorized_keys =~ m/^$pubkey$/ ) )
 	{
 		open my $saveout, ">&STDOUT";
 		open STDOUT, '>', "/dev/null";
@@ -110,7 +110,7 @@ sub DelAuthKey
 	open STDOUT, '>', "/dev/null";
 	open my $saveerr, ">&STDERR";
 	open STDERR, '>', "/dev/null";
-	system("sudo", "-u", "$uid", "--", "sed", "-e", "s!$pubkey!!", "-e", "/^\$/d", "-i", "$authkeyfile");
+	system("sudo", "-u", "$uid", "--", "sed", "-e", "s!^$pubkey\$!!", "-e", "/^\$/d", "-i", "$authkeyfile");
 	open STDOUT, ">&", $saveout;
 	open STDERR, ">&", $saveerr;
 }

--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git



More information about the x2go-commits mailing list