Browse Source

fix rename failed when rewrite public keys (#7761)

for-closed-social
Lunny Xiao 4 years ago
committed by GitHub
parent
commit
4328d8e8d7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      models/ssh_key.go

+ 3
- 1
models/ssh_key.go View File

@ -685,12 +685,14 @@ func rewriteAllPublicKeys(e Engine) error {
}
_, err = t.WriteString(line + "\n")
if err != nil {
f.Close()
return err
}
}
defer f.Close()
f.Close()
}
t.Close()
return os.Rename(tmpPath, fPath)
}

Loading…
Cancel
Save