289 Commits

Author SHA1 Message Date
Chris Roberts
c3eb1e355b Merge pull request #7802 from chrisroberts/safe_exec/windows
[windows] Use subprocess for safe_exec on windows
2016-09-30 14:42:40 -07:00
Chris Roberts
977733790a Include debug notification when using subprocess 2016-09-30 12:16:53 -07:00
Chris Roberts
5872611d59 [windows] Use subprocess for safe_exec on windows 2016-09-15 13:08:58 -07:00
Jake Teton-Landis
ceb69e6266 Allow closing a Vagrant::Util::Subprocess's STDIN
Previously, there was no way to close the STDIN stream of a subprocess,
so commands that read from stdin in a subprocess would hang forever,
such as `/bin/sh -s`. If one tried to close the stdin, the
IO.select() call in Subprocess#execute would raise an error for calling
select() on a closed IO.

Here's a concrete example of a command that needs to close STDIN to work
properly:

```ruby
script = SOME_VERY_LONG_STRING
command = %w(ssh foo.example.com /bin/sh -s foo bar)
result = ::Vagrant::Util::Subprocess.execute(*command) do |type, data_or_io|
  if type == :stdin
    data_or_io.write(script)
    data_or_io.write("\n")
    data_or_io.close
    next
  end

  puts "Remote: #{data_or_io}"
end
```
2016-09-04 16:45:38 -07:00
Zack Train
cb70749bd8 redux of pr 7398 for ssh-agent key fix 2016-08-11 11:48:10 -07:00
Seth Vargo
1702584d1e Merge pull request #6765 from PeterMosmans/windows-path-fix
Fix for #6761 (fixes incomplete #6598)
2016-08-08 11:59:26 -04:00
Seth Vargo
d01ddeeb43
Check stdout instead of process output
Fixes GH-7465
2016-06-16 16:20:15 -04:00
Seth Vargo
cf02135290 Merge pull request #7359 from mitchellh/sethvargo/cache_platform
Cache the results of common operations
2016-05-31 11:03:46 -04:00
Seth Vargo
7014aa3bab
Remove custom tempfile class
This is not actually providing any additional utility and also causes
namespace conflicts with people trying to use the real Tempfile class.
2016-05-30 23:21:47 -04:00
Seth Vargo
2a230a11e2
Cache the results of common operations
This commit changes Vagrant::Util::Platform to cache the result of some
common operations. These values are highly unlikely to change over the
course of a single Vagrant run and they are only cached for that run.
2016-05-30 18:27:12 -04:00
Seth Vargo
3d2390fc94
Give a unique, prefixed name to all tempfiles
This commit basically grepped the code base for all uses of Dir.mktmpdir
and Tempfile.new/open and ensures the value is unique within the
code base and also prefixed with `vagrant-`.

