mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-23 19:34:14 +01:00
ignore invalid env
This commit is contained in:
parent
71123c816d
commit
9a27e5ccdc
1 changed files with 2 additions and 1 deletions
|
@ -53,7 +53,8 @@ func handleServerConn(keyID string, chans <-chan ssh.NewChannel) {
|
||||||
case "env":
|
case "env":
|
||||||
args := strings.Split(strings.Replace(payload, "\x00", "", -1), "\v")
|
args := strings.Split(strings.Replace(payload, "\x00", "", -1), "\v")
|
||||||
if len(args) != 2 {
|
if len(args) != 2 {
|
||||||
return
|
log.Warn("Invalid env arguments: '%#v'", args)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
args[0] = strings.TrimLeft(args[0], "\x04")
|
args[0] = strings.TrimLeft(args[0], "\x04")
|
||||||
_, _, err := com.ExecCmdBytes("env", args[0]+"="+args[1])
|
_, _, err := com.ExecCmdBytes("env", args[0]+"="+args[1])
|
||||||
|
|
Loading…
Reference in a new issue