Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/patchwork-autofix-master' into r…
Browse files Browse the repository at this point in the history
…efactor
  • Loading branch information
xfhg committed Aug 1, 2024
2 parents 1124694 + c54494c commit 457be5d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions cmd/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ var apiCmd = &cobra.Command{
searchPatternFile := strings.Join([]string{pwddir, "/", "search_regex_", value.ID}, "")

searchPattern := []byte(strings.Join(value.Patterns, "\n") + "\n")
_ = os.WriteFile(searchPatternFile, searchPattern, 0644)
_ = os.WriteFile(searchPatternFile, searchPattern, 0600)

gatheringData(value, false)
processAPIType(value, false)
Expand Down Expand Up @@ -118,7 +118,7 @@ var apiCmd = &cobra.Command{

searchPatternFile := strings.Join([]string{pwddir, "/", "search_regex_", value.ID}, "")
searchPattern := []byte(strings.Join(value.Patterns, "\n") + "\n")
_ = os.WriteFile(searchPatternFile, searchPattern, 0644)
_ = os.WriteFile(searchPatternFile, searchPattern, 0600)

tagfound := FindMatchingString(scanTags, value.Tags, ",")
if tagfound || scanTags == "" {
Expand Down Expand Up @@ -182,7 +182,7 @@ var apiCmd = &cobra.Command{
LogError(_jerr)
}

_jwerr := os.WriteFile("intercept.stats.json", jsonstats, 0644)
_jwerr := os.WriteFile("intercept.stats.json", jsonstats, 0600)
if _jwerr != nil {
LogError(_jwerr)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/assure.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var assureCmd = &cobra.Command{
return
}

err = os.WriteFile("intercept.scannedSHA256.json", jsonData, 0644)
err := os.WriteFile("intercept.scannedSHA256.json", jsonData, 0600)

Check failure on line 73 in cmd/assure.go

View workflow job for this annotation

GitHub Actions / Build

no new variables on left side of :=

Check failure on line 73 in cmd/assure.go

View workflow job for this annotation

GitHub Actions / build

no new variables on left side of :=
if err != nil {
LogError(err)
}
Expand Down Expand Up @@ -195,7 +195,7 @@ var assureCmd = &cobra.Command{
LogError(_jerr)
}

_jwerr := os.WriteFile("intercept.stats.json", assurestats, 0644)
_jwerr := os.WriteFile("intercept.stats.json", assurestats, 0600)
if _jwerr != nil {
LogError(_jwerr)
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var auditCmd = &cobra.Command{
return
}

err = os.WriteFile("intercept.scannedSHA256.json", jsonData, 0644)
err = os.WriteFile("intercept.scannedSHA256.json", jsonData, 0600)
if err != nil {
LogError(err)
}
Expand Down Expand Up @@ -122,7 +122,7 @@ var auditCmd = &cobra.Command{
searchPatternFile := strings.Join([]string{pwddir, "/", "search_regex_", value.ID}, "")

searchPattern := []byte(strings.Join(value.Patterns, "\n") + "\n")
_ = os.WriteFile(searchPatternFile, searchPattern, 0644)
_ = os.WriteFile(searchPatternFile, searchPattern, 0400)

switch value.Type {

Expand Down Expand Up @@ -176,7 +176,7 @@ var auditCmd = &cobra.Command{
LogError(_jerr)
}

_jwerr := os.WriteFile("intercept.stats.json", jsonstats, 0644)
_jwerr := os.WriteFile("intercept.stats.json", jsonstats, 0600)
if _jwerr != nil {
LogError(_jwerr)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var collectCmd = &cobra.Command{
return
}

err = os.WriteFile("intercept.scannedSHA256.json", jsonData, 0644)
err = os.WriteFile("intercept.scannedSHA256.json", jsonData, 0600)
if err != nil {
LogError(err)
}
Expand Down

0 comments on commit 457be5d

Please sign in to comment.