Page MenuHomePhabricator

Don't allow relative -walletdir paths
AbandonedPublic

Authored by nakihito on Mar 25 2019, 22:57.

Details

Reviewers
jasonbcox
deadalnix
Fabien
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Summary

Also warn if bitcoind is configured to use a relative -datadir path.

Specifying paths relative to the current working directory in a daemon process
can be dangerous, because files can fail to be located even if the
configuration doesn't change, but the daemon is started up differently.

Specifying a relative -datadir now adds a warning to the debug log. It would
not be backwards-compatible to forbid relative -datadir paths entirely, and it
could also be also inconvenient for command line testing.

Specifying a relative -walletdir now results in a startup error. But since the
-walletdir option is new in 0.16.0, there should be no compatibility issues.
Another reason not to use working directory paths for -walletdir specifically
is that the default -walletdir is a "wallets" subdirectory inside the datadir,
so it could be surprising that setting -walletdir manually would choose a
directory rooted in a completely different location.

Backport of PR12220
https://github.com/bitcoin/bitcoin/pull/12220/

Completes T448

Test Plan

make check
test_runner.py
bitcoind -walletdir=<relative dir> should error out

Diff Detail

Repository
rABC Bitcoin ABC
Branch
Backport12220
Lint
Lint Passed
SeverityLocationCodeMessage
Auto-Fixtest/functional/wallet_multiwallet.py:1CFMTCode style violation
Unit
No Test Coverage
Build Status
Buildable 5300
Build 8662: Bitcoin ABC Buildbot (legacy)
Build 8661: arc lint + arc unit

Event Timeline

Owners added a reviewer: Restricted Owners Package.Mar 25 2019, 22:57

Removed unwanted linter changes.

test/functional/wallet_multiwallet.py
1

There are numerous linter errors outside of the scope of this backport. See history for the potential linter changes.

Fabien requested changes to this revision.Mar 26 2019, 08:03

Thanks for pointing out that there is still an open task for this backport, I will close it.
This is already backported in D2407.

This revision now requires changes to proceed.Mar 26 2019, 08:03