fox-it / dissect.target

The Dissect module tying all other Dissect modules together. It provides a programming API and command line tools which allow easy access to various data sources inside disk images or file collections (a.k.a. targets).
GNU Affero General Public License v3.0
38 stars 42 forks source link

Incorrect call to `self.target.log` in network manager `Template` class #661

Closed JSCU-CNI closed 3 months ago

JSCU-CNI commented 3 months ago

Some log messages in the Template class incorrectly call self.target.log in a context where there is no self.target.

https://github.com/fox-it/dissect.target/blob/main/dissect/target/helpers/network_managers.py#L88

This breaks dissect when conditions of calling those log messages are met.

  File "/tmp/dissect.target/dissect/target/helpers/network_managers.py", line 88, in _parse_netplan_config
    self.target.log.error("Failed to parse %s. Cannot import ruamel.yaml", self.name)
    ^^^^^^^^^^^
AttributeError: 'Template' object has no attribute 'target'