diff --git a/config/dpkg/changelog b/config/dpkg/changelog index 95f7baf2..cda04885 100644 --- a/config/dpkg/changelog +++ b/config/dpkg/changelog @@ -1,5 +1,5 @@ -dfvfs (20220419-1) unstable; urgency=low +dfvfs (20220430-1) unstable; urgency=low * Auto-generated - -- Log2Timeline maintainers Tue, 19 Apr 2022 11:17:49 +0200 + -- Log2Timeline maintainers Sat, 30 Apr 2022 06:49:30 +0200 diff --git a/dfvfs/__init__.py b/dfvfs/__init__.py index 14f1f743..7ca737c2 100644 --- a/dfvfs/__init__.py +++ b/dfvfs/__init__.py @@ -6,4 +6,4 @@ storage media types and file formats. """ -__version__ = '20220419' +__version__ = '20220430' diff --git a/dfvfs/helpers/volume_scanner.py b/dfvfs/helpers/volume_scanner.py index 2f825479..722b7c06 100644 --- a/dfvfs/helpers/volume_scanner.py +++ b/dfvfs/helpers/volume_scanner.py @@ -509,6 +509,12 @@ def _ScanFileSystem(self, scan_node, base_path_specs): if not scan_node or not scan_node.path_spec: raise errors.ScannerError('Invalid or missing file system scan node.') + if scan_node.type_indicator == definitions.TYPE_INDICATOR_APFS: + # Note that APFS can have a volume without a root directory. + file_entry = resolver.Resolver.OpenFileEntry(scan_node.path_spec) + if not file_entry: + return + base_path_specs.append(scan_node.path_spec) def _ScanSource(self, source_path): diff --git a/dfvfs/vfs/apfs_file_system.py b/dfvfs/vfs/apfs_file_system.py index 3aaf92ae..8a96a40a 100644 --- a/dfvfs/vfs/apfs_file_system.py +++ b/dfvfs/vfs/apfs_file_system.py @@ -127,27 +127,29 @@ def GetFileEntryByPathSpec(self, path_spec): if (location == self.LOCATION_ROOT or identifier == self.ROOT_DIRECTORY_IDENTIFIER): + is_root = True + # Note that APFS can have a volume without a root directory. fsapfs_file_entry = self._fsapfs_volume.get_root_directory() - return apfs_file_entry.APFSFileEntry( - self._resolver_context, self, path_spec, - fsapfs_file_entry=fsapfs_file_entry, is_root=True) - try: - if location is not None: - fsapfs_file_entry = self._fsapfs_volume.get_file_entry_by_path(location) - elif identifier is not None: - fsapfs_file_entry = self._fsapfs_volume.get_file_entry_by_identifier( - identifier) - - except IOError as exception: - raise errors.BackEndError(exception) + else: + is_root = False + try: + if location is not None: + fsapfs_file_entry = self._fsapfs_volume.get_file_entry_by_path( + location) + elif identifier is not None: + fsapfs_file_entry = self._fsapfs_volume.get_file_entry_by_identifier( + identifier) + + except IOError as exception: + raise errors.BackEndError(exception) if fsapfs_file_entry is None: return None return apfs_file_entry.APFSFileEntry( self._resolver_context, self, path_spec, - fsapfs_file_entry=fsapfs_file_entry) + fsapfs_file_entry=fsapfs_file_entry, is_root=is_root) def GetAPFSFileEntryByPathSpec(self, path_spec): """Retrieves the APFS file entry for a path specification. @@ -182,7 +184,7 @@ def GetRootFileEntry(self): """Retrieves the root file entry. Returns: - APFSFileEntry: file entry. + APFSFileEntry: file entry or None if not available. """ path_spec = apfs_path_spec.APFSPathSpec( location=self.LOCATION_ROOT, identifier=self.ROOT_DIRECTORY_IDENTIFIER,