233933
From 677f575d2289285d2e553ddd610944856cb947db Mon Sep 17 00:00:00 2001
233933
From: Sunny Kumar <sunkumar@redhat.com>
233933
Date: Fri, 10 May 2019 11:21:03 +0530
233933
Subject: [PATCH 135/141] geo-rep: fix incorrectly formatted authorized_keys
233933
233933
There are two ways for creating secret pem pub file during geo-rep
233933
setup.
233933
1. gluster-georep-sshkey generate
233933
2. gluster system:: execute gsec_create
233933
233933
Below patch solves this problem for `gluster-georep-sshkey generate`
233933
method.
233933
Patch link: https://review.gluster.org/#/c/glusterfs/+/22246/
233933
233933
This patch is added to support old way of creating secret pem pub file
233933
`gluster system:: execute gsec_create`.
233933
233933
Problem:  While Geo-rep setup when creating an ssh authorized_keys
233933
          the geo-rep setup inserts an extra space before the "ssh-rsa" label.
233933
          This gets flagged by an enterprise customer's security scan as a
233933
          security violation.
233933
Solution: Remove extra space while creating secret key.
233933
233933
Upstream Patch: https://review.gluster.org/#/c/glusterfs/+/22673/
233933
233933
>fixes: bz#1679401
233933
>Change-Id: I92ba7e25aaa5123dae9ebe2f3c68d14315aa5f0e
233933
>Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
233933
233933
BUG: 1671862
233933
Change-Id: I11e90c00a14a301a5d95e14b5e8984867e6ff893
233933
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
233933
Reviewed-on: https://code.engineering.redhat.com/gerrit/169870
233933
Tested-by: RHGS Build Bot <nigelb@redhat.com>
233933
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
233933
---
233933
 geo-replication/src/peer_gsec_create.in | 4 ++--
233933
 1 file changed, 2 insertions(+), 2 deletions(-)
233933
233933
diff --git a/geo-replication/src/peer_gsec_create.in b/geo-replication/src/peer_gsec_create.in
233933
index 05c1638..6d4a484 100755
233933
--- a/geo-replication/src/peer_gsec_create.in
233933
+++ b/geo-replication/src/peer_gsec_create.in
233933
@@ -18,7 +18,7 @@ if [ "Xcontainer" = "X$1" ]; then
233933
     output1=`cat "$GLUSTERD_WORKDIR"/geo-replication/secret.pem.pub`
233933
     output2=`cat "$GLUSTERD_WORKDIR"/geo-replication/tar_ssh.pem.pub`
233933
 else
233933
-    output1=`echo command=\"${libexecdir}/glusterfs/gsyncd\" " "``cat "$GLUSTERD_WORKDIR"/geo-replication/secret.pem.pub`
233933
-    output2=`echo command=\"tar \$\{SSH_ORIGINAL_COMMAND#* \}\" " "``cat "$GLUSTERD_WORKDIR"/geo-replication/tar_ssh.pem.pub`
233933
+    output1=`echo command=\"${libexecdir}/glusterfs/gsyncd\" ""``cat "$GLUSTERD_WORKDIR"/geo-replication/secret.pem.pub`
233933
+    output2=`echo command=\"tar \$\{SSH_ORIGINAL_COMMAND#* \}\" ""``cat "$GLUSTERD_WORKDIR"/geo-replication/tar_ssh.pem.pub`
233933
 fi
233933
 echo -e "$output1\n$output2"
233933
-- 
233933
1.8.3.1
233933