Stop warning that a healthy run may be useless - #321
Merged
Conversation
find_browser_profiles warned that the input directory held no recognized history file before it recursed, so aiming Hindsight at a User Data root always logged it, twice, even when profiles were then found and parsed. The warning only means something once the search has finished and found nothing, so move it below the recursion and merge it with the "No Profile paths found" warning that already sat there. is_profile() loses its warn parameter; find_browser_profiles() gains one, and the early profile count in hindsight.py passes warn=False so the message is logged once. Covered by tests/test_profile_discovery_warning.py.
The search returns the input path itself when it finds no profile, so the console read "Profiles found 1" on a run that found none, directly above the warning saying otherwise. Track the fallback on the session as used_input_path_as_profile and label the row instead of counting it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
find_browser_profiles warned that the input directory held no recognized history
file before it recursed, so pointing Hindsight at a User Data root always logged
"Analysis may not be very useful", twice, then parsed the profiles underneath it
anyway. The warning only means something once the search has finished and found
nothing, so it moves below the recursion and merges with the "No Profile paths
found" warning that was already there. The doubling was separate: hindsight.py
searches once for the early profile count and run() searches again, so the early
call now passes warn=False.
Second commit: when the search finds nothing it falls back to the input path, and
the console counted that as "Profiles found 1" right above the warning saying
otherwise. It now reads "0 (parsing the input path as a profile)".
The genuine no-profile case is as loud as before. Checked against
magnet.ctf_2018, 4 profiles, 13,899 items: no warnings, previously two. Full
suite 239 passed.