1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-23 08:47:42 -05:00

Merge pull request #2169 from bclermont/develop

Ignore invalid env for SSH Server (OSX fix)
This commit is contained in:
Unknwon 2015-12-13 07:21:45 -05:00
commit 42a8c15ad0

View file

@ -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])