Skip to content

Commit

Permalink
Fix file/dir creation permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
geofffranks authored and ebroberson committed Sep 13, 2024
1 parent b1fc8c3 commit 2a095f5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/code.cloudfoundry.org/lib/testsupport/asg_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func CreateTempFile(content string) (string, error) {
}

path := tmpFile.Name()
err = os.WriteFile(path, []byte(content), os.ModePerm)
err = os.WriteFile(path, []byte(content), 0644)
if err != nil {
return "", err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func WriteConfigFile(policyServerConfig interface{}) string {
configBytes, err := json.Marshal(policyServerConfig)
Expect(err).NotTo(HaveOccurred())

err = os.WriteFile(configFile.Name(), configBytes, os.ModePerm)
err = os.WriteFile(configFile.Name(), configBytes, 0644)
Expect(err).NotTo(HaveOccurred())

return configFile.Name()
Expand Down
2 changes: 1 addition & 1 deletion src/code.cloudfoundry.org/test-helpers/tls_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,6 @@ func buildCertPem(privKey *rsa.PrivateKey, caFilePath string) (cert []byte, key
func writeClientCredFile(data []byte) string {
tempFile, err := os.CreateTemp(os.TempDir(), "clientcredstest")
Expect(err).NotTo(HaveOccurred())
Expect(os.WriteFile(tempFile.Name(), data, os.ModePerm)).To(Succeed())
Expect(os.WriteFile(tempFile.Name(), data, 0600)).To(Succeed())
return tempFile.Name()
}

0 comments on commit 2a095f5

Please sign in to comment.