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 wrong log logic indicating a sysvol was not found #762

Merged
merged 1 commit into from
Jul 25, 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
8 changes: 4 additions & 4 deletions dissect/target/plugins/os/windows/_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@
self.target.log.debug("", exc_info=e)

sysvol_drive = self.target.fs.mounts.get("sysvol")
# Fallback mount the sysvol to C: if we didn't manage to mount it to any other drive letter
if sysvol_drive and operator.countOf(self.target.fs.mounts.values(), sysvol_drive) == 1:
if not sysvol_drive:
self.target.log.warning("No sysvol drive found")

Check warning on line 83 in dissect/target/plugins/os/windows/_os.py

View check run for this annotation

Codecov / codecov/patch

dissect/target/plugins/os/windows/_os.py#L83

Added line #L83 was not covered by tests
elif operator.countOf(self.target.fs.mounts.values(), sysvol_drive) == 1:
# Fallback mount the sysvol to C: if we didn't manage to mount it to any other drive letter
if "c:" not in self.target.fs.mounts:
self.target.log.debug("Unable to determine drive letter of sysvol, falling back to C:")
self.target.fs.mount("c:", sysvol_drive)
else:
self.target.log.warning("Unknown drive letter for sysvol")
else:
self.target.log.warning("No sysvol drive found")

@export(property=True)
def hostname(self) -> Optional[str]:
Expand Down
Loading