mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
✅ gosec
This commit is contained in:
@@ -290,9 +290,9 @@ func handleCommandTask(task *pb.Task, result *pb.TaskResult) {
|
||||
}
|
||||
timeout := time.NewTimer(time.Hour * 2)
|
||||
if utils.IsWindows() {
|
||||
cmd = exec.Command("cmd", "/c", task.GetData())
|
||||
cmd = exec.Command("cmd", "/c", task.GetData()) // #nosec
|
||||
} else {
|
||||
cmd = exec.Command("sh", "-c", task.GetData())
|
||||
cmd = exec.Command("sh", "-c", task.GetData()) // #nosec
|
||||
}
|
||||
cmd.Env = os.Environ()
|
||||
pg.AddProcess(cmd)
|
||||
|
||||
@@ -32,7 +32,7 @@ func Start() (*Pty, error) {
|
||||
if shellPath == "" {
|
||||
return nil, errors.New("没有可用终端")
|
||||
}
|
||||
cmd := exec.Command(shellPath)
|
||||
cmd := exec.Command(shellPath) // #nosec
|
||||
cmd.Env = append(os.Environ(), "TERM=xterm")
|
||||
tty, err := opty.Start(cmd)
|
||||
return &Pty{tty: tty, cmd: cmd}, err
|
||||
|
||||
@@ -29,10 +29,10 @@ func ServeWeb(port uint) *http.Server {
|
||||
return t.Format("2006年1月2号 15:04:05")
|
||||
},
|
||||
"safe": func(s string) template.HTML {
|
||||
return template.HTML(s)
|
||||
return template.HTML(s) // #nosec
|
||||
},
|
||||
"tag": func(s string) template.HTML {
|
||||
return template.HTML(`<` + s + `>`)
|
||||
return template.HTML(`<` + s + `>`) // #nosec
|
||||
},
|
||||
"stf": func(s uint64) string {
|
||||
return time.Unix(int64(s), 0).Format("2006年1月2号 15:04")
|
||||
|
||||
Reference in New Issue
Block a user