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

Regression in Include directive #796

Closed
trufae opened this issue Nov 21, 2017 · 5 comments
Closed

Regression in Include directive #796

trufae opened this issue Nov 21, 2017 · 5 comments

Comments

@trufae
Copy link
Contributor

trufae commented Nov 21, 2017

The yara include directive got broken in c0fa0bf but this commit doesnt builds , so it wasnt visible until d4283df (the next commit).

The problem is that now, yara doesnt handles relative path includes because the callback logic doesnt covers the stack level, so it expects all includes to be happening from the root directory which is incorrect.

Reverting this commit is not possible because there are so many conflicts and the test introduced in this change to show its working is pretty limited as long as it just does 1 include, but doesnt expects this include to contain other includes in relative paths.

There are 121 commits after that and 3.7 has been released, so the 3.7 release is broken, the last working one was 3.6.3. I think this change must be properly tested because the current behaviour is not the one i would expect and changes the way it was working before.

Hopefully this should be included in a 3.7.x bug-fix release or in 3.8

@plusvic
Copy link
Member

plusvic commented Nov 21, 2017

@trufae can you provide more details about how to reproduce the issue? I did some quick tests both in Mac OS X and Windows and relative path includes are working fine for me in version 3.7.0. There's even a test case for includes that consists in a relative include. So, maybe you hit some particular bug.

@trufae
Copy link
Contributor Author

trufae commented Nov 21, 2017

here's a test case. type make and compare behaviour between 3.6.3 and 3.7.0

yara-bug.tar.gz

@plusvic
Copy link
Member

plusvic commented Nov 21, 2017

Perfect, now I see the problem. It happens when the path in some include directive is not relative to the current path. I'll commit a fix as soon as possible.

@trufae
Copy link
Contributor Author

trufae commented Nov 21, 2017

awesome, thanks!

plusvic added a commit that referenced this issue Nov 21, 2017
plusvic added a commit that referenced this issue Nov 21, 2017
@radare
Copy link

radare commented Nov 22, 2017

If you use Fix # the issue is closed automatically

@plusvic plusvic closed this as completed Nov 22, 2017
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

No branches or pull requests

3 participants