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

Improve LayerFilesystem iterdir and scandir #973

Closed
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
implement review comment
  • Loading branch information
JSCU-CNI committed Dec 11, 2024
commit fef60da6759c4c5f0e2a61b0ddd981a9abcda947
6 changes: 4 additions & 2 deletions dissect/target/plugins/filesystem/walkfs.py
Original file line number Diff line number Diff line change
@@ -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