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

Fix G306 gosec issues #10380

Draft
wants to merge 7 commits into
base: dimitar/fix-G301
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
i'm speechless
Signed-off-by: Dimitar Dimitrov <[email protected]>
  • Loading branch information
dimitarvdimitrov committed Jan 9, 2025
commit a5d4a1c143752804d8eab389ece6c526f4915ef3
2 changes: 1 addition & 1 deletion integration/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func writeFileToSharedDir(s *e2e.Scenario, dst string, content []byte) error {
return os.WriteFile(
dst,
content,
os.ModePerm)
0600)
}

func copyFileToSharedDir(s *e2e.Scenario, src, dst string) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/compactor/bucket_compactor_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ func createEmptyBlock(dir string, mint, maxt int64, extLset labels.Labels, resol
return ulid.ULID{}, err
}

if err := os.WriteFile(path.Join(dir, uid.String(), "meta.json"), b, os.ModePerm); err != nil {
if err := os.WriteFile(path.Join(dir, uid.String(), "meta.json"), b, 0600); err != nil {
return ulid.ULID{}, errors.Wrap(err, "saving meta.json")
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/storegateway/indexheader/lazy_binary_reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func TestNewLazyBinaryReader_ShouldRebuildCorruptedIndexHeader(t *testing.T) {

// Write a corrupted index-header for the block.
headerFilename := filepath.Join(tmpDir, blockID.String(), block.IndexHeaderFilename)
require.NoError(t, os.WriteFile(headerFilename, []byte("xxx"), os.ModePerm))
require.NoError(t, os.WriteFile(headerFilename, []byte("xxx"), 0600))

testLazyBinaryReader(t, bkt, tmpDir, blockID, func(t *testing.T, r *LazyBinaryReader, err error) {
require.NoError(t, err)
Expand Down