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

don't normalize paths in expand_path #1124

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Witcher01
Copy link

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: #1021

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]>
@WhyNotHugo
Copy link
Member

I'd have to recall why we normalised paths in the first place. The initial commit isn't very helpful: da8bba8 But I have a vague impression that it makes a difference in some situations (e.g.: when a user-provided path is compared with an internally-generated path maybe?).

But yeah, we shouldn't normalise paths on URLs, that's outright wrong.

@Shadow53
Copy link

Looks like the readthedocs job is preventing this PR from being merged? It's saying the .readthedocs.yaml file can't be found in the repository, which I don't see on main either.

Would like to see this merged as I am also running into this issue.

@WhyNotHugo
Copy link
Member

I reviewed this and #1021 a bit further.

If a password has $HOME, we'd still be messing it up. I think that we need to stop calling expand_path on some types of fields.

@WhyNotHugo
Copy link
Member

Exactly which scenario does this patch fix?

@Shadow53
Copy link

Exactly which scenario does this patch fix?

For me, it's the path normalization issue. I use 1Password, and the cli command to get a password is op read op://<vault>/<item>/password. The URI bit gets normalized to op:/<vault>/..., which causes the command to fail.

I can use a script to hide the real command so this doesn't happen, but I'd rather that not be a long-term solution.

@Shadow53
Copy link

If a password has $HOME, we'd still be messing it up. I think that we need to stop calling expand_path on some types of fields.

Since both command and shell are supported, one possible option is to let the shell expand environment variables and have command pass all arguments verbatim.

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

Successfully merging this pull request may close these issues.

password.fetch command applies path normalization to non-path parameters
3 participants