Disable stdin echo when entering passwords on cli
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user