Skip to content

Commit

Permalink
unsafe hardcoded defaults for file creation
Browse files Browse the repository at this point in the history
This affects files created with `resource "local_file"`, see hashicorp/terraform#14768
  • Loading branch information
razvan-moj-zz committed Oct 18, 2018
1 parent 4db20a7 commit 9702de4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions local/resource_local_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ func resourceLocalFileCreate(d *schema.ResourceData, _ interface{}) error {

destinationDir := path.Dir(destination)
if _, err := os.Stat(destinationDir); err != nil {
if err := os.MkdirAll(destinationDir, 0777); err != nil {
if err := os.MkdirAll(destinationDir, 0755); err != nil {
return err
}
}

if err := ioutil.WriteFile(destination, []byte(content), 0777); err != nil {
if err := ioutil.WriteFile(destination, []byte(content), 0644)); err != nil {
return err
}

Expand Down

0 comments on commit 9702de4

Please sign in to comment.