From 7d409826b6d7b6b0628987abe9d673147a064189 Mon Sep 17 00:00:00 2001 From: Miauwkeru Date: Wed, 18 Oct 2023 08:47:04 +0200 Subject: [PATCH] Add a try/except around the user_details.all_with_home (#103) (DIS-2385) --------- Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com> --- acquire/acquire.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/acquire/acquire.py b/acquire/acquire.py index 2604adf5..2afba85e 100644 --- a/acquire/acquire.py +++ b/acquire/acquire.py @@ -143,8 +143,12 @@ def misc_osx_user_homes(target: Target) -> Iterator[fsutil.TargetPath]: def from_user_home(target: Target, path: str) -> Iterator[str]: - for user_details in target.user_details.all_with_home(): - yield normalize_path(target, user_details.home_path.joinpath(path)) + try: + for user_details in target.user_details.all_with_home(): + yield normalize_path(target, user_details.home_path.joinpath(path)) + except Exception as e: + log.warning("Error occurred when requesting all user homes") + log.debug("", exc_info=e) misc_user_homes = MISC_MAPPING.get(target.os, misc_unix_user_homes) for user_dir in misc_user_homes(target):