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 gosec failures #286

Merged
merged 1 commit into from
Mar 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions cmd/runmqdevserver/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion cmd/runmqserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions cmd/runmqserver/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down