diff options
author | Unknwon <u@gogs.io> | 2018-03-30 01:26:36 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2018-03-30 01:26:36 -0400 |
commit | a855abf8c0de73fb3a9913000e1eb8d8ea9840ff (patch) | |
tree | cdf3bf423ad2104c1406cd9acb67d86511584e09 /models/ssh_key.go | |
parent | 0d2398aaff7f887adf79e8c40f4ad4584036e7f5 (diff) |
models: rename RewriteAllPublicKeys -> RewriteAuthorizedKeys
Diffstat (limited to 'models/ssh_key.go')
-rw-r--r-- | models/ssh_key.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/models/ssh_key.go b/models/ssh_key.go index 6c35b70a..350c5f75 100644 --- a/models/ssh_key.go +++ b/models/ssh_key.go @@ -512,16 +512,18 @@ func DeletePublicKey(doer *User, id int64) (err error) { return err } - return RewriteAllPublicKeys() + return RewriteAuthorizedKeys() } -// RewriteAllPublicKeys removes any authorized key and rewrite all keys from database again. +// RewriteAuthorizedKeys removes any authorized key and rewrite all keys from database again. // Note: x.Iterate does not get latest data after insert/delete, so we have to call this function // outsite any session scope independently. -func RewriteAllPublicKeys() error { +func RewriteAuthorizedKeys() error { sshOpLocker.Lock() defer sshOpLocker.Unlock() + log.Trace("Doing: RewriteAuthorizedKeys") + os.MkdirAll(setting.SSH.RootPath, os.ModePerm) fpath := filepath.Join(setting.SSH.RootPath, "authorized_keys") tmpPath := fpath + ".tmp" |