Skip to content

Commit cffad87

Browse files
committed
Linux: sockstat. Fix volatilityfoundation#1271 which unnecessarily extends the interface of the list_sockets() class method
1 parent d7d84b4 commit cffad87

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

volatility3/framework/plugins/linux/sockstat.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class SockHandlers(interfaces.configuration.VersionableInterface):
2222

2323
_required_framework_version = (2, 0, 0)
2424

25-
_version = (2, 0, 0)
25+
_version = (3, 0, 0)
2626

2727
def __init__(self, vmlinux, task, *args, **kwargs):
2828
super().__init__(*args, **kwargs)
@@ -439,7 +439,7 @@ class Sockstat(plugins.PluginInterface):
439439

440440
_required_framework_version = (2, 0, 0)
441441

442-
_version = (2, 0, 0)
442+
_version = (3, 0, 0)
443443

444444
@classmethod
445445
def get_requirements(cls):
@@ -450,7 +450,7 @@ def get_requirements(cls):
450450
architectures=["Intel32", "Intel64"],
451451
),
452452
requirements.VersionRequirement(
453-
name="SockHandlers", component=SockHandlers, version=(2, 0, 0)
453+
name="SockHandlers", component=SockHandlers, version=(3, 0, 0)
454454
),
455455
requirements.PluginRequirement(
456456
name="lsof", plugin=lsof.Lsof, version=(2, 0, 0)
@@ -550,7 +550,7 @@ def list_sockets(
550550
except AttributeError:
551551
netns_id = NotAvailableValue()
552552

553-
yield task_comm, task, netns_id, fd_num, family, sock_type, protocol, sock_fields
553+
yield task, netns_id, fd_num, family, sock_type, protocol, sock_fields
554554

555555
def _format_fields(self, sock_stat, protocol):
556556
"""Prepare the socket fields to be rendered
@@ -597,7 +597,6 @@ def _generator(self, pids: List[int], netns_id_arg: int, symbol_table: str):
597597
)
598598

599599
for (
600-
task_comm,
601600
task,
602601
netns_id,
603602
fd_num,
@@ -618,6 +617,8 @@ def _generator(self, pids: List[int], netns_id_arg: int, symbol_table: str):
618617
else NotAvailableValue()
619618
)
620619

620+
task_comm = utility.array_to_string(task.comm)
621+
621622
fields = (
622623
netns_id,
623624
task_comm,

0 commit comments

Comments
 (0)