Skip to content

Commit

Permalink
Add a comment to explain problem with current logic that handles . an…
Browse files Browse the repository at this point in the history
…d ..
  • Loading branch information
dmknght committed Oct 27, 2024
1 parent 913a138 commit 9fb9fa7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/engine/scan_file.nim
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ proc fscanner_walk_dir_rec*(scan_ctx: var FileScanCtx, scan_dir: string, virname
current_node_name = $cast[cstring](addr(ptr_dir.d_name))

# Linux's dir always have "." as current dir and ".." as parent DIR. Skip checking these 2 nodes
# TODO better handing with "..": in folders that has only 1 node (beside . and ..), it might be hidden by malware.
# Using ".." might be able to detect them (if d_reclen's logic can be fixed for the last node)
if current_node_name == "." or current_node_name == "..":
continue

Expand Down

0 comments on commit 9fb9fa7

Please sign in to comment.