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

Bugfix: accessors should provide their underlying file #2893

Merged
merged 2 commits into from
Aug 15, 2023

Conversation

scudette
Copy link
Contributor

We sometimes need to know the path to the underlying file on the filesystem if possible. This is used in cases when we need to delegate to an external library which expects a filesystem path.

Previously the code assumed that when the accessor was "file" or "auto" then the underlying path can be obtained from the filename. This works well in local trigage mode but fails when remapping - in that case the actual accessor called "file" may be a completely different remapped accessor and it is not appropriate to use its filename as an underlying API file.

This would cause issues with e.g. the yara plugin, sqlite and leveldb plugins.

This PR introduces a new interface which allows the accessor to provide the raw API accessible path if possible. For plugins that need to work with real files, this path also creates a local copy if needed.

Fixes: #2870

We sometimes need to know the path to the underlying file on the
filesystem if possible. This is used in cases when we need to delegate
to an external library which expects a filesystem path.

Previously the code assumed that when the accessor was "file" or
"auto" then the underlying path can be obtained from the
filename. This works well in local trigage mode but fails when
remapping - in that case the actual accessor called "file" may be a
completely different remapped accessor and it is not appropriate to
use its filename as an underlying API file.

This would cause issues with e.g. the yara plugin, sqlite and leveldb
plugins.

This PR introduces a new interface which allows the accessor to
provide the raw API accessible path if possible. For plugins that need
to work with real files, this path also creates a local copy if
needed.

Fixes: #2870
@scudette scudette merged commit bbe8de6 into master Aug 15, 2023
@scudette scudette deleted the underlying_file branch August 15, 2023 23:44
scudette added a commit to scudette/velociraptor that referenced this pull request Aug 28, 2023
We sometimes need to know the path to the underlying file on the
filesystem if possible. This is used in cases when we need to delegate
to an external library which expects a filesystem path.

Previously the code assumed that when the accessor was "file" or "auto"
then the underlying path can be obtained from the filename. This works
well in local trigage mode but fails when remapping - in that case the
actual accessor called "file" may be a completely different remapped
accessor and it is not appropriate to use its filename as an underlying
API file.

This would cause issues with e.g. the yara plugin, sqlite and leveldb
plugins.

This PR introduces a new interface which allows the accessor to provide
the raw API accessible path if possible. For plugins that need to work
with real files, this path also creates a local copy if needed.

Fixes: Velocidex#2870
scudette added a commit that referenced this pull request Aug 28, 2023
We sometimes need to know the path to the underlying file on the
filesystem if possible. This is used in cases when we need to delegate
to an external library which expects a filesystem path.

Previously the code assumed that when the accessor was "file" or "auto"
then the underlying path can be obtained from the filename. This works
well in local trigage mode but fails when remapping - in that case the
actual accessor called "file" may be a completely different remapped
accessor and it is not appropriate to use its filename as an underlying
API file.

This would cause issues with e.g. the yara plugin, sqlite and leveldb
plugins.

This PR introduces a new interface which allows the accessor to provide
the raw API accessible path if possible. For plugins that need to work
with real files, this path also creates a local copy if needed.

Fixes: #2870
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deaddisk mode searches for files on host system
1 participant