-
Notifications
You must be signed in to change notification settings - Fork 164
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
password.fetch command applies path normalization to non-path parameters #1021
Comments
The bug is indeed due to how expand_path works.
I believe we should expand variables on all parameters, but not normalise paths like this.
Cc: @Witcher01
|
Good catch, and sorry for the bug, I didn't think about this scenario! I agree: variables should be expanded, but paths shouldn't be normalised like this. I'm unsure whether the call to vdirsyncer/vdirsyncer/utils.py Lines 20 to 24 in 90b6ce1
Alternatively, one could detect whether an argument is a path at all and apply |
I believe, detecting paths is inherently hard. Sure, you can reliably detect URLs with a protocol indicator and rule them out. But you're still left with e.g. |
I think expanding variables and a leading ~ makes sense, but I'm not sure what we gain by normalising filepaths. We do both things in one function right now, but normalising paths likely doesn't belong in the expand_path function.
It would be good to double check all usages of the function tho.
|
I believe I found another case when this "feature/bug" is impacting me (version 0.19.2) - using sed while getting value from a file :(
The funny thing is that while using
|
Remove normalizing paths in "expand_path" and expand environment variables. Paths don't need to be normalized, but doing this on non-path parameters (i.e. URLs) might cause bugs. Reported-by: s-hamann Closes: pimutils#1021 Signed-off-by: Thomas Böhler <[email protected]>
Problem Description
I configured vdirsyncer to get the password from the user keyring:
This used to work fine before version 0.19.0. Since 0.19.0, however, the configured parameters get changed and, thus,
secret-tool
does not find the password any more:The key information is here, I believe:
vdirsyncer calls
secret-tool lookup URL https:/example.com
instead ofsecret-tool lookup URL https://example.com/
. The difference is subtle: vdirsyncer stripped two/
.I guess that the cause is the commit c254b4a, which applies path normalization to every parameter of the fetch command. In my case, this causes to URL to be unsuitably normalized.
My Environment
The text was updated successfully, but these errors were encountered: