Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: Don't try to copy files over themselves #7273

Merged
merged 1 commit into from Jun 22, 2016
Merged

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Jun 22, 2016

When copying a config module, make sure the full path for src and dst
files don't match, and also check the inode in case we resolved a
different path to the same file.

Make a note about the unsafe usage of reusing a tempDir path.

fixes #7238

@jen20
Copy link
Contributor

jen20 commented Jun 22, 2016

This LGTM in principle (pending the Travis failure being fixed up)! Great catch!

@jbardin
Copy link
Member Author

jbardin commented Jun 22, 2016

hmm, where did I miss the tests locally ... (oh, they're in command/)

When copying a config module, make sure the full path for src and dst
files don't match, and also check the inode in case we resolved a
different path to the same file.

Make a note about the unsafe usage of reusing a tempDir path.
@jbardin
Copy link
Member Author

jbardin commented Jun 22, 2016

Forgot to check for IsNotExist. Tests should pass now

@jbardin jbardin merged commit 146d40a into master Jun 22, 2016
@jbardin jbardin deleted the jbardin/GH-7238 branch June 22, 2016 15:38
jbardin added a commit that referenced this pull request Jun 23, 2016
The syscall.Stat_t type doesn't exist on windows, so the inode lookup
needs to be in a file with proper build constraints.
jen20 added a commit that referenced this pull request Jun 24, 2016
@jbardin jbardin mentioned this pull request Jul 5, 2016
@ghost
Copy link

ghost commented Apr 25, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@hashicorp hashicorp locked and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

terraform init blanks files
3 participants