Fix up linuxutils to use symbol_tables rather than hard coded values

This commit is contained in:
Mike Auty
2020-04-10 22:12:03 +01:00
parent 719cd0d476
commit 8935e4dd19
2 changed files with 9 additions and 4 deletions
+7 -1
View File
@@ -30,12 +30,18 @@ class Lsof(plugins.PluginInterface):
]
def _generator(self, tasks):
symbol_table = None
for task in tasks:
if symbol_table is None:
if constants.BANG not in task.vol.type_name:
raise ValueError("Task is not part of a symbol table")
symbol_table = task.vol.type_name.split(constants.BANG)[0]
name = utility.array_to_string(task.comm)
pid = int(task.pid)
for fd_num, _, full_path in linux.LinuxUtilities.files_descriptors_for_process(
self.config, self.context, task):
self.context, symbol_table, task):
yield (0, (pid, name, fd_num, full_path))
def run(self):