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
This commit is contained in:
wxiaoguang 2023-06-19 00:56:21 +08:00 committed by GitHub
parent cc73f6e821
commit e0bd6ebabd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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