[X2Go-Commits] [x2gobroker] 01/01: x2gobroker-agent.pl: Add %U (uidNumber) and %G (primary gidNumber) as further possible substitutions for deriving the full path to X2Go Broker Agent's public SSH key deployment. (Fixes: #665).

git-admin at x2go.org git-admin at x2go.org
Wed Apr 1 16:53:36 CEST 2015


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

x2go pushed a commit to branch master
in repository x2gobroker.

commit 80b1acb82639467ff85737cdfc5500535ad92afc
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Wed Apr 1 16:51:49 2015 +0200

    x2gobroker-agent.pl: Add %U (uidNumber) and %G (primary gidNumber) as further possible substitutions for deriving the full path to X2Go Broker Agent's public SSH key deployment. (Fixes: #665).
---
 debian/changelog        |    3 +++
 etc/x2gobroker.conf     |    9 +++++++++
 lib/x2gobroker-agent.pl |    9 +++++++--
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 0f5d81f..215d700 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -300,6 +300,9 @@ x2gobroker (0.0.3.0-0x2go1) UNRELEASED; urgency=low
       load-balanced server farm is unavailable.
     - x2gobroker-pubkeyauthorizer: Handle replacement of SSH pubkeys with wrong/
       old SSH options.
+    - x2gobroker-agent.pl: Add %U (uidNumber) and %G (primary gidNumber) as
+      further possible substitutions for deriving the full path to X2Go Broker
+      Agent's public SSH key deployment. (Fixes: #665).
   * debian/control:
     + Provide separate bin:package for SSH brokerage: x2gobroker-ssh.
     + Replace LDAP support with session brokerage support in LONG_DESCRIPTION.
diff --git a/etc/x2gobroker.conf b/etc/x2gobroker.conf
index 97da830..11cb0ea 100644
--- a/etc/x2gobroker.conf
+++ b/etc/x2gobroker.conf
@@ -166,6 +166,15 @@
 #
 # This option can be overridden by the session profile parameter
 # broker-authorized-keys=<file-location>
+#
+# In the given path name for the authorized_keys file, you can use these
+# substitutions:
+#
+#  %h -> <home-directory-of-the-user-an-agent-tasks-runs-for>
+#  %u -> <username-of-the-user-an-agent-tasks-runs-for>
+#  %U -> <uidNumber-of-the-user-an-agent-tasks-runs-for>
+#  %G -> <primary-gidNumber-of-the-user-an-agent-tasks-runs-for>
+#  %% -> <the-%-character>
 #default-authorized-keys=%h/.x2go/authorized_keys
 
 # X2Go Session Broker can also mediate logins to SSH proxy servers
diff --git a/lib/x2gobroker-agent.pl b/lib/x2gobroker-agent.pl
index b408b3b..0403d28 100755
--- a/lib/x2gobroker-agent.pl
+++ b/lib/x2gobroker-agent.pl
@@ -81,8 +81,10 @@ sub AddAuthKey
 {
 	my ($uid, $uidNumber, $gidNumber, $home, $pubkey, $authkeyfile)=@_;
 
-	# rewrite %%, %u and %h in authkeyfile string
+	# rewrite %%, %u, %U, %G and %h in authkeyfile string
 	$authkeyfile =~ s/%u/$uid/;
+	$authkeyfile =~ s/%U/$uidNumber/;
+	$authkeyfile =~ s/%G/$gidNumber/;
 	$authkeyfile =~ s/%h/$home/;
 	$authkeyfile =~ s/%%/%/;
 
@@ -111,10 +113,13 @@ sub DelAuthKey
 {
 	my ($uid, $uidNumber, $gidNumber, $home, $pubkey, $authkeyfile)=@_;
 
-	# rewrite %%, %u and %h in authkeyfile string
+	# rewrite %%, %u, %U, %G and %h in authkeyfile string
 	$authkeyfile =~ s/%u/$uid/;
+	$authkeyfile =~ s/%U/$uidNumber/;
+	$authkeyfile =~ s/%G/$gidNumber/;
 	$authkeyfile =~ s/%h/$home/;
 	$authkeyfile =~ s/%%/%/;
+
 	if ( ! $authkeyfile =~ m/\/.*/ )
 	{
 		$authkeyfile = "$home/$authkeyfile";

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


More information about the x2go-commits mailing list