aboutsummaryrefslogtreecommitdiff
path: root/models/ssh_key.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-02-10 02:26:55 -0500
committerUnknwon <u@gogs.io>2017-02-10 02:26:55 -0500
commit9b8fa69c15e4492c3e560e3ad968054717872257 (patch)
tree97ea4e02af6236399253c9e7db02bc1bf10c27f9 /models/ssh_key.go
parentf5dc43644184a7c3f613d5f3e1aa1be8ed8d13af (diff)
models/ssh_key: fix SSH_KEYGEN_PATH not working (#3770)
Diffstat (limited to 'models/ssh_key.go')
-rw-r--r--models/ssh_key.go5
1 files changed, 3 insertions, 2 deletions
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)
}