Skip to content

Commit

Permalink
implement review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
JSCU-CNI committed Dec 11, 2024
1 parent 14758e6 commit fef60da
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dissect/target/plugins/filesystem/walkfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ def check_compatible(self) -> None:
def walkfs(self, walkfs_path: str = "/") -> Iterator[FilesystemRecord]:
"""Walk a target's filesystem and return all filesystem entries."""

if not self.target.fs.path(walkfs_path).exists():
path = self.target.fs.path(walkfs_path)

if not path.exists():
self.target.log.error("No such file or directory: '%s'", walkfs_path)
return

if not self.target.fs.path(walkfs_path).is_dir():
if not path.is_dir():
self.target.log.error("Not a directory: '%s'", walkfs_path)
return

Expand Down

0 comments on commit fef60da

Please sign in to comment.