Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit debugfile on SIGHUP #3290

Open
wants to merge 1 commit into
base: 1.15.0-dev
Choose a base branch
from

Conversation

chromatic
Copy link
Member

When reading the code and intent around -shrinkdebugfile, this omission seemed odd.

@chromatic chromatic requested a review from a team July 2, 2023 23:43
@patricklodder patricklodder added this to 🚀 needs review in Review & merge board Jul 3, 2023
@edtubbs
Copy link
Contributor

edtubbs commented Jul 27, 2023

When reading the code and intent around -shrinkdebugfile, this omission seemed odd.

Thinking this could work if it doesn't necessarily have to happen at startup https://github.com/dogecoin/dogecoin/blob/1.14.7-dev/src/init.cpp#L470.

The file could shrink during any of these macros https://github.com/dogecoin/dogecoin/blob/1.14.7-dev/src/util.h#L77C29-L92 but it's only triggered by the SIGHUP signal. So, the user would need to send it via the terminal (e.g., using 'kill') while debugging, right?

@chromatic
Copy link
Member Author

We could do it that way, though I'm a little nervous about that. If I have access to your machine but not necessarily your configuration file, logs, wallet, etc then allowing me to send signals to your process to truncate your logs still gives me a nefarious mechanism to manipulate your Core experience.

"But Unky c, why would you give anyone shell access to a Core node even if you've locked down permissions?" That's a good question! That's also a risk. But it's not a strong reason to add a new risk, in my view.

@edtubbs
Copy link
Contributor

edtubbs commented Nov 24, 2023

To make it work a user would need to manually send the SIGHUP signal to the process as core doesn’t do this automatically.

@chromatic
Copy link
Member Author

Oh, I see what you mean. Yes, that's correct. Do you think this needs further documentation, or is there something else you're looking for in this PR?

@edtubbs
Copy link
Contributor

edtubbs commented Nov 24, 2023

Consider updating the -shrinkdebugfile help message here to reflect that shrinking occurs via the SIGHUP signal instead of client startup.

@patricklodder patricklodder changed the base branch from 1.14.7-dev to 1.15.0-dev February 28, 2024 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Review & merge board
🚀 needs review
Development

Successfully merging this pull request may close these issues.

None yet

2 participants