This commit is contained in:
		
							parent
							
								
									d5a70c5b1a
								
							
						
					
					
						commit
						7bf1c80e1e
					
				|  | @ -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 { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue