Handle missing bootstrap progress parsing#5
Conversation
|
Updated tor_bootstrap_check.py to safely handle bootstrap responses missing a PROGRESS field by exiting with an error code after closing the controller instead of raising an exception. |
| progress_percent = re.match('.* PROGRESS=([0-9]+).*', bootstrap_status) | ||
| progress_percent = re.search(r"PROGRESS=([0-9]+)", bootstrap_status) | ||
|
|
||
| if not progress_percent: | ||
| controller.close() | ||
| sys.exit(255) |
There was a problem hiding this comment.
This is likely unnecessary - there are two places in C-Tor's source code that generate the output of a GETINFO status/bootstrap-phase command, one is https://gitlab.torproject.org/tpo/core/tor/-/blob/b5d08ddc09ec785d81e4043d9f9e2f032c9e49ab/src/feature/control/control_bootstrap.c#L165 and the other is https://gitlab.torproject.org/tpo/core/tor/-/blob/b5d08ddc09ec785d81e4043d9f9e2f032c9e49ab/src/feature/control/control_bootstrap.c#L324. Both of them include a PROGRESS= key. We could catch this, but it's probably not worth it.
|
Rejected, seems unnecessary given the job this tool performs and the way Tor works under the hood in this area. This PR can be closed. (The security report may still be useful for the review of other PRs though.) |
Summary
Testing
Codex Task