Skip to content

Commit

Permalink
Update ssh_connector.go
Browse files Browse the repository at this point in the history
WARNING: Use `nolint:gosec` annotation
  • Loading branch information
dbbDylan authored Sep 14, 2024
1 parent 71526e3 commit 1bf5b88
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/connector/ssh_connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ func (c *sshConnector) ExecuteCommand(_ context.Context, cmd string) ([]byte, er
}
defer session.Close()

command := exec.Command("sudo", "-E", c.shell, "-c", fmt.Sprintf("\"%s\"", cmd))
// nolint:gosec
command := exec.CommandContext(ctx, "sudo", "-E", c.shell, "-c", fmt.Sprint("\""), cmd, fmt.Sprint("\""))

Check failure on line 250 in pkg/connector/ssh_connector.go

View workflow job for this annotation

GitHub Actions / lint

undefined: ctx (typecheck)

Check failure on line 250 in pkg/connector/ssh_connector.go

View workflow job for this annotation

GitHub Actions / lint

undefined: ctx) (typecheck)

Check failure on line 250 in pkg/connector/ssh_connector.go

View workflow job for this annotation

GitHub Actions / lint

undefined: ctx) (typecheck)

Check failure on line 250 in pkg/connector/ssh_connector.go

View workflow job for this annotation

GitHub Actions / test

undefined: ctx
// get pipe from session
stdin, _ := session.StdinPipe()
stdout, _ := session.StdoutPipe()
Expand Down

0 comments on commit 1bf5b88

Please sign in to comment.