diff options
author | Unknwon <u@gogs.io> | 2015-11-30 15:40:05 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-11-30 15:40:05 -0500 |
commit | ca96e04e5fafc179f2b0a5460754e0fb4fe9e2d8 (patch) | |
tree | 3801dda5728bfa54992e29941130169d521661dc /modules/ssh | |
parent | 9950f5a5bdd21220ac681cfc6ecdee52b1a3c687 (diff) | |
download | gitea-ca96e04e5fafc179f2b0a5460754e0fb4fe9e2d8.tar.gz gitea-ca96e04e5fafc179f2b0a5460754e0fb4fe9e2d8.zip |
#1681 carry --config flag for builtin SSH
Diffstat (limited to 'modules/ssh')
-rw-r--r-- | modules/ssh/ssh.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/ssh/ssh.go b/modules/ssh/ssh.go index fec43b7901..12e5892945 100644 --- a/modules/ssh/ssh.go +++ b/modules/ssh/ssh.go @@ -65,7 +65,10 @@ func handleServerConn(keyID string, chans <-chan ssh.NewChannel) { cmdName := strings.TrimLeft(payload, "'()") os.Setenv("SSH_ORIGINAL_COMMAND", cmdName) log.Trace("Payload: %v", cmdName) - cmd := exec.Command(setting.AppPath, "serv", "key-"+keyID) + + args := []string{"serv", "key-" + keyID, "--config=" + setting.CustomConf} + log.Trace("Arguments: %v", args) + cmd := exec.Command(setting.AppPath, args...) stdout, err := cmd.StdoutPipe() if err != nil { @@ -153,6 +156,7 @@ func Listen(port int) { if err != nil { panic(fmt.Sprintf("Fail to generate private key: %v - %s", err, stderr)) } + log.Trace("New private key is generateed: %s", keyPath) } privateBytes, err := ioutil.ReadFile(keyPath) |