-
Notifications
You must be signed in to change notification settings - Fork 60
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
Panic with .\ directory prefix #280
Comments
This is a known issue in the globwalk crate. |
wxsBSD
added a commit
to wxsBSD/yara-x
that referenced
this issue
Jan 9, 2025
As identified in VirusTotal#280 there is a bug in globwalk when using relative paths. Fix it by trying to canonicalize the path, and if that fails falls back to using the relative path. This is fine because the reason canonicalization failed is because the relative path was to a place that doesn't exist, and that does not trigger the bug (it errors out before we get there). We intentionally want this behavior so we get the nicer error reporting with colors. ;) Fixes VirusTotal#280.
wxsBSD
added a commit
to wxsBSD/yara-x
that referenced
this issue
Jan 18, 2025
One of the things I often run is "yr scan -r rules.yara ." when I have a collection of samples and I want to scan all of them in the current directory. With the fix in VirusTotal#280 the path was being stripped to an empty string which would result in an error when trying to scan. Fix it by only performing the strip if the path is not equal to ".".
plusvic
pushed a commit
that referenced
this issue
Jan 18, 2025
One of the things I often run is "yr scan -r rules.yara ." when I have a collection of samples and I want to scan all of them in the current directory. With the fix in #280 the path was being stripped to an empty string which would result in an error when trying to scan. Fix it by only performing the strip if the path is not equal to ".".
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using YARA-X 0.12.0 a panic is generated if the path starts with
.\
. This is how PowerShell auto-completes folder names relative to the current directory. Example:Also affects Linux:
Testing:
.\samples
- does not work.\samples\
- does not worksamples\
- workssamples
- works..\yara\samples\
- worksAll the working examples are fine with the backslash substituted for a forward slash (on Windows), so the only difference is the
.\
.The text was updated successfully, but these errors were encountered: