You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
PS C:\<my_user_directory>\yara> yr scan -r "C:\<path>\rule.yar" .\samples\
thread '<unnamed>' panicked at C:\Users\runneradmin/.cargo\registry\src\index.crates.io-6f17d22bba15001f\globwalk-0.9.1\src\lib.rs:381:78:
called `Result::unwrap()` on an `Err` value: StripPrefixError(())
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Also affects Linux:
-> % ./yr scan -r rule.yar ./samples
thread '<unnamed>' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/globwalk-0.9.1/src/lib.rs:381:78:
called `Result::unwrap()` on an `Err` value: StripPrefixError(())
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Testing:
.\samples - does not work
.\samples\ - does not work
samples\ - works
samples - works
..\yara\samples\ - works
All 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:
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. ;)
FixesVirusTotal#280.
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: