aboutsummaryrefslogtreecommitdiff
path: root/models/ssh_key.go
diff options
context:
space:
mode:
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)
}