Skip to content

Commit

Permalink
fix(cmds): Create AK/SK file with 600
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninja243 committed Dec 4, 2024
1 parent 01d6f83 commit a6e7fbc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions common/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ func RemoveFromSliceAtIndex[T any](s []T, index int) []T {
}

func WriteStringToFile(filepath string, content string) {
outputFile, err := os.Create(filepath)
outputFile, err := os.OpenFile(filepath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0o600)
if err != nil {
ThrowError(fmt.Errorf("fatal: error creating output file.\ntrace: %w", err))
}

_, err = outputFile.WriteString(content)
if err != nil {
ThrowError(fmt.Errorf("fatal: error writing to file.\ntrace: %w", err))
Expand Down

0 comments on commit a6e7fbc

Please sign in to comment.