summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2019-03-10 23:01:11 +0900
committerMichele Calgaro <[email protected]>2019-03-31 23:56:03 +0900
commitc66647a6addcf35768871b652f3eefc641875d7c (patch)
tree14d51d5b5d4d76c83d4140aa7f5da04a7f0cf3ff
parent4ed967f2cb719aabd74f80be4ccb60a6594b089a (diff)
downloadtdebase-c66647a6addcf35768871b652f3eefc641875d7c.tar.gz
tdebase-c66647a6addcf35768871b652f3eefc641875d7c.zip
Fixed bug 925 ("SAK driven secure dialog is not available for use"
message in .xsession-errors even when SAK is disabled). Signed-off-by: Michele Calgaro <[email protected]> (cherry picked from commit 3c109e3d106e7348cea31ea1be7ce0aaadee307d)
-rw-r--r--kdesktop/lockeng.cc47
1 files changed, 31 insertions, 16 deletions
diff --git a/kdesktop/lockeng.cc b/kdesktop/lockeng.cc
index 80292b577..52826bf24 100644
--- a/kdesktop/lockeng.cc
+++ b/kdesktop/lockeng.cc
@@ -132,14 +132,29 @@ SaverEngine::SaverEngine()
connect(&mLockProcess, TQT_SIGNAL(processExited(TDEProcess *)),
TQT_SLOT(lockProcessExited()));
- mSAKProcess = new TDEProcess;
- *mSAKProcess << "tdmtsak";
- connect(mSAKProcess, TQT_SIGNAL(processExited(TDEProcess*)), this, TQT_SLOT(slotSAKProcessExited()));
-
- TQTimer::singleShot( 0, this, TQT_SLOT(handleSecureDialog()) );
-
configure();
+ // Create SAK process only if SAK is enabled
+ KSimpleConfig *config;
+ struct stat st;
+ if (stat( KDE_CONFDIR "/tdm/tdmdistrc" , &st) == 0) {
+ config = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmdistrc" ));
+ }
+ else {
+ config = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmrc" ));
+ }
+ config->setGroup("X-:*-Greeter");
+ bool useSAKProcess = false;
+#ifdef BUILD_TSAK
+ useSAKProcess = config->readBoolEntry("UseSAK", false) && KDesktopSettings::useTDESAK();
+#endif
+ if (useSAKProcess) {
+ mSAKProcess = new TDEProcess;
+ *mSAKProcess << "tdmtsak";
+ connect(mSAKProcess, TQT_SIGNAL(processExited(TDEProcess*)), this, TQT_SLOT(slotSAKProcessExited()));
+ TQTimer::singleShot( 0, this, TQT_SLOT(handleSecureDialog()) );
+ }
+
mLockProcess.clearArguments();
TQString path = TDEStandardDirs::findExe( "kdesktop_lock" );
if( path.isEmpty())
@@ -166,14 +181,6 @@ SaverEngine::SaverEngine()
}
// lock the desktop if required
- KSimpleConfig *config;
- struct stat st;
- if (stat( KDE_CONFDIR "/tdm/tdmdistrc" , &st) == 0) {
- config = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmdistrc" ));
- }
- else {
- config = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmrc" ));
- }
config->setGroup("X-:0-Core");
bool autoLoginEnable = config->readBoolEntry("AutoLoginEnable", false);
bool autoLoginLocked = config->readBoolEntry("AutoLoginLocked", false);
@@ -375,11 +382,17 @@ void SaverEngine::enableExports()
void SaverEngine::handleSecureDialog()
{
// Wait for SAK press
- if (!mSAKProcess->isRunning()) mSAKProcess->start();
+ if (mSAKProcess && !mSAKProcess->isRunning()) {
+ mSAKProcess->start();
+ }
}
void SaverEngine::slotSAKProcessExited()
{
+ if (!mSAKProcess) {
+ printf("[kdesktop] SAK process does not exist. Something went wrong. Ignoring...\n"); fflush(stdout);
+ return;
+ }
int retcode = mSAKProcess->exitStatus();
if ((retcode != 0) && (mSAKProcess->normalExit())) {
trinity_lockeng_sak_available = FALSE;
@@ -487,7 +500,9 @@ bool SaverEngine::startLockProcess( LockType lock_type )
}
mState = Preparing;
- mSAKProcess->kill(SIGTERM);
+ if (mSAKProcess) {
+ mSAKProcess->kill(SIGTERM);
+ }
enableExports();