diff options
author | Antoine GIRARD <sapk@users.noreply.github.com> | 2019-05-10 00:41:43 +0200 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2019-05-09 18:41:43 -0400 |
commit | 10ff527faefb14b1e06e300d8a4cb3c436c37445 (patch) | |
tree | 94a1f4db8af752029f4731d9c76c10eba091d12c | |
parent | 2f21bc33a528894c085bf944666f668725f04d8a (diff) | |
download | gitea-10ff527faefb14b1e06e300d8a4cb3c436c37445.tar.gz gitea-10ff527faefb14b1e06e300d8a4cb3c436c37445.zip |
internal/ssh: ignore env command totally (#6825)
* ssh: ignore env command totally
* Remove commented code
Needed fix described in issue #6889
-rw-r--r-- | modules/ssh/ssh.go | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/modules/ssh/ssh.go b/modules/ssh/ssh.go index f42c576cdb..98ff50bfec 100644 --- a/modules/ssh/ssh.go +++ b/modules/ssh/ssh.go @@ -52,18 +52,6 @@ func handleServerConn(keyID string, chans <-chan ssh.NewChannel) { for req := range in { payload := cleanCommand(string(req.Payload)) switch req.Type { - case "env": - args := strings.Split(strings.Replace(payload, "\x00", "", -1), "\v") - if len(args) != 2 { - log.Warn("SSH: Invalid env arguments: '%#v'", args) - continue - } - args[0] = strings.TrimLeft(args[0], "\x04") - _, _, err := com.ExecCmdBytes("env", args[0]+"="+args[1]) - if err != nil { - log.Error("env: %v", err) - return - } case "exec": cmdName := strings.TrimLeft(payload, "'()") log.Trace("SSH: Payload: %v", cmdName) |