Error if # is used in rpcpassword in conf#14494
Error if # is used in rpcpassword in conf#14494laanwj merged 2 commits intobitcoin:masterfrom meshcollider:201810_hash_in_rpcpassword_error
Conversation
src/util.cpp
Outdated
There was a problem hiding this comment.
concept ACK—
though please reword this message, the # is not so much illegal, it starts a legal comment; it's just that probably the user made a mistake, by assuming the # will actually be part of the password
src/util.cpp
Outdated
There was a problem hiding this comment.
Could # be mentioned as "reserved character"?
promag
left a comment
There was a problem hiding this comment.
utACK fa3569d, simple solution.
It's a bit awkward to have this limitation though. For instance :
# split here because of whitespace before of #
# v
rpcpassword=foo#bar # comment # more comments..
# allow quotes, however it should allow escaping quotes too
pcpassword="foo#bar\"bar"# comment
Maybe it should warn each comment in the middle of lines?
src/util.cpp
Outdated
There was a problem hiding this comment.
Alternative:
pos = str.find('#');
const bool has_comment = pos != std::string::npos;
if (has_comment) str = str.substr(0, pos);|
I think allowing quotes makes the situation even more ambiguous and confusing, I mentioned it on IRC. The whitespace split seems ok but I'm not sure it's worth it, better safe than sorry? |
|
Maybe it should also error with command line |
|
There is another approach that allows |
|
@hebasto unfortunately that is breaking change. |
|
The error message should probably recommend rpcauth over rpcpassword. I think just rejecting # in rpcpassword lines makes sense. |
|
utACK fa3569dbf16bc40c36f036e191a9de8a679d81f8. Erroring on If we ever decide we need to allow [section]
name = "value!@#$%^" # comment |
1fb3c16 Add `doc/bitcoin-conf.md` (Hennadii Stepanov) Pull request description: From the IRC: > 2018-10-16T05:35:03 \<wumpus\> if something can be solved by better documentation, please work on documentation! > 2018-10-16T05:35:12 \<wumpus\> don't change the code instead Refs: - #14370 - #14427 - #14494 Based on the BITCOIN.CONF(5) manual page written by Micah Anderson \<[email protected]\> for the Debian system. Tree-SHA512: 16393c9073c027fa1c46f8b59651e60b9a3159b3aeb9b3102040c292d2787f32b1ead5977957ac3ac0759a4bf626650a2325b68ad84320964ac089ffc2d3b4f4
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
|
Rebased |
|
utACK 0385109 |
0385109 Add test for rpcpassword hash error (MeshCollider) 13fe258 Error if rpcpassword in conf contains a hash character (MeshCollider) Pull request description: Fixes #13143 now #13482 was merged Tree-SHA512: e7d00c8df1657f6b8d0eee1e06b9ce2b1b0a2de487377699382c1b057836e1571dac313ca878b5877c862f0461ba789a50b239d2a9f34accd8a6321f126e3d2a
1fb3c16 Add `doc/bitcoin-conf.md` (Hennadii Stepanov) Pull request description: From the IRC: > 2018-10-16T05:35:03 \<wumpus\> if something can be solved by better documentation, please work on documentation! > 2018-10-16T05:35:12 \<wumpus\> don't change the code instead Refs: - bitcoin#14370 - bitcoin#14427 - bitcoin#14494 Based on the BITCOIN.CONF(5) manual page written by Micah Anderson \<[email protected]\> for the Debian system. Tree-SHA512: 16393c9073c027fa1c46f8b59651e60b9a3159b3aeb9b3102040c292d2787f32b1ead5977957ac3ac0759a4bf626650a2325b68ad84320964ac089ffc2d3b4f4
1fb3c16 Add `doc/bitcoin-conf.md` (Hennadii Stepanov) Pull request description: From the IRC: > 2018-10-16T05:35:03 \<wumpus\> if something can be solved by better documentation, please work on documentation! > 2018-10-16T05:35:12 \<wumpus\> don't change the code instead Refs: - bitcoin#14370 - bitcoin#14427 - bitcoin#14494 Based on the BITCOIN.CONF(5) manual page written by Micah Anderson \<[email protected]\> for the Debian system. Tree-SHA512: 16393c9073c027fa1c46f8b59651e60b9a3159b3aeb9b3102040c292d2787f32b1ead5977957ac3ac0759a4bf626650a2325b68ad84320964ac089ffc2d3b4f4
1fb3c16 Add `doc/bitcoin-conf.md` (Hennadii Stepanov) Pull request description: From the IRC: > 2018-10-16T05:35:03 \<wumpus\> if something can be solved by better documentation, please work on documentation! > 2018-10-16T05:35:12 \<wumpus\> don't change the code instead Refs: - bitcoin#14370 - bitcoin#14427 - bitcoin#14494 Based on the BITCOIN.CONF(5) manual page written by Micah Anderson \<[email protected]\> for the Debian system. Tree-SHA512: 16393c9073c027fa1c46f8b59651e60b9a3159b3aeb9b3102040c292d2787f32b1ead5977957ac3ac0759a4bf626650a2325b68ad84320964ac089ffc2d3b4f4
0385109 Add test for rpcpassword hash error (MeshCollider) 13fe258 Error if rpcpassword in conf contains a hash character (MeshCollider) Pull request description: Fixes bitcoin#13143 now bitcoin#13482 was merged Tree-SHA512: e7d00c8df1657f6b8d0eee1e06b9ce2b1b0a2de487377699382c1b057836e1571dac313ca878b5877c862f0461ba789a50b239d2a9f34accd8a6321f126e3d2a
0385109 Add test for rpcpassword hash error (MeshCollider) 13fe258 Error if rpcpassword in conf contains a hash character (MeshCollider) Pull request description: Fixes bitcoin#13143 now bitcoin#13482 was merged Tree-SHA512: e7d00c8df1657f6b8d0eee1e06b9ce2b1b0a2de487377699382c1b057836e1571dac313ca878b5877c862f0461ba789a50b239d2a9f34accd8a6321f126e3d2a
Fixes #13143 now #13482 was merged