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

treewide: drop inappropriate executable bits #335

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func initializer(cmd *cobra.Command, _ []string) error {
}

// Write the byte array to file
if err = afero.WriteFile(fs, "./bbi.yaml", yamlString, 0755); err != nil {
if err = afero.WriteFile(fs, "./bbi.yaml", yamlString, 0644); err != nil {
return fmt.Errorf("write bbi.yaml: %w", err)
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func (l LocalModel) Cleanup(channels *turnstile.ChannelMap) {
// Write to File in original path indicating what all was copied
copiedJSON, _ := json.MarshalIndent(copied, "", " ")

if err = afero.WriteFile(fs, path.Join(l.Nonmem.OriginalPath, l.Nonmem.FileName+"_copied.json"), copiedJSON, 0750); err != nil {
if err = afero.WriteFile(fs, path.Join(l.Nonmem.OriginalPath, l.Nonmem.FileName+"_copied.json"), copiedJSON, 0640); err != nil {
channels.Errors <- turnstile.ConcurrentError{
RunIdentifier: l.Nonmem.FileName,
Notes: "could not write _copied.json file",
Expand Down Expand Up @@ -475,7 +475,7 @@ func executeLocalJob(model *NonMemModel) turnstile.ConcurrentError {
return newConcurrentError(model.Model, "Running the programmatic shell script caused an error", err)
}

if err = afero.WriteFile(fs, path.Join(model.OutputDir, model.Model+".out"), output, 0750); err != nil {
if err = afero.WriteFile(fs, path.Join(model.OutputDir, model.Model+".out"), output, 0640); err != nil {
return turnstile.ConcurrentError{Error: err, Notes: "unable to write model to output directory", RunIdentifier: model.FileName}
}

Expand Down Expand Up @@ -534,7 +534,7 @@ func writeNonmemConfig(model *NonMemModel) error {
return err
}

return afero.WriteFile(afero.NewOsFs(), path.Join(model.OutputDir, "bbi_config.json"), outBytes, 0750)
return afero.WriteFile(afero.NewOsFs(), path.Join(model.OutputDir, "bbi_config.json"), outBytes, 0640)
}

func HashFileOnChannel(ch chan string, file string, identifier string) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func logSetup(config configlib.Config) {
var outfile afero.File

if ok, _ := afero.Exists(fs, logfile); ok {
of, err := fs.OpenFile(logfile, os.O_APPEND|os.O_WRONLY, 0755)
of, err := fs.OpenFile(logfile, os.O_APPEND|os.O_WRONLY, 0644)

if err != nil {
log.Fatalf("Unable to open file at %s. Error is %s", logfile, err)
Expand Down
2 changes: 1 addition & 1 deletion cmd/sge.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ func executeSGEJob(model *NonMemModel) turnstile.ConcurrentError {
}
}

err = afero.WriteFile(fs, path.Join(model.OutputDir, model.Model+".out"), output, 0750)
err = afero.WriteFile(fs, path.Join(model.OutputDir, model.Model+".out"), output, 0640)

if err != nil {
return newConcurrentError(model.Model, "Having issues writing hte output file from command execution", err)
Expand Down
2 changes: 1 addition & 1 deletion configlib/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (c Config) RenderYamlToFile(path string) error {

targetFile := filepath.Join(path, "bbi.yaml")

err = afero.WriteFile(fs, targetFile, yamlBytes, 0755)
err = afero.WriteFile(fs, targetFile, yamlBytes, 0644)

if err != nil {
log.Error("An error occurred trying to write the serialized config yaml to file")
Expand Down
2 changes: 1 addition & 1 deletion integration/nonmem/data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestHasInvalidDataPath(tt *testing.T) {
adjusted := strings.Join(lines, "\n")
ab := []byte(adjusted)

err := os.WriteFile(filepath.Join(scenario.Workpath, m.filename), ab, 0755)
err := os.WriteFile(filepath.Join(scenario.Workpath, m.filename), ab, 0644)

if err != nil {
t.Log("Had a problem writing the file")
Expand Down