Open private key file in binary mode when writing

Prevent newlines from being converted to CRLF when writing private key
to file.
This commit is contained in:
Chris Roberts 2024-01-12 16:01:23 -08:00
parent b3c9f0d522
commit 0a8f99df52

View File

@ -251,7 +251,7 @@ module VagrantPlugins
# Write out the private key in the data dir so that the
# machine automatically picks it up.
@machine.data_dir.join("private_key").open("w+") do |f|
@machine.data_dir.join("private_key").open("wb+") do |f|
f.write(priv)
end