Linux: Fix minor typos

This commit is contained in:
Mike Auty
2024-12-23 16:08:31 +00:00
parent 58c55724c0
commit e99fd8d419
2 changed files with 20 additions and 20 deletions
@@ -10,7 +10,7 @@ from volatility3.framework import renderers, interfaces
from volatility3.framework.configuration import requirements
from volatility3.framework.interfaces import plugins
from volatility3.framework.symbols import linux
from volatility3.framework.symbols.linux.utilities import linux_paths
from volatility3.framework.symbols.linux.utilities import paths as linux_paths
from volatility3.plugins.linux import pslist
+19 -19
View File
@@ -81,6 +81,25 @@ class LinuxKernelIntermedSymbols(intermed.IntermediateSymbolTable):
self.optional_set_type_class("maple_tree", extensions.maple_tree)
def deprecation_warning(method):
"""Warning to prevent people using old methods"""
_warn_skips = (os.path.dirname(__file__),)
@functools.wraps(method)
def deprecated_method(*args, **kwargs):
warnings.warn(
"Plugin is using "
f"{'LinuxUtilities.' + method.__name__}, please report a bug to the plugin author asking them to use {method.__qualname__}",
FutureWarning,
stacklevel=2,
skip_file_prefixes=_warn_skips,
)
return method(*args, **kwargs)
return deprecated_method
class LinuxUtilities(interfaces.configuration.VersionableInterface):
"""Class with multiple useful linux functions."""
@@ -89,25 +108,6 @@ class LinuxUtilities(interfaces.configuration.VersionableInterface):
framework.require_interface_version(*_required_framework_version)
@staticmethod
def deprecation_warning(method):
"""Warning to prevent people using old methods"""
_warn_skips = (os.path.dirname(__file__),)
@functools.wraps(method)
def deprecated_method(*args, **kwargs):
warnings.warn(
"Plugin is using "
f"{'LinuxUtilities.' + method.__name__}, please report a bug to the plugin author asking them to use {method.__qualname__}",
FutureWarning,
stacklevel=2,
skip_file_prefixes=_warn_skips,
)
return method(*args, **kwargs)
return deprecated_method
do_get_path = deprecation_warning(paths.Paths.do_get_path)
get_path_mnt = deprecation_warning(paths.Paths.get_path_mnt)
path_for_file = deprecation_warning(paths.Paths.path_for_file)