#1681 carry --config flag for builtin SSH

release/v1.15
Unknwon 2015-11-30 15:40:05 -05:00
parent 9950f5a5bd
commit ca96e04e5f
1 changed files with 5 additions and 1 deletions

View File

@ -65,7 +65,10 @@ func handleServerConn(keyID string, chans <-chan ssh.NewChannel) {
cmdName := strings.TrimLeft(payload, "'()") cmdName := strings.TrimLeft(payload, "'()")
os.Setenv("SSH_ORIGINAL_COMMAND", cmdName) os.Setenv("SSH_ORIGINAL_COMMAND", cmdName)
log.Trace("Payload: %v", 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() stdout, err := cmd.StdoutPipe()
if err != nil { if err != nil {
@ -153,6 +156,7 @@ func Listen(port int) {
if err != nil { if err != nil {
panic(fmt.Sprintf("Fail to generate private key: %v - %s", err, stderr)) 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) privateBytes, err := ioutil.ReadFile(keyPath)