diff options
author | Ken Moore <ken@ixsystems.com> | 2017-10-11 14:46:54 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-10-11 14:46:54 -0400 |
commit | 2cedaf2c2ac9e4b4e3078c5a6f04ba5fc3f4f5b3 (patch) | |
tree | 4781e84e186f9fcc445a6f4d75e6fb44721e9385 /src-qt5/core/lumina-desktop-unified/src-screensaver/LLockScreen.cpp | |
parent | A bit more cleanup for the screensaver system. (diff) | |
download | lumina-2cedaf2c2ac9e4b4e3078c5a6f04ba5fc3f4f5b3.tar.gz lumina-2cedaf2c2ac9e4b4e3078c5a6f04ba5fc3f4f5b3.tar.bz2 lumina-2cedaf2c2ac9e4b4e3078c5a6f04ba5fc3f4f5b3.zip |
Update lumina-checkpass with 2 additional options:
1. "-fd <file descriptor>" pass in a file descriptor (such as 0 for standard input) to read password
2. "-f <file path>" pass in a file path to read the password
Then update lumina-desktop-unified to use the "-f" version with a QTemporaryFile.
I was trying to get it to use the "-fd" version, but the file descriptor I am getting from the QTemporaryFile does not seem to work properly - still need to track this down a bit more later but the -f option works fine for now.
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-screensaver/LLockScreen.cpp')
-rw-r--r-- | src-qt5/core/lumina-desktop-unified/src-screensaver/LLockScreen.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-screensaver/LLockScreen.cpp b/src-qt5/core/lumina-desktop-unified/src-screensaver/LLockScreen.cpp index 0ff70142..b791ffd2 100644 --- a/src-qt5/core/lumina-desktop-unified/src-screensaver/LLockScreen.cpp +++ b/src-qt5/core/lumina-desktop-unified/src-screensaver/LLockScreen.cpp @@ -77,7 +77,18 @@ void LLockScreen::TryUnlock(){ this->setEnabled(false); QString pass = ui->line_password->text(); ui->line_password->clear(); - bool ok = (LUtils::runCmd("lumina-checkpass", QStringList() << pass) == 0); + //Create a temporary file for the password, then pass that file descriptor to lumina-checkpass + QTemporaryFile *TF = new QTemporaryFile(".XXXXXXXXXX"); + TF->setAutoRemove(true); + bool ok = false; + if( TF->open() ){ + QTextStream in(TF); + in << pass; + in.flush(); //make sure we push it to the file **right now** since we need to keep the file open + ok = (LUtils::runCmd("lumina-checkpass", QStringList() << "-f" << TF->fileName() ) == 0); + TF->close(); + } + delete TF; if(ok){ emit ScreenUnlocked(); this->setEnabled(true); |