Skip to content

Commit

Permalink
add a patch to fix an issue in 'ssh -i'
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomoyuki Sakurai committed Oct 4, 2016
1 parent 578a5bd commit d1515c9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sysutils/vagrant/Makefile
Expand Up @@ -4,7 +4,7 @@
PORTNAME= vagrant
PORTVERSION= 1.8.1
DISTVERSIONPREFIX= v
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= sysutils rubygems devel

MAINTAINER= joe@thrallingpenguin.com
Expand Down
17 changes: 17 additions & 0 deletions sysutils/vagrant/files/percent_expand.patch
@@ -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

0 comments on commit d1515c9

Please sign in to comment.