gui: avoid unclean exit due to permissions issues when setting start on system startup #25000

pull mruddy wants to merge 1 commits into bitcoin:master from mruddy:issue_24953 changing 1 files +14 −3
  1. mruddy commented at 12:05 PM on April 27, 2022: contributor

    Closes #24953

    This remedies two cases where the GUI can cause the process to exit in an unclean manner. These two cases are cases where the directory path causing the exception is likely/usually not under the node's data and/or blocks directory and thus could be more likely to lack write permissions.

    Instead of abruptly exiting the process, this path instead makes log entries such as:

    2022-04-27T11:43:03Z failed to create autostart directory: filesystem error: cannot create directories: Permission denied [/tmp/crash/autostart]
    
    2022-04-27T11:44:05Z failed to remove autostart file: filesystem error: cannot remove: Permission denied [/tmp/crash/autostart/bitcoin.desktop]
    

    the command line used to test and create the above log entries (with this patch applied) was:

    mkdir -p /tmp/btc && mkdir -p /tmp/crash && chmod 0500 /tmp/crash && XDG_CONFIG_HOME=/tmp/crash ./src/qt/bitcoin-qt -debug -datadir=/tmp/btc -connect=0
    

    The short/easy process to generate the exception is noted in the original issue.

    This PR does not address the other cases where fs::create_directories may create an unclean exit due to the reasoning that the other cases are generated by paths under the blocks and/or data directories and those directories need to be writable by the bitcoin process, or lots of things fail. This is a targeted PR to avoid a couple of unique recoverable situations.

  2. gui: avoid unclean exit due to permissions issues when setting start on system startup
    closes #24953
    0d9e61a8d9
  3. hebasto commented at 12:07 PM on April 27, 2022: member

    @mruddy Mind moving this PR into the dedicated https://github.com/bitcoin-core/gui?

  4. mruddy commented at 12:10 PM on April 27, 2022: contributor

    moving to another repo

  5. mruddy closed this on Apr 27, 2022

  6. mruddy deleted the branch on Apr 27, 2022
  7. DrahtBot locked this on Apr 27, 2023

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-05-02 09:14 UTC

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