Page MenuHomePhabricator

Merge #11131: rpc: Write authcookie atomically
ClosedPublic

Authored by nakihito on Aug 22 2019, 20:45.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Owners added a reviewer: Restricted Owners Package.Aug 22 2019, 20:45
This revision is now accepted and ready to land.Aug 23 2019, 09:38