lib/fulmar/infrastructure/service/ssh_config_service.rb in fulmar-2.1.1 vs lib/fulmar/infrastructure/service/ssh_config_service.rb in fulmar-2.1.2

- old
+ new

@@ -114,17 +114,17 @@ entry = [ '', # Add some space between this and the second last entry "Host #{hostname}" ] - ssh_config.keys.each { |key| entry << " #{key} #{escape_value(ssh_config[key])}" } + ssh_config.keys.each { |key| entry << " #{key} #{escape_value(key, ssh_config[key])}" } entry << '' entry end - def escape_value(value) + def escape_value(key, value) value = value.to_s - value = "\"#{value.gsub('"', '\\"')}\"" if value.include?(' ') + value = "\"#{value.gsub('"', '\\"')}\"" if value.include?(' ') && key.to_s != 'ProxyCommand' value end def read_file config_file_data = []