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.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"