diff options
author | Dan Magnus Lindvall <magnus@dnmgns.com> | 2017-06-08 04:08:22 +0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-06-08 10:08:22 +0800 |
commit | ff7424179ecad0f6c33246be82dafeacd1ee875c (patch) | |
tree | 887c65685f47589fa051052a3bb4faff1c8f7e72 /models/ssh_key.go | |
parent | 65cf6cc84873faf5234c99c4013644613a6123db (diff) | |
download | gitea-ff7424179ecad0f6c33246be82dafeacd1ee875c.tar.gz gitea-ff7424179ecad0f6c33246be82dafeacd1ee875c.zip |
Delete Public SSH Key tmp file after calculating fingerprint (#1855)
* Delete public key tmp file after calculating fingerprint
Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
* Move line
Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
* Remove defer statement
Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
* Readd defer statement and move remove
Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
* Delete space
Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
Diffstat (limited to 'models/ssh_key.go')
-rw-r--r-- | models/ssh_key.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/models/ssh_key.go b/models/ssh_key.go index fa33cd4c15..38b172d2ed 100644 --- a/models/ssh_key.go +++ b/models/ssh_key.go @@ -376,6 +376,7 @@ func calcFingerprint(publicKeyContent string) (string, error) { if err != nil { return "", err } + defer os.Remove(tmpPath) stdout, stderr, err := process.GetManager().Exec("AddPublicKey", "ssh-keygen", "-lf", tmpPath) if err != nil { return "", fmt.Errorf("'ssh-keygen -lf %s' failed with error '%s': %s", tmpPath, err, stderr) |