Menu

#2523 Keepass deletes hardlink of Keepass.config.xml (scoop installation)

KeePass_2.x
closed
nobody
None
5
2020-01-30
2019-12-01
diseq
No

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)

2 Attachments

Discussion

  • diseq

    diseq - 2019-12-01
    1. before shows keepass folder before save.
    2. after shows folder after config write and hardlink replace by a normal file
     
  • wellread1

    wellread1 - 2019-12-01

    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
  • diseq

    diseq - 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.

     
  • Paul

    Paul - 2019-12-02

    KeePass should not use transactions for reparse points - since 2016.
    https://sourceforge.net/p/keepass/feature-requests/2192/

    cheers, Paul

     
  • Dominik Reichl

    Dominik Reichl - 2020-01-30
    • status: open --> closed
     
  • Dominik Reichl

    Dominik Reichl - 2020-01-30

    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

     
  • Dominik Reichl

    Dominik Reichl - 2020-01-30

    Ticket moved from /p/keepass/bugs/1908/

     

Log in to post a comment.

MongoDB Logo MongoDB