Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
alpe committed Apr 12, 2024
1 parent e0950a4 commit 590b8a2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/issues.yml
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v1.0.0
- uses: actions/add-to-project@v1.0.1
with:
project-url: https://github.com/orgs/cosmos/projects/26
# add all issues opened to the issue board for triage and assignment
Expand Down
22 changes: 19 additions & 3 deletions systemtests/system.go
Expand Up @@ -122,7 +122,7 @@ func (s *SystemUnderTest) SetupChain() {

// modify genesis with system test defaults
src := filepath.Join(WorkDir, s.nodePath(0), "config", "genesis.json")
genesisBz, err := os.ReadFile(src)
genesisBz, err := os.ReadFile(src) // #nosec G304
if err != nil {
panic(fmt.Sprintf("failed to load genesis: %s", err))
}
Expand Down Expand Up @@ -520,11 +520,27 @@ func (s *SystemUnderTest) ForEachNodeExecAndWait(t *testing.T, cmds ...[]string)
xargs = append(xargs, "--home", home)
s.Logf("Execute `%s %s`\n", s.execBinary, strings.Join(xargs, " "))
cmd := exec.Command( //nolint:gosec
locateExecutable("ls"),
"-la", filepath.Join(WorkDir, home),
)

Check failure

Code scanning / gosec

Subprocess launched with variable Error

Subprocess launched with a potential tainted input or cmd arguments
out, err := cmd.CombinedOutput()
require.NoError(t, err, "node %d: ls: %s", i, string(out))
s.Logf("Result ls: %s\n", string(out))

cmd = exec.Command( //nolint:gosec
locateExecutable("cat"),
filepath.Join(WorkDir, home, "config", "config.toml"),
)

Check failure

Code scanning / gosec

Subprocess launched with variable Error

Subprocess launched with a potential tainted input or cmd arguments
out, err = cmd.CombinedOutput()
require.NoError(t, err, "node %d: cat: %s", i, string(out))
s.Logf("Result cat: %s\n", string(out))

cmd = exec.Command( //nolint:gosec
locateExecutable(s.execBinary),
xargs...,
)

Check failure

Code scanning / gosec

Subprocess launched with variable Error

Subprocess launched with a potential tainted input or cmd arguments
cmd.Dir = WorkDir
out, err := cmd.CombinedOutput()
out, err = cmd.CombinedOutput()
require.NoError(t, err, "node %d: %s", i, string(out))
s.Logf("Result: %s\n", string(out))
result[i][j] = string(out)
Expand Down Expand Up @@ -898,7 +914,7 @@ func copyFile(src, dest string) (*os.File, error) {

// copyFilesInDir copy files in src dir to dest path
func copyFilesInDir(src, dest string) error {
err := os.MkdirAll(dest, 0o755)
err := os.MkdirAll(dest, 0o750)
if err != nil {
return fmt.Errorf("mkdirs: %s", err)
}
Expand Down

0 comments on commit 590b8a2

Please sign in to comment.