Blame SOURCES/0204-ssh-client-handle-etc-ssh-ssh_config.patch

18971c
From 828fd83bc1816bacb24b13106f935b2fbd0964a4 Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Fri, 29 Aug 2014 14:06:57 +0200
18971c
Subject: [PATCH] ssh-client: handle /etc/ssh/ssh_config
18971c
18971c
- disable ProxyCommand
18971c
- install the GlobalKnownHostsFile
18971c
18971c
https://bugzilla.redhat.com/show_bug.cgi?id=1086778
18971c
---
18971c
 modules.d/95ssh-client/module-setup.sh | 10 +++++++++-
18971c
 1 file changed, 9 insertions(+), 1 deletion(-)
18971c
18971c
diff --git a/modules.d/95ssh-client/module-setup.sh b/modules.d/95ssh-client/module-setup.sh
18971c
index 66e5307d..f60e9631 100755
18971c
--- a/modules.d/95ssh-client/module-setup.sh
18971c
+++ b/modules.d/95ssh-client/module-setup.sh
18971c
@@ -41,7 +41,15 @@ inst_sshenv()
18971c
 
18971c
     # Copy over root and system-wide ssh configs.
18971c
     [[ -f /root/.ssh/config ]] && inst_simple /root/.ssh/config
18971c
-    [[ -f /etc/ssh/ssh_config ]] && inst_simple /etc/ssh/ssh_config
18971c
+    if [[ -f /etc/ssh/ssh_config ]]; then
18971c
+        inst_simple /etc/ssh/ssh_config
18971c
+        sed -i -e 's/\(^[[:space:]]*\)ProxyCommand/\1# ProxyCommand/' ${initdir}/etc/ssh/ssh_config
18971c
+        while read key val; do
18971c
+            [[ key != "GlobalKnownHostsFile" ]] && continue
18971c
+            inst_simple "$val"
18971c
+            break
18971c
+        done < /etc/ssh/ssh_config
18971c
+    fi
18971c
 
18971c
     return 0
18971c
 }