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