Keepass deletes hardlink of Keepass.config.xml (scoop installation)
A lightweight and easy-to-use password manager
Brought to you by:
dreichl
If Keepass.config.xml is a hardlink, the link gets removed on save.
Scenario: scoop.sh based installation
Tried workaround: <usetransactedfilewrites>false</usetransactedfilewrites>
Suspected problem: public FileTransactionEx(IOConnectionInfo iocBaseFile, bool bTransacted) does not respect hardlinks (only symbolic links)
This is then the expected behavior of hardlinks and symbolic links. It is not a bug.
KeePass saves the old config file by deleting it and creating a new config file at the same location.
When the config file is a hardlink, KeePass deletes the the hardlink to the config file. However, the old file contents are not deleted. Any remaining hardlinks reference the old file contents until the last hardlink is deleted. When KeePass creates the new config file the deleted a hardlink is not recreated.
When the config file is referenced by a symbolic link, KeePass deletes the config file but not the symbolic link to the now-missing file. When KeePass creates the new config file, the symbolic link continues to reference the new file at the original location.
When the config file is a symbolic link, KeePass deletes the symbolic link but not the actual config file which is located somewhere else. The new config file is created at the location of the deleted symbolic link and has no relation to the old config file located somewhere else.
Last edit: wellread1 2019-12-02
thanks for clarification. If this is the design to delete the file before it works as it should. if Keepass would just overwrite the existing file it would have worked.
working directory of Keepass: c:\apps\apps\keepass\current
storage of persistent files: c:\apps\persist\keepass
Link of config file: c:\apps\apps\keepass\current\KeePass.config.xml [-> c:\apps\persist\keepass\KeePass.config.xml]
no bug then. i guess i'll fork for for my purposes then.
KeePass should not use transactions for reparse points - since 2016.
https://sourceforge.net/p/keepass/feature-requests/2192/
cheers, Paul
Since KeePass 2.44, there's an option 'Use file transactions for writing configuration settings'. When turning it off, KeePass directly overwrites the configuration file (which is less safe, but compatible with hard links).
Moving to closed feature requests.
Thanks and best regards,
Dominik
Ticket moved from /p/keepass/bugs/1908/