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