-
Notifications
You must be signed in to change notification settings - Fork 381
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
VCC: Fix +glob with relative path #4250
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for looking after this issue, but ...
as a general note, I have the impression that more and more PRs now contain super terse commit messages and no additional explanations in the notes either. I can hardly avoid taking this a message towards reviewers in the direction of "my time is more important than yours", and I would really appreciate if we made it a custom (again) to explain which problem you are solving and why you have chosen the particular implementation.
On the actual implementation: Can we not use VFIL_searchpath()
with an appropriate vfil_path_func_f()
?
Apologies for the lack of additional explanation in the commit log, but I though the code was simple enough and self explanatory here. I will try to add some content to it.
That wouldn't work, |
This function returns an array of paths built by concatenating the vfil_path elements with the string pointed by the "name" argument. Unlike VFIL_searchpath, VFIL_concat does not check that the files exist and does not attempt anything on them. Both the array and array elements returned must be freed by the caller.
We preivously called glob() on the included file name regardless of whether it was an absolute or relative path. As a result, relative paths were not appended to vcl_path elements before checking if the glob expression matched anything. It is not possible to (re)use VFIL_searchpath here, since VFIL_searchpath uses access() to check that the file exists, and that would fail in this case. Fixes: varnishcache#4249
One question that came to my mind regarding how we handle |
IMHO, commit messages and ticket notes should not explain the code. They should explain the problem, the solution idea and the reasons for the implementation.
Right. But would it not make more sense to add an option to |
This is a very good point. My first reaction is to include all matches within all path elements, but I am not entirely sure. |
That could be an option. I will give it a try and see how that would look.
That is also my opinion, but I need to think more about it. |
Fixes: #4249