Menu

#1209 linux merge duplicating all entries

v1.0_(example)
closed
1
2014-08-18
2014-08-17
Chuck Lane
No

Linux 0.94BETA-3 on Fedora 20 x64. When merging two absolutely identical databases, the vast majority (90%+) of entries are duplicated with blah-merged...
entries.

So: some tests: cp old.dat new.dat ...do pwsafe "compare", says all entries are identical. do pwsafe "merge", and most (if not all) entries get duplicated with a XYZ-merged entry added. Tried with brand new, mostly empty databases: same result.
The merge report just has a blank for "fields that differ".

pwsafe 3.34.1 on win7 x64, with same databases, merging: "0 entries added", so the win7 version is okay.

Okay, went through the code, and I think I found the problem: when doing the comparison, when an entry is using the "default" password policy, the merge doesn't pick up the correct default for the "other" database.

The fix is simple (patch attached, also adds some info in merge report).

In short, for entries which are not using a named password policy, and not using an "autogenerated" non-default policy, merge tries to load the default policy for comparing the original to the other database. But the "other" database policy is taken from a "copy of preferences" that is not initialized. So yeah, they differ.

The patch is to have both original and other databases, with default policy, to use the same default. This might be wrong where the "other" database has a different "default" policy, but I couldn't see how to find that, so an expert may want to tweak this patch a bit. At root, this problem may be coming from how the "other" database is opened, which would explain the linux/win difference in behavior.

There have been a number of bug reports and feature requests that are based on similar symptoms.

1 Attachments

Discussion

  • Saurav Ghosh

    Saurav Ghosh - 2014-08-17

    This change impacts all platforms. Does it not change the merge results on Windows, with entries that have or don’t have a custom password policy?

     
  • DrK

    DrK - 2014-08-17

    I agree with your reporting addition but not the change to remove the "true" from the following statement in CoreOtherDB.cpp:

    oth_pwp = PWSprefs::GetInstance()->GetDefaultPolicy(true);
    

    The Windows GUI code does indeed initialise the "copy of preferences". It is done in the Wizard code [CWZFinish::ExecuteAction() in WZFinish.cpp] and not in the common core code [CoreOtherDB.cpp].

    Since this is a Linux only issue, I suspect that the wxWidgets GUI code does not do this too.

     
  • Chuck Lane

    Chuck Lane - 2014-08-17

    I didn't test the Win impact, not having a suitable set of build tools at my disposal, but thought I should bring the problem (and where it is coming from) to the group's attention, in the hopes of moving closer to a "full" fix.

     
  • Rony Shapiro

    Rony Shapiro - 2014-08-17

    Tentatively fixed per DK's advice in commit 445ef51 in master.

    Chuck - can you build and confirm the fix?

     
    • Chuck Lane

      Chuck Lane - 2014-08-18

      Just built on linux (Fedora 20). The merge works fine!

       
  • Rony Shapiro

    Rony Shapiro - 2014-08-18
    • status: open --> closed
    • assigned_to: Rony Shapiro
     

Log in to post a comment.