mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-11 20:27:38 +02:00
apply unsafe fixes (ruff check --unsafe-fixes --fix)
This commit is contained in:
@@ -93,10 +93,9 @@ class Check_sysctl(plugins.PluginInterface):
|
||||
val = self._parse_global_variable_sysctls(kernel, name)
|
||||
elif ctltype == "CTLTYPE_NODE":
|
||||
if sysctl.oid_handler == 0:
|
||||
for info in self._process_sysctl_list(
|
||||
yield from self._process_sysctl_list(
|
||||
kernel, sysctl.oid_arg1, recursive=1
|
||||
):
|
||||
yield info
|
||||
)
|
||||
|
||||
val = "Node"
|
||||
|
||||
|
||||
@@ -119,8 +119,7 @@ class Kevents(interfaces.plugins.PluginInterface):
|
||||
return None
|
||||
|
||||
for klist in klist_array:
|
||||
for kn in mac.MacUtilities.walk_slist(klist, "kn_link"):
|
||||
yield kn
|
||||
yield from mac.MacUtilities.walk_slist(klist, "kn_link")
|
||||
|
||||
@classmethod
|
||||
def _get_task_kevents(cls, kernel, task):
|
||||
|
||||
@@ -49,8 +49,7 @@ class Mount(plugins.PluginInterface):
|
||||
|
||||
list_head = kernel.object_from_symbol(symbol_name="mountlist")
|
||||
|
||||
for mount in mac.MacUtilities.walk_tailq(list_head, "mnt_list"):
|
||||
yield mount
|
||||
yield from mac.MacUtilities.walk_tailq(list_head, "mnt_list")
|
||||
|
||||
def _generator(self):
|
||||
for mount in self.list_mounts(self.context, self.config["kernel"]):
|
||||
|
||||
@@ -152,7 +152,9 @@ class Maps(interfaces.plugins.PluginInterface):
|
||||
address_list = self.config.get("address", None)
|
||||
if not address_list:
|
||||
# do not filter as no address_list was supplied
|
||||
vma_filter_func = lambda _: True
|
||||
def vma_filter_func(_):
|
||||
return True
|
||||
|
||||
else:
|
||||
# filter for any vm_start that matches the supplied address config
|
||||
def vma_filter_function(task: interfaces.objects.ObjectInterface) -> bool:
|
||||
|
||||
@@ -83,7 +83,9 @@ class PsList(interfaces.plugins.PluginInterface):
|
||||
|
||||
@classmethod
|
||||
def create_pid_filter(cls, pid_list: List[int] = None) -> Callable[[int], bool]:
|
||||
filter_func = lambda _: False
|
||||
def filter_func(_):
|
||||
return False
|
||||
|
||||
# FIXME: mypy #4973 or #2608
|
||||
pid_list = pid_list or []
|
||||
filter_list = [x for x in pid_list if x is not None]
|
||||
|
||||
Reference in New Issue
Block a user