From 9b8fa69c15e4492c3e560e3ad968054717872257 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 10 Feb 2017 02:26:55 -0500 Subject: models/ssh_key: fix SSH_KEYGEN_PATH not working (#3770) --- models/ssh_key.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'models') diff --git a/models/ssh_key.go b/models/ssh_key.go index 3c970848..231ae1e1 100644 --- a/models/ssh_key.go +++ b/models/ssh_key.go @@ -385,9 +385,10 @@ func addKey(e Engine, key *PublicKey) (err error) { if err = ioutil.WriteFile(tmpPath, []byte(key.Content), 0644); err != nil { return err } - stdout, stderr, err := process.Exec("AddPublicKey", "ssh-keygen", "-lf", tmpPath) + + stdout, stderr, err := process.Exec("AddPublicKey", setting.SSH.KeygenPath, "-lf", tmpPath) if err != nil { - return fmt.Errorf("'ssh-keygen -lf %s' failed with error '%s': %s", tmpPath, err, stderr) + return fmt.Errorf("fail to parse public key: %s - %s", err, stderr) } else if len(stdout) < 2 { return errors.New("not enough output for calculating fingerprint: " + stdout) } -- cgit v1.2.3