Repository navigation
Conversation
match_expr() only sets res for cwd, host, tty, group and similar terms when that field is in the log. if it is missing, res keeps the value from the previus term, so "user alice group wheel" lists alice's sessions that have no run group logged. reset res for each term so that a missing field doesn't match.
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.
sudoreplay -lcan list sessions that don't match the search when a field is missing from the log. a run group is only logged when it differs from the run user's primary group, so plenty of logs don't have it. for a session by alice with no run group:reswas only set when the field was there, so a missing field reused the result of the previus term. the fix resets it for each term.tested with a small hand-written log.json before and after. plain searches like
user aliceanduser alice host hgive the same results as before. there's no sudoreplay regress dir so i didn't add a test.