HomePhabricator

Merge #11131: rpc: Write authcookie atomically

Description

Merge #11131: rpc: Write authcookie atomically

Summary:
82dd719 rpc: Write authcookie atomically (Wladimir J. van der Laan)

Pull request description:

Use POSIX rename atomicity at the `bitcoind` side to create a working
cookie atomically:

- Write `.cookie.tmp`, close file
- Rename `.cookie.tmp` to `.cookie`

This avoids clients reading invalid/partial cookies as in #11129. As such, this is an alternative to that PR.

Tree-SHA512: 47fcc1ed2ff3d8fed4b7441e4939f29cc99b57b7a035673c3b55a124a2e49c8a904637a6ff700dd13a184be8c0255707d74781f8e626314916418954e2467e03

Backport of Core PR11131
https://github.com/bitcoin/bitcoin/pull/11131/

Test Plan:

make check
./bitcoind

Verify .cookie exists ine .bitcoin/<dir>/.cookie

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D3940

Details

Provenance
Wladimir J. van der Laan <laanwj@gmail.com>Authored on Aug 28 2017, 07:40
nakihitoCommitted on Aug 23 2019, 19:04
nakihitoPushed on Aug 23 2019, 19:04
Reviewer
Restricted Owners Package
Differential Revision
D3940: Merge #11131: rpc: Write authcookie atomically
Parents
rABC0832c3db3880: Merge #12721: Qt: remove "new" button during receive-mode in addressbook
Branches
Unknown
Tags
Unknown

Event Timeline