From ba8d6ac630ba04f9bf017b743af5e8251dd86c84 Mon Sep 17 00:00:00 2001 From: Adam Bolte Date: Mon, 21 Oct 2019 16:53:36 +1100 Subject: [PATCH] Truncate config on writes Fix for #485. --- lib/vagrant-lxc/driver.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vagrant-lxc/driver.rb b/lib/vagrant-lxc/driver.rb index bafed55..f2c2721 100644 --- a/lib/vagrant-lxc/driver.rb +++ b/lib/vagrant-lxc/driver.rb @@ -270,7 +270,7 @@ module Vagrant def write_config(contents) confpath = base_path.join('config').to_s begin - File.open(confpath, File::RDWR) do |file| + File.open(confpath, File::WRONLY|File::TRUNC) do |file| file.write contents end rescue