keepassxc does not expand environment variables in URL Field

Created on 21 Oct 2018  路  4Comments  路  Source: keepassxreboot/keepassxc

Expected Behavior

System environment variables should be supported to align with original KeePass2.
The name of the variable enclosed in '%' characters should be expanded.
For example %TEMP% is replaced by the user's temporary path.
ref: https://keepass.info/help/base/autourl.html

Current Behavior

unable to use environment variable in cmd://

Steps to Reproduce (for bugs)

  1. cmd://C:\Users\user\OneDrive\Applicationpietty.exe works
  2. cmd://%USERPROFILE%\OneDrive\Applicationpietty.exe does not work

Context

Switch from KeePass2 but behavior is not the same

Debug Info

KeePassXC - 2.3.4
Operating system: Windows 10
CPU architecture: x64

bug

Most helpful comment

Has the PR been filed or is this just a very long night?

All 4 comments

We just pass the command off to the system to execute. It might be a mistake, but in your example you forgot to include the OneDrive folder after the %USERPROFILE%.

Yes this is just an example, I copied by typing and made that mistake.

If I execute "%USERPROFILE%\OneDrive\Applicationpietty.exe" from "Run" and it works too.
I'll check keepassxc source and see if I can figure out why, thanks.

I did some debugging and docs reading, looks like this is a Qt issue. There is no function that expands env vars prior to program execution. I wrote a proof of concept that worked and will weaponize it tomorrow in a PR. Good report, thank you!

Has the PR been filed or is this just a very long night?

Was this page helpful?
0 / 5 - 0 ratings