Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a regression bug inside windows network_manager #936

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions dissect/target/plugins/os/windows/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@
continue

# Extract the network device configuration for given interface id
config = self._extract_network_device_config(net_cfg_instance_id)
if not (config := self._extract_network_device_config(net_cfg_instance_id)):
continue

Check warning on line 261 in dissect/target/plugins/os/windows/network.py

View check run for this annotation

Codecov / codecov/patch

dissect/target/plugins/os/windows/network.py#L261

Added line #L261 was not covered by tests

# Extract a network device name for given interface id
try:
Expand Down Expand Up @@ -313,9 +314,7 @@
_target=self.target,
)

def _extract_network_device_config(
self, interface_id: str
) -> list[dict[str, str | list], dict[str, str | list]] | None:
def _extract_network_device_config(self, interface_id: str) -> list[dict[str, set | bool | None]]:
"""Extract network device configuration from the given interface_id for all ControlSets on the system."""

dhcp_config = {
Expand Down Expand Up @@ -344,10 +343,10 @@
)
)
except RegistryKeyNotFoundError:
return None
return []

Check warning on line 346 in dissect/target/plugins/os/windows/network.py

View check run for this annotation

Codecov / codecov/patch

dissect/target/plugins/os/windows/network.py#L346

Added line #L346 was not covered by tests

if not len(keys):
return None
return []

Check warning on line 349 in dissect/target/plugins/os/windows/network.py

View check run for this annotation

Codecov / codecov/patch

dissect/target/plugins/os/windows/network.py#L349

Added line #L349 was not covered by tests

for key in keys:
# Extract DHCP configuration from the registry
Expand Down
Loading