keepassxreboot / keepassxc

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

--pw-stdin stopped working with KeePassXC 2.3 #1600

Closed alfredkrohmer closed 6 years ago

alfredkrohmer commented 6 years ago

Expected Behavior

Passing --pw-stdin on the command line (and passing the password to stdin) should open the database on startup.

Current Behavior

KeePassXC starts with the welcome screen and doesn't open any databases.

Context

Happens with my older database as well as with a newly created database. Adding --keyfile doesn't work either.

Debug Info

KeePassXC - Version 2.3.0 Revision: 4c0ed74

Libraries:

Operating system: Arch Linux CPU-Architektur: x86_64 Kernel: linux 4.15.3-2-ARCH

Enabled extensions:

TheChiefMeat commented 6 years ago

Yep, the code for launching the database via a terminal is now completely missing from the main.cpp that was present in 2.2.4:

   const bool pwstdin = parser.isSet(pwstdinOption);
    for (const QString& filename: fileNames) {
        if (!filename.isEmpty() && QFile::exists(filename) && !filename.endsWith(".json", Qt::CaseInsensitive)) {
            QString password;
            if (pwstdin) {
                static QTextStream in(stdin, QIODevice::ReadOnly);
                password = in.readLine();
            }
        } -----THIS LINE IS MISSING:-----  mainWindow.openDatabase(filename, password, parser.value(keyfileOption))
    }

    int exitCode = app.exec();
joanbm commented 6 years ago

Same issue here, I can confirm that @TheChiefMeat 's solution works.

Generator commented 6 years ago

This is a duplicate of #1358

phoerious commented 6 years ago

Probably even the same #1533

phoerious commented 6 years ago

Indeed, it is.