Add server argument as first argument in unbound input (#4062)

(cherry picked from commit c7b3667ac4)
This commit is contained in:
Fred Cox 2018-04-23 23:27:29 +03:00 committed by Daniel Nelson
parent 58f6c0e22b
commit cd1c2e9cd8
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
1 changed files with 2 additions and 2 deletions

View File

@ -87,7 +87,7 @@ func unboundRunner(cmdName string, Timeout internal.Duration, UseSudo bool, Serv
server = server + "@" + port
}
cmdArgs = append(cmdArgs, "-s", server)
cmdArgs = append([]string{"-s", server}, cmdArgs...)
}
cmd := exec.Command(cmdName, cmdArgs...)
@ -101,7 +101,7 @@ func unboundRunner(cmdName string, Timeout internal.Duration, UseSudo bool, Serv
cmd.Stdout = &out
err := internal.RunTimeout(cmd, Timeout.Duration)
if err != nil {
return &out, fmt.Errorf("error running unbound-control: %s", err)
return &out, fmt.Errorf("error running unbound-control: %s (%s %v)", err, cmdName, cmdArgs)
}
return &out, nil