mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-11-23 00:10:37 -05:00
Disable stdin echo when entering passwords on cli
This commit is contained in:
parent
7438d6db18
commit
400073c7cc
6 changed files with 111 additions and 6 deletions
|
|
@ -24,6 +24,7 @@
|
|||
#include <QTimer>
|
||||
#include <QXmlStreamReader>
|
||||
|
||||
#include "cli/PasswordInput.h"
|
||||
#include "core/Group.h"
|
||||
#include "core/Metadata.h"
|
||||
#include "crypto/Random.h"
|
||||
|
|
@ -398,13 +399,12 @@ Database* Database::openDatabaseFile(QString fileName, CompositeKey key)
|
|||
|
||||
Database* Database::unlockFromStdin(QString databaseFilename)
|
||||
{
|
||||
static QTextStream inputTextStream(stdin, QIODevice::ReadOnly);
|
||||
QTextStream outputTextStream(stdout);
|
||||
|
||||
outputTextStream << QString("Insert password to unlock " + databaseFilename + "\n> ");
|
||||
outputTextStream.flush();
|
||||
|
||||
QString line = inputTextStream.readLine();
|
||||
QString line = PasswordInput::getPassword();
|
||||
CompositeKey key = CompositeKey::readFromLine(line);
|
||||
return Database::openDatabaseFile(databaseFilename, key);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue