Skip to content

Commit 9d80e25

Browse files
authored
Merge pull request #5 from cloudlinux/deleted-flag
Deleted flag should not be ignored
2 parents b82339d + 4114278 commit 9d80e25

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

uchecker.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def get_vmas(pid, inode):
145145

146146

147147
def is_valid_file_mmap(mmap):
148-
return mmap.pathname and mmap.flag not in ['(deleted)'] \
148+
return mmap.pathname \
149149
and mmap.pathname not in IGNORED_PATHNAME \
150150
and not mmap.pathname.startswith('anon_inode:') \
151151
and not mmap.pathname.startswith('/dev/')
@@ -155,7 +155,8 @@ def get_process_files(pid):
155155
result = set()
156156
for mmap in iter_maps(pid):
157157
if is_valid_file_mmap(mmap):
158-
result.add((mmap.pathname, mmap.inode))
158+
pathname, _, _ = mmap.pathname.partition(';')
159+
result.add((pathname, mmap.inode))
159160
return result
160161

161162

0 commit comments

Comments
 (0)