25 lines
623 B
Diff
25 lines
623 B
Diff
|
diff --git a/shells/bash.go b/shells/bash.go
|
||
|
--- a/shells/bash.go
|
||
|
+++ b/shells/bash.go
|
||
|
@@ -5,6 +5,7 @@ import (
|
||
|
"bytes"
|
||
|
"fmt"
|
||
|
"io"
|
||
|
+ "os/exec"
|
||
|
"path"
|
||
|
"runtime"
|
||
|
"strconv"
|
||
|
@@ -249,7 +250,11 @@ func (b *BashShell) GetConfiguration(inf
|
||
|
if info.User != "" {
|
||
|
script.Command = "su"
|
||
|
if runtime.GOOS == "linux" {
|
||
|
- script.Arguments = append(script.Arguments, "-s", "/bin/"+b.Shell)
|
||
|
+ shellPath, err := exec.LookPath(b.Shell)
|
||
|
+ if err != nil {
|
||
|
+ shellPath = "/bin/" + b.Shell
|
||
|
+ }
|
||
|
+ script.Arguments = append(script.Arguments, "-s", shellPath)
|
||
|
}
|
||
|
script.Arguments = append(
|
||
|
script.Arguments,
|