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

Filesystems incorrectly escape backslashes in files and folders #201

Closed
JSCU-CNI opened this issue Mar 9, 2023 · 5 comments
Closed

Filesystems incorrectly escape backslashes in files and folders #201

JSCU-CNI opened this issue Mar 9, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@JSCU-CNI
Copy link
Contributor

JSCU-CNI commented Mar 9, 2023

Some filesystems seem to incorrectly escape backslashes in files and folders. This is likely unnecessary since 763fddc introduced the alt_separator behaviour.

Given the /example folder below, plugins like walkfs and tools like target-shell will break when encountering a filesystem entry with a backslash.

$ tree /example
/example
├── backslash\folder
│   └── file.txt
└── back\slash.txt
# example on ext4 filesystem
$ target-query -f walkfs example.vmdk
...
dissect.target.exceptions.FileNotFoundError: /example/backslash\folder

At least four filesystem implementations use this form of escaping:

@Schamper
Copy link
Member

Schamper commented Mar 9, 2023

Good catch. Will you create PRs yourself in the relevant places? Otherwise I'll make a start. I believe it's mostly an issue for the Unix filesystems, but will include the Windows ones too.

@Schamper Schamper added the bug Something isn't working label Mar 9, 2023
@JSCU-CNI
Copy link
Contributor Author

JSCU-CNI commented Mar 9, 2023

Could you make a start?

@Schamper
Copy link
Member

Schamper commented Mar 9, 2023

I believe these are it. Both dissect.ffs and dissect.vmfs already did this correctly, likely because I realized by then it wasn't actually correct, but never got around to fixing it in the other places :)

The changes in dissect.ntfs and dissect.fat are technically not required, but mostly made to be closer to the happy path, which may save a CPU cycle or two.

@Schamper Schamper self-assigned this Mar 9, 2023
@Schamper
Copy link
Member

Everything is now merged so this should be fixed. Let me know if this can be closed!

@JSCU-CNI
Copy link
Contributor Author

Thanks for the quick fix. Can confirm this issue is resolved with the latest dev releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants