Refactor create_filter to create_pid_filter.

This commit is contained in:
Mike Auty
2019-04-18 01:10:07 +01:00
parent 603512122d
commit 754b3f0bc6
23 changed files with 29 additions and 29 deletions
+2 -2
View File
@@ -98,7 +98,7 @@ class Bash(plugins.PluginInterface, timeliner.TimeLinerInterface):
yield (0, (task.pid, task_name, hist.get_time_object(), hist.get_command()))
def run(self):
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
filter_func = pslist.PsList.create_pid_filter([self.config.get('pid', None)])
return renderers.TreeGrid([("PID", int), ("Process", str), ("CommandTime", datetime.datetime),
("Command", str)],
@@ -110,7 +110,7 @@ class Bash(plugins.PluginInterface, timeliner.TimeLinerInterface):
filter_func = filter_func)))
def generate_timeline(self):
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
filter_func = pslist.PsList.create_pid_filter([self.config.get('pid', None)])
for row in self._generator(
pslist.PsList.list_tasks(
+1 -1
View File
@@ -62,7 +62,7 @@ class Elfs(plugins.PluginInterface):
yield (0, (task.pid, name, format_hints.Hex(vma.vm_start), format_hints.Hex(vma.vm_end), path))
def run(self):
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
filter_func = pslist.PsList.create_pid_filter([self.config.get('pid', None)])
return renderers.TreeGrid([("PID", int), ("Process", str), ("Start", format_hints.Hex),
("End", format_hints.Hex), ("File Path", str)],
+1 -1
View File
@@ -56,7 +56,7 @@ class Lsof(plugins.PluginInterface):
def run(self):
linux.LinuxUtilities.aslr_mask_symbol_table(self.context, self.config['vmlinux'], self.config['primary'])
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
filter_func = pslist.PsList.create_pid_filter([self.config.get('pid', None)])
return renderers.TreeGrid([("PID", int), ("Process", str), ("FD", int), ("Path", str)],
self._generator(
@@ -79,7 +79,7 @@ class Malfind(interfaces_plugins.PluginInterface):
vma.get_protection(), format_hints.HexBytes(data), disasm))
def run(self):
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
filter_func = pslist.PsList.create_pid_filter([self.config.get('pid', None)])
return renderers.TreeGrid([("PID", int), ("Process", str), ("Start", format_hints.Hex),
("End", format_hints.Hex), ("Protection", str), ("Hexdump", format_hints.HexBytes),
+1 -1
View File
@@ -69,7 +69,7 @@ class Maps(plugins.PluginInterface):
format_hints.Hex(page_offset), major, minor, inode, path))
def run(self):
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
filter_func = pslist.PsList.create_pid_filter([self.config.get('pid', None)])
return renderers.TreeGrid([("PID", int), ("Process", str),
("Start", format_hints.Hex), ("End", format_hints.Hex), ("Flags", str),
+2 -2
View File
@@ -39,7 +39,7 @@ class PsList(interfaces_plugins.PluginInterface):
]
@classmethod
def create_filter(cls, pid_list: List[int] = None) -> Callable[[int], bool]:
def create_pid_filter(cls, pid_list: List[int] = None) -> Callable[[int], bool]:
# FIXME: mypy #4973 or #2608
pid_list = pid_list or []
filter_list = [x for x in pid_list if x is not None]
@@ -57,7 +57,7 @@ class PsList(interfaces_plugins.PluginInterface):
self.context,
self.config['primary'],
self.config['vmlinux'],
filter_func = self.create_filter([self.config.get('pid', None)])):
filter_func = self.create_pid_filter([self.config.get('pid', None)])):
pid = task.pid
ppid = 0
if task.parent: