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 6c72122 commit a085a2b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func main() {
HostGuid: conf.HostGuid,
}
iptablesLogger := lager.NewLogger(fmt.Sprintf("%s.iptables", logPrefix))
outputLogFile, err := os.OpenFile(conf.OutputLogFile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
outputLogFile, err := os.OpenFile(conf.OutputLogFile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0644)
if err != nil {
logger.Fatal("open-output-log-file", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (dfwf DefaultFileWriterFunc) NewWriter(fileName string) (io.Writer, error)
}

func DefaultFileWriter(fileName string) (io.Writer, error) {
return os.OpenFile(fileName, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
return os.OpenFile(fileName, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0644)
}

//go:generate counterfeiter -o ../fakes/destinationfileinfo.go --fake-name DestinationFileInfo . DestinationFileInfo
Expand Down
2 changes: 1 addition & 1 deletion src/code.cloudfoundry.org/lib/datastore/datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func (c *Store) updateVersion() error {
if err != nil {
return err
}
err = os.WriteFile(c.VersionFilePath, []byte(strconv.Itoa(version+1)), os.ModePerm)
err = os.WriteFile(c.VersionFilePath, []byte(strconv.Itoa(version+1)), 0600)
if err != nil {
// not tested
return fmt.Errorf("write version file: %s", err)
Expand Down

0 comments on commit a085a2b

Please sign in to comment.