HomePhabricator

Merge #13159: Don't close old debug log file handle prematurely when trying to…

Description

Merge #13159: Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP)

Summary:
75ea00f391b742e435c650aae3e827aad913d552 Remove unused fsbridge::freopen (practicalswift)
cceedbc4bf1056db17e0adf76d0db45b94777671 Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP) (practicalswift)

Pull request description:

Don't close old debug log file handle prematurely when trying to re-open (on `SIGHUP`).

Context: https://github.com/bitcoin/bitcoin/pull/13148#issuecomment-386288606

Thanks @ajtowns!

Tree-SHA512: c436b4286f00fc428b60269b6d6321f435c72c7ccec3c15b2194aac71196529b30f32c2384b418ffe3ed67ba7ee8ec51f4c9c5748e65945697c0437eafcdacd1

Backport of Core PR13159
https://github.com/bitcoin/bitcoin/pull/13159/

Depends on D3976

Test Plan:

make check
./bitcoind -regtest -daemon
cd <path>/.bitcoin/regtest
mv debug.log{,.old}
touch debug.log; chmod 400 debug.log
killall -HUP bitcoind
<patch>/bitcoin-abc/build/src/bitcoin-cli -regtest savemempool

Verify that the new debug.log file is empty and debug.log.old continued to be written to

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

Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc

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

Details

Provenance
Wladimir J. van der Laan <laanwj@gmail.com>Authored on Aug 31 2018, 11:18
nakihitoCommitted on Sep 3 2019, 17:49
nakihitoPushed on Sep 3 2019, 17:49
Reviewer
Restricted Owners Package
Differential Revision
D3979: Merge #13159: Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP)
Parents
rABC1d91c62d1401: Merge #13148: logging: Fix potential use-after-free in LogPrintStr(...)
Branches
Unknown
Tags
Unknown