Skip to content

Commit

Permalink
Update artifacts_trie.py
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz authored Jan 24, 2025
1 parent a6ecb92 commit 67e99c2
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions plaso/engine/artifacts_trie.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,26 +151,27 @@ def _SearchTrie(
# the tree to the path segment from to the tool output as it
# sanitizes path segments before writing data to disk.
sanitized_child_segment = path_helper.PathHelper.SanitizePathSegments(
[child_segment]).pop()
[child_segment]).pop()

# If the child is an exact match, continue traversal.
if segment in (child_segment, sanitized_child_segment):
# If the child is an exact match, continue traversal.
self._SearchTrie(child_node, self._CustomPathJoin(
path_separator,
current_path, child_segment), remaining_segments, path_separator,
custom_path = _CustomPathJoin(
path_separator, current_path, child_segment)
self._SearchTrie(
child_node, custom_path, remaining_segments, path_separator,
matching_artifacts)

# If the child is a glob, see if it matches.
elif glob.has_magic(child_segment):
if self._MatchesGlobPattern(
child_segment, segment, child_node.path_separator):
self._SearchTrie(child_node, self._CustomPathJoin(
path_separator,
current_path, segment), remaining_segments, path_separator,
custom_path = _CustomPathJoin(
path_separator, current_path, segment)
self._SearchTrie(
child_node, custom_path, remaining_segments, path_separator,
matching_artifacts)
self._SearchTrie(
node,
self._CustomPathJoin(
path_separator,
current_path, segment), remaining_segments, path_separator,
node, custom_path, remaining_segments, path_separator,
matching_artifacts)

def _ComparePathIfSanitized(
Expand Down

0 comments on commit 67e99c2

Please sign in to comment.