You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Install new terraform 0.9.5 without ~/.terraform existing
2. Start terraform
3. Terraform tries to create ~/.terraform
What is the expected output? What do you see instead?
It should successfully copy PREFIX/share/terraform/ to ~/.prefix. Instead, this
files at random
points, and sometimes even works
What version of the product are you using? On what operating system?
Version 0.9.5 on Mac OS X.
The reason for the failure is simple: The code does not check the return value
of stat, nor does it
reset the variable st. It then tries to use stat() to check if a given
directory exists. But if it
*doesn't* exist, then the variable "st" will not be modified by stat(). hence
it may contain random
data. The value of S_ISDIR(st.st_mode) is undefined in this case, and may be 0
or 1 or anything
else.
The attached patch fixes the issue by checking the return value of stat().
Please provide any additional information below.
Original issue reported on code.google.com by [email protected] on 26 Jan 2010 at 11:02
Original issue reported on code.google.com by
[email protected]
on 26 Jan 2010 at 11:02Attachments:
The text was updated successfully, but these errors were encountered: