mitigate shelling out behaviour risks

This commit is contained in:
Dan Kortschak
2022-04-24 18:49:00 +09:30
committed by Jakub
parent 5c28a3eda7
commit 1ed7b690a5
6 changed files with 14 additions and 14 deletions

View File

@ -19,10 +19,10 @@ package base
import (
"os"
"os/exec"
"strconv"
"github.com/sirupsen/logrus"
"golang.org/x/sys/execabs"
)
// maxAllowedRestarts controls after how many crashes the app will give up restarting.
@ -43,7 +43,7 @@ func (b *Base) restartApp(crash bool) error {
WithField("args", args).
Warn("Restarting")
return exec.Command(b.command, args...).Start() //nolint:gosec
return execabs.Command(b.command, args...).Start() //nolint:gosec
}
// incrementRestartFlag increments the value of the restart flag.