Have you searched for an existing issue?
Brief Summary
The Option "Start only a single instance of KeePassXC" does not work. Even if I enabled it, I can start a second, third etc. session.
I think it's because on my computer there exists an environment variable "USER" with a stupid value (like "/../../ABC123/user/..") and this takes priority over the environment variable "USERNAME". As a result the ".lock"-File can not be created.
Unfortunately the "USER"-Variable is needed by an important other application, so i can not delete it.
My proposal ist to insert something like this to "gui\Application.cpp":
#if defined (Q_OS_WIN)
QString userName = qgetenv("USERNAME");
#else
QString userName = qgetenv("USER");
if (userName.isEmpty()) {
userName = qgetenv("USERNAME");
}
#endif
This way the behaviour only changes on Windows. Linux, MaxOS and others are not affected.
Steps to Reproduce
- Create an environment variable "USER" with value like "/../../ABC123/user/.." at user level
- Start KeePassXC
- Start KeePassXC again
- search for %temp%\keepassxc-%username%.lock"
Expected Versus Actual Behavior
If I enable the option "Start only a single instance of KeePassXC" only one instane of KeePassXC should run. All other starts should bring up this instance.
KeePassXC Debug Information
Operating System
Windows
Linux Desktop Environment
None
Linux Windowing System
None
Have you searched for an existing issue?
Brief Summary
The Option "Start only a single instance of KeePassXC" does not work. Even if I enabled it, I can start a second, third etc. session.
I think it's because on my computer there exists an environment variable "USER" with a stupid value (like "/../../ABC123/user/..") and this takes priority over the environment variable "USERNAME". As a result the ".lock"-File can not be created.
Unfortunately the "USER"-Variable is needed by an important other application, so i can not delete it.
My proposal ist to insert something like this to "gui\Application.cpp":
#if defined (Q_OS_WIN)
QString userName = qgetenv("USERNAME");
#else
QString userName = qgetenv("USER");
if (userName.isEmpty()) {
userName = qgetenv("USERNAME");
}
#endif
This way the behaviour only changes on Windows. Linux, MaxOS and others are not affected.
Steps to Reproduce
Expected Versus Actual Behavior
If I enable the option "Start only a single instance of KeePassXC" only one instane of KeePassXC should run. All other starts should bring up this instance.
KeePassXC Debug Information
Operating System
Windows
Linux Desktop Environment
None
Linux Windowing System
None