Commit 26a8ddc0 authored by Wolfgang Bauer's avatar Wolfgang Bauer
Browse files

screenlocker: don't leave behind screensaver processes

Currently the screen locker just kills the greeter (kscreenlocker_greet)
when the screen is unlocked by the user during the grace time.
But apparently this can leave behind running screensaver processes
launched by the greeter, see the bug report (which has the highest
number of votes of all open bugs AFAICS).

This patch changes this to only terminate the greeter, and adds a signal
handler to the greeter to exit gracefully in this case.
The signal handler exits with return code 1, so that it is not possible
to circumvent the password input by just sending a SIGTERM. (the screen
locker restarts the greeter in case it doesn't quit with exit code 0)

BUG: 224200
FIXED-IN: 4.11.9
REVIEW: 117644
parent 026bd64b
......@@ -38,7 +38,18 @@ static void signalHandler(int signum)
if (!instance)
return;
instance->lockImmediately();
switch(signum)
{
case SIGTERM:
// exit gracefully to not leave behind screensaver processes (bug#224200)
// return exit code 1 to indicate that a valid password was not entered,
// to prevent circumventing the password input by sending a SIGTERM
instance->exit(1);
break;
case SIGUSR1:
instance->lockImmediately();
break;
}
}
int main(int argc, char* argv[])
......@@ -92,6 +103,7 @@ int main(int argc, char* argv[])
sa.sa_handler = signalHandler;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
sigaction(SIGTERM, &sa, NULL);
sigaction(SIGUSR1, &sa, NULL);
return app.exec();
}
......@@ -374,7 +374,7 @@ void KSldApp::unlock()
return;
}
s_graceTimeKill = true;
m_lockProcess->kill();
m_lockProcess->terminate();
}
void KSldApp::inhibit()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment