Skip to content

Commit

Permalink
Fix unix activity plugin (#469)
Browse files Browse the repository at this point in the history
When a target system contains (broken) symlinks in /var/log,
the activity plugin could break.
  • Loading branch information
JSCU-CNI authored Dec 14, 2023
1 parent a6546d9 commit b534f3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions dissect/target/plugins/os/unix/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def activity(self) -> Optional[datetime]:

last_seen = 0
for f in var_log.iterdir():
if not f.exists():
continue
if f.stat().st_mtime > last_seen:
last_seen = f.stat().st_mtime

Expand Down
3 changes: 2 additions & 1 deletion dissect/target/tools/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ def main():
print("-" * 70)
print_target_info(target)
except Exception as e:
target.log.error("Exception in retrieving information for target: `%s`", target, exc_info=e)
target.log.error("Exception in retrieving information for target: `%s`. Use `-vv` for details.", target)
target.log.debug("", exc_info=e)


def get_target_info(target: Target) -> dict[str, Union[str, list[str]]]:
Expand Down

0 comments on commit b534f3a

Please sign in to comment.