Skip to content

Commit

Permalink
Merge pull request #1601 from buildkite/revert-1580-mkdir-not-world-r…
Browse files Browse the repository at this point in the history
…eadable

Revert "Create directories only accessible by current user and group"
  • Loading branch information
moskyb authored Apr 4, 2022
2 parents 5fc5d16 + f4f9cf0 commit f89af11
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion agent/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (d Download) try() error {
}

// Now make the folder for our file
err = os.MkdirAll(targetDirectory, 0770)
err = os.MkdirAll(targetDirectory, 0777)
if err != nil {
return fmt.Errorf("Failed to create folder for %s (%T: %v)", targetFile, err, err)
}
Expand Down
2 changes: 1 addition & 1 deletion agent/job_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func NewJobRunner(l logger.Logger, scope *metrics.Scope, ag *api.AgentRegisterRe
// TempDir is not guaranteed to exist
tempDir := os.TempDir()
if _, err := os.Stat(tempDir); os.IsNotExist(err) {
if err = os.MkdirAll(tempDir, 0770); err != nil {
if err = os.MkdirAll(tempDir, 0777); err != nil {
return nil, err
}
}
Expand Down
6 changes: 3 additions & 3 deletions bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ func (b *Bootstrap) checkoutPlugin(p *plugin.Plugin) (*pluginCheckout, error) {
}

// Ensure the plugin directory exists, otherwise we can't create the lock
err = os.MkdirAll(b.PluginsPath, 0770)
err = os.MkdirAll(b.PluginsPath, 0777)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -1005,7 +1005,7 @@ func (b *Bootstrap) createCheckoutDir() error {

if !utils.FileExists(checkoutPath) {
b.shell.Commentf("Creating \"%s\"", checkoutPath)
if err := os.MkdirAll(checkoutPath, 0770); err != nil {
if err := os.MkdirAll(checkoutPath, 0777); err != nil {
return err
}
}
Expand Down Expand Up @@ -1191,7 +1191,7 @@ func (b *Bootstrap) updateGitMirror() (string, error) {
// Create the mirrors path if it doesn't exist
if baseDir := filepath.Dir(mirrorDir); !utils.FileExists(baseDir) {
b.shell.Commentf("Creating \"%s\"", baseDir)
if err := os.MkdirAll(baseDir, 0770); err != nil {
if err := os.MkdirAll(baseDir, 0777); err != nil {
return "", err
}
}
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/shell/tempfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TempFileWithExtension(filename string) (*os.File, error) {
// TempDir is not guaranteed to exist
tempDir := os.TempDir()
if _, err := os.Stat(tempDir); os.IsNotExist(err) {
if err = os.MkdirAll(tempDir, 0770); err != nil {
if err = os.MkdirAll(tempDir, 0777); err != nil {
return nil, err
}
}
Expand Down
2 changes: 1 addition & 1 deletion clicommand/agent_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ var AgentStartCommand = cli.Command{
// so we may as well check that'll work now and fail early if it's a problem
if !utils.FileExists(agentConf.BuildPath) {
l.Info("Build Path doesn't exist, creating it (%s)", agentConf.BuildPath)
if err := os.MkdirAll(agentConf.BuildPath, 0770); err != nil {
if err := os.MkdirAll(agentConf.BuildPath, 0777); err != nil {
l.Fatal("Failed to create builds path: %v", err)
}
}
Expand Down

0 comments on commit f89af11

Please sign in to comment.