mirror of
https://github.com/gogs/gogs.git
synced 2026-05-07 20:37:27 +02:00
models: rename RewriteAllPublicKeys -> RewriteAuthorizedKeys
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user