Previously, most invocations of these commands simply used "vagrant",
thus making them indistinguishable when trying to identify leaks.
2016-05-28 23:22:34 -04:00
Seth Vargo
3a27c29577
Add a new util for generating tempfiles 2016-05-28 23:22:33 -04:00
Seth Vargo
3305764f71 Rescue Errno::ENOTCONN
Fixes GH-7182
2016-03-31 17:02:50 +02:00
Seth Vargo
1166800b65 Use SSL and HTTPS links where appropriate 2016-01-25 13:14:54 -05:00
Peter Mosmans
4b889ee641 Fix for #6761 (fixes incomplete #6598) 2015-12-30 07:56:08 +10:00
Mitchell Hashimoto
cf4b03d701 core: do not convert drive letters to UNC paths [GH-6598] 2015-12-24 12:36:14 -08:00
Luke Bakken
57187c9f88 Add method to detect if a Windows user is a member of the "Hyper-V Administrators" group.
Modify Hyper-V provider to require a user to either be an Administrator or a member of "Hyper-V Administrators"
2015-12-10 07:04:39 -08:00
Seth Vargo
8c3f833e8e Use the new presence helpers in the Chef provisioner 2015-11-23 18:33:47 -05:00
Seth Vargo
4c55c39b2d Add presence helpers 2015-11-23 18:04:18 -05:00
Mitchell Hashimoto
1405395d81 core: catch EINVAL on setting env vars [GH-6017] 2015-11-23 09:39:51 -08:00
Mitchell Hashimoto
d5fa7416ff core: more heuristics for determining Cygwin 2015-11-21 11:17:36 -08:00
Mitchell Hashimoto
b6f0b498e4 core: expand Windows short paths 2015-11-20 14:49:21 -08:00
Seth Vargo
02a351841e Use an array instead of map 2015-11-19 16:32:43 -08:00
Eli Skeggs
2b9173e15a Support environment variable forwarding, fixes #4131
Signed-off-by: Eli Skeggs <eskeggs@globesherpa.com>
2015-11-19 16:25:54 -08:00
Mitchell Hashimoto
e0ef592544 core: retry if server doesn't support byte ranges on download [GH-4479] 2015-11-19 16:14:13 -08:00
Mitchell Hashimoto
2ffbe4e6e1 core: more robust WIndows admin check [GH-5616] 2015-11-18 20:27:07 -08:00
Mitchell Hashimoto
ec0b0fb7f9 providers/virtualbox: IPv6 host only networks 2015-09-30 17:23:25 -07:00
Seth Vargo
d88d126ad9 Use a properly-formatted custom User-Agent 2015-07-20 23:33:31 -04:00
Mitchell Hashimoto
dec5f70a1e core: fix jailbreaking of plugins
/cc @sethvargo
2015-07-10 15:34:59 -06:00
Seth Vargo
fafa3fa437 Add another log statement 2015-07-09 16:06:03 -06:00
Seth Vargo
68ef9676c7 Jailbreak out of the subprocess and restore original environment 2015-07-09 16:06:03 -06:00
Seth Vargo
46563560f4 Update with_clean_env helpers 2015-07-09 16:06:02 -06:00
Seth Vargo
50a64ea30b Add a log statement 2015-07-09 16:06:02 -06:00
Seth Vargo
0a5d37fc8b Reset the original environment if we are running something outside of the installer 2015-07-09 16:06:02 -06:00
Mitchell Hashimoto
b3e935203e remove unuse dline 2015-07-09 14:25:10 -06:00
Mitchell Hashimoto
3cad495064 Merge pull request #5887 from msabramo/config.ssh.ssh_command
Add setting config.ssh.ssh_command
2015-07-09 14:24:48 -06:00
Seth Vargo
3ba10b43ab Restore the original environment from Bundler and the installer if given 2015-07-09 13:14:34 -06:00
Mitchell Hashimoto
6c06db776d core: test for URI escaping 2015-07-06 16:26:06 -06:00
Mitchell Hashimoto
79115d1ccc core: retry SSH keygen on RSAError [GH-5056]
/cc @sethvargo
2015-07-06 14:44:23 -06:00
Mitchell Hashimoto
bb25bb3be9 core: actually get the proper encoded subprocess command [GH-5128] 2015-07-06 14:39:50 -06:00
Mitchell Hashimoto
80ce9ab1f3 core: change select timeout to 1 for WIndows [GH-5309] 2015-07-06 13:54:00 -06:00
Marc Abramowitz
9240ea30b6 Add setting config.ssh.ssh_command
Lets the user specify what ssh to use or even direct Vagrant to use an
ssh wrapper like sshrc (https://github.com/Russell91/sshrc).
2015-07-01 23:33:13 -07:00
Dmitry Moskalchuk
26e3994319 Add option to enable trusted HTTP redirects 2015-05-31 09:34:02 -07:00
Seth Vargo
07efee776e Merge pull request #5677 from mrahtz/fix/master/unescape-curl-passwords
Escape/unescape cURL URLs/auth
2015-05-30 21:40:18 -07:00
Seth Vargo
98a23c5a5e Merge pull request #5604 from bluehaoran/patch-1
Update ssh.rb to detect PLink v0.64
2015-05-30 11:51:52 -07:00
Matthew Rahtz
29c77e5719 Escape/unescape cURL URLs/auth
so that we can deal with special characters in usernames and passwords
2015-04-29 14:34:00 +01:00
Haz
0962a2d151 Update ssh.rb to detect PLink v0.64
PLink 0.64 (released 28-2-2015) changes the command-line description, so the previous text-match no longer works.
2015-04-17 12:34:40 +10:00
Jean-Francois Bibeau
45e14a8dc4 UNC paths should have backslashes, not front-slashes. 2015-04-16 11:02:58 -04:00
Jean-Francois Bibeau
415837c544 moved function to platform utils, added unit test as per @sethvargo 2015-04-06 16:51:55 -04:00
Shawn Neal
522bf9ff8b Fix issue 3031
Sometimes in use ports can raise a Errno::EACCES exeptions on Windows hosts.
2015-01-16 08:03:37 -08:00