diff --git a/plugins/guests/arch/cap/configure_networks.rb b/plugins/guests/arch/cap/configure_networks.rb index c61e8c6bc..e029c0732 100644 --- a/plugins/guests/arch/cap/configure_networks.rb +++ b/plugins/guests/arch/cap/configure_networks.rb @@ -25,7 +25,7 @@ module VagrantPlugins remote_path = "/tmp/vagrant-network-#{Time.now.to_i}-#{i}" - Tempfile.open("arch-configure-networks") do |f| + Tempfile.open("vagrant-arch-configure-networks") do |f| f.binmode f.write(entry) f.fsync diff --git a/plugins/guests/coreos/cap/configure_networks.rb b/plugins/guests/coreos/cap/configure_networks.rb index 04b1e3aac..887d68c8c 100644 --- a/plugins/guests/coreos/cap/configure_networks.rb +++ b/plugins/guests/coreos/cap/configure_networks.rb @@ -54,7 +54,7 @@ module VagrantPlugins }) end - Tempfile.open("coreos-configure-networks") do |f| + Tempfile.open("vagrant-coreos-configure-networks") do |f| f.binmode f.write(entry) f.fsync diff --git a/plugins/guests/debian/cap/configure_networks.rb b/plugins/guests/debian/cap/configure_networks.rb index 315a0ffc3..a80a13563 100644 --- a/plugins/guests/debian/cap/configure_networks.rb +++ b/plugins/guests/debian/cap/configure_networks.rb @@ -31,7 +31,7 @@ module VagrantPlugins # Perform the careful dance necessary to reconfigure the network # interfaces. - Tempfile.open("debian-configure-networks") do |f| + Tempfile.open("vagrant-debian-configure-networks") do |f| f.binmode f.write(entries.join("\n")) f.fsync diff --git a/plugins/guests/fedora/cap/configure_networks.rb b/plugins/guests/fedora/cap/configure_networks.rb index 23318b0ac..e4a7e1f19 100644 --- a/plugins/guests/fedora/cap/configure_networks.rb +++ b/plugins/guests/fedora/cap/configure_networks.rb @@ -96,7 +96,7 @@ module VagrantPlugins entry = TemplateRenderer.render("guests/fedora/network_#{network[:type]}", options: network) - Tempfile.open("fedora-configure-networks") do |f| + Tempfile.open("vagrant-fedora-configure-networks") do |f| f.binmode f.write(entry) f.fsync diff --git a/plugins/guests/freebsd/cap/configure_networks.rb b/plugins/guests/freebsd/cap/configure_networks.rb index f0ebb3ea5..6f3e04ae4 100644 --- a/plugins/guests/freebsd/cap/configure_networks.rb +++ b/plugins/guests/freebsd/cap/configure_networks.rb @@ -29,7 +29,7 @@ module VagrantPlugins entry = TemplateRenderer.render("guests/freebsd/network_#{network[:type]}", options: network, ifname: ifname) - Tempfile.open("freebsd-configure-networks") do |f| + Tempfile.open("vagrant-freebsd-configure-networks") do |f| f.binmode f.write(entry) f.fsync diff --git a/plugins/guests/funtoo/cap/configure_networks.rb b/plugins/guests/funtoo/cap/configure_networks.rb index 9265171af..6e20dc237 100644 --- a/plugins/guests/funtoo/cap/configure_networks.rb +++ b/plugins/guests/funtoo/cap/configure_networks.rb @@ -25,7 +25,7 @@ module VagrantPlugins options: network) # Upload the entry to a temporary location - Tempfile.open("funtoo-configure-networks") do |f| + Tempfile.open("vagrant-funtoo-configure-networks") do |f| f.binmode f.write(entry) f.fsync diff --git a/plugins/guests/gentoo/cap/configure_networks.rb b/plugins/guests/gentoo/cap/configure_networks.rb index 49553569b..289aa16af 100644 --- a/plugins/guests/gentoo/cap/configure_networks.rb +++ b/plugins/guests/gentoo/cap/configure_networks.rb @@ -21,7 +21,7 @@ module VagrantPlugins options: network) # Upload the entry to a temporary location - Tempfile.open("gentoo-configure-networks") do |f| + Tempfile.open("vagrant-gentoo-configure-networks") do |f| f.binmode f.write(entry) f.fsync diff --git a/plugins/guests/netbsd/cap/configure_networks.rb b/plugins/guests/netbsd/cap/configure_networks.rb index 81d5ea366..d53b6c6e4 100644 --- a/plugins/guests/netbsd/cap/configure_networks.rb +++ b/plugins/guests/netbsd/cap/configure_networks.rb @@ -20,7 +20,7 @@ module VagrantPlugins entry = TemplateRenderer.render("guests/netbsd/network_#{network[:type]}", options: network) - Tempfile.open("netbsd-configure-networks") do |f| + Tempfile.open("vagrant-netbsd-configure-networks") do |f| f.binmode f.write(entry) f.fsync diff --git a/plugins/guests/nixos/cap/change_host_name.rb b/plugins/guests/nixos/cap/change_host_name.rb index b838928c0..340eddeab 100644 --- a/plugins/guests/nixos/cap/change_host_name.rb +++ b/plugins/guests/nixos/cap/change_host_name.rb @@ -18,7 +18,7 @@ module VagrantPlugins def self.upload(machine, content, remote_path) remote_temp = mktemp(machine) - Tempfile.open("nixos-change-host-name") do |f| + Tempfile.open("vagrant-nixos-change-host-name") do |f| f.binmode f.write(content) f.fsync diff --git a/plugins/guests/nixos/cap/configure_networks.rb b/plugins/guests/nixos/cap/configure_networks.rb index 5a788781a..96458622f 100644 --- a/plugins/guests/nixos/cap/configure_networks.rb +++ b/plugins/guests/nixos/cap/configure_networks.rb @@ -67,7 +67,7 @@ module VagrantPlugins def self.upload(machine, content, remote_path) remote_temp = mktemp(machine) - Tempfile.open("nixos-configure-networks") do |f| + Tempfile.open("vagrant-nixos-configure-networks") do |f| f.binmode f.write(content) f.fsync diff --git a/plugins/guests/openbsd/cap/configure_networks.rb b/plugins/guests/openbsd/cap/configure_networks.rb index 5a123288b..30c4be060 100644 --- a/plugins/guests/openbsd/cap/configure_networks.rb +++ b/plugins/guests/openbsd/cap/configure_networks.rb @@ -13,7 +13,7 @@ module VagrantPlugins entry = TemplateRenderer.render("guests/openbsd/network_#{network[:type]}", options: network) - Tempfile.open("openbsd-configure-networks") do |f| + Tempfile.open("vagrant-openbsd-configure-networks") do |f| f.binmode f.write(entry) f.fsync diff --git a/plugins/guests/redhat/cap/configure_networks.rb b/plugins/guests/redhat/cap/configure_networks.rb index 8c5dfef26..8aebff291 100644 --- a/plugins/guests/redhat/cap/configure_networks.rb +++ b/plugins/guests/redhat/cap/configure_networks.rb @@ -55,7 +55,7 @@ module VagrantPlugins entry = TemplateRenderer.render("guests/redhat/network_#{network[:type]}", options: network) - Tempfile.open("red-hat-configure-networks") do |f| + Tempfile.open("vagrant-red-hat-configure-networks") do |f| f.binmode f.write(entry) f.fsync diff --git a/plugins/guests/slackware/cap/configure_networks.rb b/plugins/guests/slackware/cap/configure_networks.rb index 7708ac784..b9b272cde 100644 --- a/plugins/guests/slackware/cap/configure_networks.rb +++ b/plugins/guests/slackware/cap/configure_networks.rb @@ -20,7 +20,7 @@ module VagrantPlugins entry = TemplateRenderer.render("guests/slackware/network_#{network[:type]}", options: network) - Tempfile.open("slackware-configure-networks") do |f| + Tempfile.open("vagrant-slackware-configure-networks") do |f| f.binmode f.write(entry) f.fsync diff --git a/plugins/guests/suse/cap/configure_networks.rb b/plugins/guests/suse/cap/configure_networks.rb index d1060e425..54fbdda87 100644 --- a/plugins/guests/suse/cap/configure_networks.rb +++ b/plugins/guests/suse/cap/configure_networks.rb @@ -33,7 +33,7 @@ module VagrantPlugins entry = TemplateRenderer.render("guests/suse/network_#{network[:type]}", options: network) - Tempfile.open("suse-configure-networks") do |f| + Tempfile.open("vagrant-suse-configure-networks") do |f| f.binmode f.write(entry) f.fsync diff --git a/plugins/provisioners/ansible/provisioner/guest.rb b/plugins/provisioners/ansible/provisioner/guest.rb index 395db8cae..046806109 100644 --- a/plugins/provisioners/ansible/provisioner/guest.rb +++ b/plugins/provisioners/ansible/provisioner/guest.rb @@ -107,7 +107,7 @@ module VagrantPlugins create_and_chown_remote_folder(inventory_basedir) @machine.communicate.sudo("rm -f #{inventory_path}", error_check: false) - Tempfile.open("ansible-local-inventory-#{@machine.name}") do |f| + Tempfile.open("vagrant-ansible-local-inventory-#{@machine.name}") do |f| f.binmode f.write(inventory_content) f.fsync diff --git a/plugins/provisioners/chef/provisioner/base.rb b/plugins/provisioners/chef/provisioner/base.rb index eb4cfa153..8f41e67bb 100644 --- a/plugins/provisioners/chef/provisioner/base.rb +++ b/plugins/provisioners/chef/provisioner/base.rb @@ -142,7 +142,7 @@ module VagrantPlugins # Create a temporary file to store the data so we can upload it. remote_file = File.join(guest_provisioning_path, filename) @machine.communicate.sudo(remove_command(remote_file), error_check: false) - Tempfile.open("chef-provisioner-config") do |f| + Tempfile.open("vagrant-chef-provisioner-config") do |f| f.binmode f.write(config_file) f.fsync @@ -163,7 +163,7 @@ module VagrantPlugins # Create a temporary file to store the data so we can upload it. remote_file = File.join(guest_provisioning_path, "dna.json") @machine.communicate.sudo(remove_command(remote_file), error_check: false) - Tempfile.open("chef-provisioner-config") do |f| + Tempfile.open("vagrant-chef-provisioner-config") do |f| f.binmode f.write(json) f.fsync diff --git a/plugins/provisioners/chef/provisioner/chef_apply.rb b/plugins/provisioners/chef/provisioner/chef_apply.rb index 77bbb0069..c19c6412a 100644 --- a/plugins/provisioners/chef/provisioner/chef_apply.rb +++ b/plugins/provisioners/chef/provisioner/chef_apply.rb @@ -55,7 +55,7 @@ module VagrantPlugins # machine. def upload_recipe # Write the raw recipe contents to a tempfile and upload - Tempfile.open(["chef-apply", ".rb"]) do |f| + Tempfile.open(["vagrant-chef-apply", ".rb"]) do |f| f.binmode f.write(config.recipe) f.fsync diff --git a/test/unit/vagrant/box_collection_test.rb b/test/unit/vagrant/box_collection_test.rb index 45bd8e5b1..9537f235e 100644 --- a/test/unit/vagrant/box_collection_test.rb +++ b/test/unit/vagrant/box_collection_test.rb @@ -39,7 +39,7 @@ describe Vagrant::BoxCollection, :skip_windows do end it 'does not raise an exception when a file appears in the boxes dir' do - Tempfile.open('a_file', environment.boxes_dir) do + Tempfile.open('vagrant-a_file', environment.boxes_dir) do expect { subject.all }.to_not raise_error end end @@ -344,7 +344,7 @@ describe Vagrant::BoxCollection, :skip_windows do CHECKSUM_OFFSET = 148 CHECKSUM_LENGTH = 8 - Tempfile.open(['vagrant_testing', '.tar']) do |f| + Tempfile.open(['vagrant-testing', '.tar']) do |f| f.binmode # Corrupt the tar by writing over the checksum field