From e0bd6ebabdcfa45113beb0f3cc28362e62011716 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 19 Jun 2023 00:56:21 +0800 Subject: [PATCH] Fix incorrect config argument position for builtin SSH server (#25341) The "--config" option is a global option, it shouldn't appear at the end. Otherwise it might not be respected in some cases. Caught by #25330 and use a separate PR to fix it for 1.20 --- modules/ssh/ssh.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ssh/ssh.go b/modules/ssh/ssh.go index 4bf57eafb7..923fa51d22 100644 --- a/modules/ssh/ssh.go +++ b/modules/ssh/ssh.go @@ -68,7 +68,7 @@ func sessionHandler(session ssh.Session) { log.Trace("SSH: Payload: %v", command) - args := []string{"serv", "key-" + keyID, "--config=" + setting.CustomConf} + args := []string{"--config=" + setting.CustomConf, "serv", "key-" + keyID} log.Trace("SSH: Arguments: %v", args) ctx, cancel := context.WithCancel(session.Context())