mirror of https://github.com/go-gitea/gitea.git
Merge pull request #1475 from donbowman/master
Fix race condition on ssh key delete, and revert re-revert of hard line break
This commit is contained in:
commit
ce8864c69a
|
@ -386,9 +386,6 @@ func ListPublicKeys(uid int64) ([]*PublicKey, error) {
|
|||
|
||||
// rewriteAuthorizedKeys finds and deletes corresponding line in authorized_keys file.
|
||||
func rewriteAuthorizedKeys(key *PublicKey, p, tmpP string) error {
|
||||
sshOpLocker.Lock()
|
||||
defer sshOpLocker.Unlock()
|
||||
|
||||
fr, err := os.Open(p)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -444,6 +441,9 @@ func UpdatePublicKey(key *PublicKey) error {
|
|||
}
|
||||
|
||||
func deletePublicKey(e *xorm.Session, key *PublicKey) error {
|
||||
sshOpLocker.Lock()
|
||||
defer sshOpLocker.Unlock()
|
||||
|
||||
has, err := e.Get(key)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -198,7 +198,6 @@ func RenderRawMarkdown(body []byte, urlPrefix string) []byte {
|
|||
extensions |= blackfriday.EXTENSION_FENCED_CODE
|
||||
extensions |= blackfriday.EXTENSION_AUTOLINK
|
||||
extensions |= blackfriday.EXTENSION_STRIKETHROUGH
|
||||
extensions |= blackfriday.EXTENSION_HARD_LINE_BREAK
|
||||
extensions |= blackfriday.EXTENSION_SPACE_HEADERS
|
||||
extensions |= blackfriday.EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK
|
||||
|
||||
|
|
Loading…
Reference in New Issue