Subject: | Bug related to tracking V1 vs V2 versioning |
There is code near the top of both the gen_db() and save_db() functions that "falls back" to $self->{'version'} to find the version of the file to be created, if that fails to be found from the file extension or via $head->{'version'} coming from a $head parameter that optionally can be passed in. The problem is that $self->{'version'} does not exist; it is never set. In fact, I don't think it ever was meat to be set. In both cases, I believe that $self->{'version'} should be replaced with $self->{'header'}->{'version'} and that is actually the developer's intent and would fix this bug.
The result of this bug is that any V2 file that is not named *.kdbx will be saved as a V1 file. This was reported to me by a user of kpcli.