From 7ca5514b83420f0f09df363ee096bebb307f5faf Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Mon, 17 Dec 2018 22:08:24 +0000 Subject: [PATCH] Remove long-broken convenience code from ConfigurableInterface. In the dim and distant past, I seemingly thought it a good idea to copy all the values out of an object's config and into local private attributes (I guess to avoid config lookups?). It turns out, it was always broken because it looking at the root of the config tree, rather than under the object's specific config settings. This first turned up as an issue where self._meta_layer was being overwritten by None in the vmware layer. Removing this resolved the issue. --- volatility/framework/automagic/stacker.py | 2 ++ volatility/framework/interfaces/configuration.py | 7 ------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/volatility/framework/automagic/stacker.py b/volatility/framework/automagic/stacker.py index 3925dde02..0666229c0 100644 --- a/volatility/framework/automagic/stacker.py +++ b/volatility/framework/automagic/stacker.py @@ -114,6 +114,8 @@ class LayerStacker(interfaces.automagic.AutomagicInterface): new_layer = stacker.stack(new_context, current_layer_name, progress_callback) if new_layer: new_context.memory.add_layer(new_layer) + vollog.log(constants.LOGLEVEL_VVVV, + "Stacked {} using {}".format(new_layer.name, stacker_cls.__name__)) break except Exception as excp: # Stacking exceptions are likely only of interest to developers, so the lowest level of logging diff --git a/volatility/framework/interfaces/configuration.py b/volatility/framework/interfaces/configuration.py index 25664bdf5..87a3ee9dd 100644 --- a/volatility/framework/interfaces/configuration.py +++ b/volatility/framework/interfaces/configuration.py @@ -465,13 +465,6 @@ class ConfigurableInterface(validity.ValidityRoutines, metaclass = ABCMeta): self._context = self._check_type(context, ContextInterface) self._config_path = self._check_type(config_path, str) - # Store these programmatically, so we don't keep repreating the requirements - # This also allows constructed objects to populate a configuration without too much trouble - for requirement in self.get_requirements(): - # Create the (private) properties using the config as backend storage - # TODO: Based on the requirement, do proper type checking - setattr(self, "_" + requirement.name, self._context.config.get(requirement.name, requirement.default)) - @property def context(self) -> 'interfaces.context.ContextInterface': return self._context