Skip to content

Commit

Permalink
Open private key file in binary mode when writing
Browse files Browse the repository at this point in the history
Prevent newlines from being converted to CRLF when writing private key
to file.
  • Loading branch information
chrisroberts committed Jan 13, 2024
1 parent b3c9f0d commit 0a8f99d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/communicators/ssh/communicator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def ready?

# 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

Expand Down

0 comments on commit 0a8f99d

Please sign in to comment.