Expected error not printed if rpcpassword contains hash character but is in a [section] #15075

issue harding opened this issue on January 1, 2019
  1. harding commented at 8:38 PM on January 1, 2019: contributor

    <!-- Describe the issue -->

    <!--- What behavior did you expect? -->

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    <!-- Any extra information that might be useful in the debugging process. -->

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

    I'm writing a quick release note for #14494 (Error if # is used in rpcpassword in conf) and it doesn't work the way I expect with the optional new configuration file style. For example, this configuration file aborts startup as expected:

    $ cat .bitcoin/bitcoin.conf ; bitcoind -testnet | tee /dev/null | head -n 5
    rpcpassword=foo#bar
    Error reading configuration file: parse error on line 1, using # in rpcpassword can be ambiguous and should be avoided
    

    However, this does not:

    harding@redspot:~$ cat .bitcoin/bitcoin.conf ; bitcoind -testnet | tee /dev/null | head -n 5
    [test]
    rpcpassword=foo#bar
    2019-01-01T20:24:25Z Bitcoin Core version v0.17.99.0-f5a70d1462 (release build)
    2019-01-01T20:24:25Z InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
    2019-01-01T20:24:25Z Assuming ancestors of block 0000000000000037a8cd3e06cd5edbfe9dd1dbcc5dacab279376ef7cfc2b4c75 have valid signatures.
    2019-01-01T20:24:25Z Setting nMinimumChainWork=00000000000000000000000000000000000000000000007dbe94253893cbd463
    2019-01-01T20:24:25Z Using the 'sse4(1way),sse41(4way)' SHA256 implementation
    

    The same problem with rpcpassword applies to the [main] section. I can confirm that options specified in sections are otherwise working correctly here, and that rpcpassword also otherwise works as expected---I only fail to get the expected error when putting it in a section.

    I'm running commit f5a70d1462592a23bbad4aa150e6b2beaeec7c42 (master from 2019-01-01) on Debian Stable on x86_64.

    CC: @MeshCollider (author of #14494)

  2. fanquake added the label Utils/log/libs on Jan 1, 2019
  3. laanwj closed this on Jan 9, 2019

  4. laanwj referenced this in commit ff7f7364d6 on Jan 9, 2019
  5. PastaPastaPasta referenced this in commit 39db8fe25b on Sep 11, 2021
  6. ogabrielides referenced this in commit ed9f7cb0ee on Sep 13, 2021
  7. MarcoFalke locked this on Dec 16, 2021
  8. gades referenced this in commit e21fe86b0d on May 24, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me