terraform/communicator
Mitchell Hashimoto 4b1d9cfd7d
communicator/ssh: don't share rand object to guarantee unique values
Fixes #10463

I'm really surprised this flew under the radar for years...

By having unique PRNGs, the SSH communicator could and would
generate identical ScriptPaths and two provisioners running in parallel
could overwrite each other and execute the same script. This would
happen because they're both seeded by the current time which could
potentially be identical if done in parallel...

Instead, we share the rand now so that the sequence is guaranteed
unique. As an extra measure of robustness, we also multiple by the PID
so that we're also protected against two processes at the same time.
2016-12-06 00:21:49 -08:00
..
remote
shared provisioners: Allow provisioning over IPv6 2016-09-03 15:45:24 -07:00
ssh communicator/ssh: don't share rand object to guarantee unique values 2016-12-06 00:21:49 -08:00
winrm provisioners: Allow provisioning over IPv6 2016-09-03 15:45:24 -07:00
communicator.go
communicator_mock.go
communicator_test.go