Skip to content

Commit

Permalink
Merge pull request #5 from cloudlinux/deleted-flag
Browse files Browse the repository at this point in the history
Deleted flag should not be ignored
  • Loading branch information
histrio authored Sep 14, 2020
2 parents b82339d + 4114278 commit 9d80e25
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions uchecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def get_vmas(pid, inode):


def is_valid_file_mmap(mmap):
return mmap.pathname and mmap.flag not in ['(deleted)'] \
return mmap.pathname \
and mmap.pathname not in IGNORED_PATHNAME \
and not mmap.pathname.startswith('anon_inode:') \
and not mmap.pathname.startswith('/dev/')
Expand All @@ -155,7 +155,8 @@ def get_process_files(pid):
result = set()
for mmap in iter_maps(pid):
if is_valid_file_mmap(mmap):
result.add((mmap.pathname, mmap.inode))
pathname, _, _ = mmap.pathname.partition(';')
result.add((pathname, mmap.inode))
return result


Expand Down

0 comments on commit 9d80e25

Please sign in to comment.