aboutsummaryrefslogtreecommitdiff
path: root/models/ssh_key.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2018-03-30 01:26:36 -0400
committerUnknwon <u@gogs.io>2018-03-30 01:26:36 -0400
commita855abf8c0de73fb3a9913000e1eb8d8ea9840ff (patch)
treecdf3bf423ad2104c1406cd9acb67d86511584e09 /models/ssh_key.go
parent0d2398aaff7f887adf79e8c40f4ad4584036e7f5 (diff)
models: rename RewriteAllPublicKeys -> RewriteAuthorizedKeys
Diffstat (limited to 'models/ssh_key.go')
-rw-r--r--models/ssh_key.go8
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"