opentofu/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 Adding some abstractions for the communicators 2015-05-01 18:48:54 +02:00
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_mock.go Adding the tests... 2015-05-08 18:17:57 +02:00
communicator_test.go Adding support for WinRM 2015-05-01 18:48:54 +02:00
communicator.go Adding support for WinRM 2015-05-01 18:48:54 +02:00