KeePassXC offers to rename the default database on non-English locales
By default, when creating a new password database, KeePassXC offers to save it using a localized file name by default (e.g., if Tails was started with the French language,
Mots de passe.kdbx):
oldFilePath = QDir::toNativeSeparators(config()->get(Config::LastDir).toString() + "/" + tr("Passwords").append(".kdbx"));
However, the default database name configured as
/etc/skel/.config/keepassxc/keepassxc.ini is always
Passwords.kdbx, whatever the selected language. The same goes for the
This discrepancy can lead to a warning message, which can be reproduced as follows:
- Start Tails with a non-English locale (at least, a non-English language; e.g., French).
- Start KeePassXC, create a new password database, and save it using the default name suggested by KeePassXC (e.g.,
Mots de passe.kdbx), under the persistent volume.
- Close KeePassXC and start it again.
Upon starting KeePassXC again, the
keepassxc script will then open a dialog window and offer to rename the newly created database to
Passwords.kdbx (“Do you want to rename your KeePassXC database?”, etc.). I'm afraid that this may be slightly confusing for a new user, who followed the default steps and is then told that the name they used for the database wasn't, in fact, the default one.
Unfortunately, I couldn't think of any simple and satisfying way to solve this:
One could patch the KeePassXC translation files so that
tr("Passwords")always translates to
"Passwords", so that KeePassXC always offers to save the new database to
Passwords.kdbx. However, this would require a binary patch, and this might also prevent other instances of
Passwordsin KeePassXC from being properly translated.
Alternatively, one could patch the default KeePassXC configuration file
/etc/skel/.config/keepassxc/keepassxc.iniand the launcher script
/usr/local/bin/keepassxcso that they always use the localized name for the default database. However, if a user doesn't always use the same language localization when starting Tails, the
keepassxcscript will offer to rename the database file after each switch from one language to another; and even if the user chooses to stop the script from prompting for this option, the default
keepassxc.iniwill not always be in sync with the actual name of the database, and KeePassXC will not always be able to automatically open the database, which might also be confusing for the user.
Maybe a third possibility would be for the launcher script to check if the
~amnesia/.config/keepassxc/keepassxc.iniis the default one (i.e., that it actually comes from the
/etc/skel, and that it wasn't overwritten by a previous KeePassXC session) and, if so, tries to find whether there is a
.kbdxfile in the
Persistentfolder whose name is one of the possible KeePassXC-localized versions of
Passwords.kdbx(maybe with a higher priority for the current language locale if there are several matches), and patch the
~amnesia/.config/keepassxc/keepassxc.inifile to have the
LastOpenedDatabasessetting point to this file instead. However, the behavior of KeePassXC would still depend on the session's language locale.
Along the same lines, the
LastOpenedDatabasessetting for KeePassXC can specify a comma-separated list of several database files. Each existing file in the list is then opened, and missing files are ignored silently (see
src/core/Bootstrap.cpp:118-123). Therefore, if the default configuration file
/etc/skel/.config/keepassxc/keepassxc.iniwas to specify all possible localized versions of
LastOpenedDatabasessetting, KeePassXC would automatically open any database file whose name corresponds to a localized name for the default database in KeePassXC. However, if the user has several matching database files in their
Persistentfolder (e.g., if they have both
Mots de passe.kdbx), KeePassXC would then open them all.
Maybe a simpler solution would be to update the translations of the KeePassXC documentation in the Tails wiki (such as here, for the French translation) and to advise users to save their password database as
Passwords.kdbx, regardless of the default name suggested by KeePassXC? Of course, this would only fix the issue for users following the Tails documentation, but that may be an acceptable middle ground.
In any case, whatever the retained solution, I'm OK to try and work on a patch and propose a merge request along the lines you would deem to be the best.
Also, apologies for this overly long report and for the absence of a proper solution to such a tiny issue!
Thanks a lot in advance!