keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
20.82k stars 1.44k forks source link

keepassxc-cli can not create kdbx4.x databases #7277

Open damnms opened 2 years ago

damnms commented 2 years ago

Summary

when i create a new database with: printf '%s\n' secret{,} | keepassxc-cli db-create -p -q deleteMe it is in the old kdbx3.x format, file tells me even this is a 2.x kdbx format:

file deleteMe 
deleteMe: Keepass password database 2.x KDBX

i must use the cli only (on a server). so it would be nice to be able to use kdbx4 format, as this is also recommended when creating a new db in the GUI

droidmonkey commented 2 years ago

You must be using an old version of keepassxc. Upgrade your version, we default to kdbx4 in the cli. Also that message with the file command is just pulling text from a .desktop file.

damnms commented 2 years ago

this is version keepassxc-2.6.6-3.fc35.x86_64, i dont think there is any newer available

i dont understand what you try to say with "pulling text from a .desktop file". the command "file" tries to identify another file, that has nothing to do with a .desktop file

droidmonkey commented 2 years ago

This is what the file command is reading from: https://github.com/keepassxreboot/keepassxc/blob/develop/share/linux/keepassxc.xml

The string returned is not relevant to the actual version of the database, there is no kdbx 2.

Although it is interesting that yours says something different than our repository file.

damnms commented 2 years ago

ah ok, was not aware that file searches for a definition in an .xml, thought it only takes the magic number and then identifies that. anyway, the database that is created is in kdbx3 format. i can see that in the GUI of keepassxc and then manually upgrade. Database security -> security -> encryption settings -> database format: KDBX 3.1 is selected then i can select KDBX 4.0 and click on "ok", takes 1-2 seconds and then its changed

(i translated the items/tabs, not sure how they are labeled in the english GUI)

droidmonkey commented 2 years ago

Yah I swore we had fixed that issue, but I guess not. Thank you for pointing it out!

louib commented 2 years ago

I thought this was where the results from file were configured.

droidmonkey commented 2 years ago

Learn something every day!

louib commented 2 years ago

@droidmonkey is there anything to fix in the file magic file?

droidmonkey commented 2 years ago

No looks fine to me