Skip to content

Commit 157a4c2

Browse files
author
lhark
committed
Write CLI password prompt to stderr
Writing the prompt to stderr greatly helps with the use of keepassxc-cli in automated scripts or as a password provider for programs like mutt or borg. This is done in accordance with POSIX that specifies that diagnostic messages be sent to stderr. This commit should be a first step in solving the following issues: keepassxreboot#831, keepassxreboot#1221
1 parent a44138d commit 157a4c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/Database.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,8 @@ Database* Database::unlockFromStdin(QString databaseFilename, QString keyFilenam
507507
QTextStream out(outputDescriptor);
508508
QTextStream err(errorDescriptor);
509509

510-
out << QObject::tr("Insert password to unlock %1: ").arg(databaseFilename);
511-
out.flush();
510+
err << QObject::tr("Insert password to unlock %1: ").arg(databaseFilename);
511+
err.flush();
512512

513513
QString line = Utils::getPassword();
514514
auto passwordKey = QSharedPointer<PasswordKey>::create();

0 commit comments

Comments
 (0)