multiple database with --pw-stdin (#2916)

* Updated utilities to unlock KDBX with OS password manager on macOS and Linux
* Use a static stream on stdin for --pw-stdin otherwise buffer loss eliminates subsequent passwords
* Update INSTALL requirements
This commit is contained in:
Jack Thomasson 2019-04-25 08:37:13 -06:00 committed by Jonathan White
parent ba4d68c76e
commit 1cbd395d71
5 changed files with 42 additions and 12 deletions

View file

@ -144,8 +144,7 @@ int main(int argc, char** argv)
if (pwstdin) {
// we always need consume a line of STDIN if --pw-stdin is set to clear out the
// buffer for native messaging, even if the specified file does not exist
static QTextStream in(stdin, QIODevice::ReadOnly);
static QTextStream out(stdout, QIODevice::WriteOnly);
QTextStream out(stdout, QIODevice::WriteOnly);
out << QObject::tr("Database password: ") << flush;
password = Utils::getPassword();
}