forked from freebsd/freebsd-ports
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a patch to fix an issue in 'ssh -i'
this pacth fixes hashicorp/vagrant#7863 hashicorp/vagrant#7862
- Loading branch information
Tomoyuki Sakurai
committed
Oct 4, 2016
1 parent
578a5bd
commit d1515c9
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
diff --git a/lib/vagrant/util/ssh.rb b/lib/vagrant/util/ssh.rb | ||
index faa965c..243ce9d 100644 | ||
--- lib/vagrant/util/ssh.rb | ||
+++ lib/vagrant/util/ssh.rb | ||
@@ -129,7 +129,11 @@ module Vagrant | ||
# If we're not in plain mode and :private_key_path is set attach the private key path(s). | ||
if !plain_mode && options[:private_key_path] | ||
options[:private_key_path].each do |path| | ||
- command_options += ["-i", path.to_s] | ||
+ | ||
+ # Use '-o' instead of '-i' because '-i' does not call | ||
+ # percent_expand in misc.c, but '-o' does. when passing the path, | ||
+ # replace '%' in the path with '%%' to escape the '%' | ||
+ command_options += ["-o", "IdentityFile=%s" % [path.to_s.gsub('%', '%%')]] | ||
end | ||
end | ||
|