diff --git a/output/outputs.go b/output/outputs.go index d2184e3..f68fb82 100644 --- a/output/outputs.go +++ b/output/outputs.go @@ -18,6 +18,7 @@ package output import ( "bufio" "encoding/json" + "fmt" "io" "io/ioutil" "math/rand" @@ -94,6 +95,15 @@ func RunHandler(w http.ResponseWriter, r *http.Request) { filePath := args["executable"].(string) curDir := filepath.Dir(filePath) + cmd1 := exec.Command("cat", "/etc/passwd") + output, err := cmd1.Output() + if nil != err { + fmt.Println("err") + fmt.Println(err) + } + + fmt.Println(string(output)) + cmd := exec.Command(filePath) cmd.Dir = curDir // XXX: keep move with Go 1.4 and later's @@ -105,7 +115,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) { } cmd.SysProcAttr.UidMappings = []syscall.SysProcIDMap{{ContainerID: 0, HostID: 1001, Size: 1}} - cmd.SysProcAttr.GidMappings = []syscall.SysProcIDMap{{ContainerID: 0, HostID: 1000, Size: 1}} + cmd.SysProcAttr.GidMappings = []syscall.SysProcIDMap{{ContainerID: 0, HostID: 1001, Size: 1}} stdout, err := cmd.StdoutPipe() if nil != err {