@@ -36,6 +36,7 @@ func processTemplateFile(templateFile, destFile string, data interface{}) error
|
||||
_, err = os.Stat(dir)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
// #nosec G301
|
||||
err = os.MkdirAll(dir, 0770)
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
|
||||
@@ -45,7 +45,10 @@ func doMain() error {
|
||||
// Check whether they only want debug info
|
||||
if *infoFlag {
|
||||
logVersionInfo()
|
||||
logContainerDetails()
|
||||
err = logContainerDetails()
|
||||
if err != nil {
|
||||
log.Printf("Error displaying container details: %v", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ func verifySingleProcess() error {
|
||||
|
||||
// Verifies that there is only one instance running of the given program name.
|
||||
func verifyOnlyOne(programName string) (int, error) {
|
||||
// #nosec G104
|
||||
out, _, _ := command.Run("ps", "-e", "--format", "cmd")
|
||||
//if this goes wrong then assume we are the only one
|
||||
numOfProg := strings.Count(out, programName)
|
||||
|
||||
Reference in New Issue
Block a user