on xenial help sign in
When shutting down, cancel any open PAM interaction
commit1bab52155fdf145e164794c0f8b37affd4a78bce authorMichael Terry <mike@mterry.name> dateWed 18 Jan 2017, 16:07 (10 years ago) parentf78a3a4
1 file changed+6−1
plugins/LightDM/IntegratedLightDM/liblightdm/GreeterPrivate.cpp+6−1
plugins/LightDM/IntegratedLightDM/liblightdm/GreeterPrivate.cpp+6−1
@@ -18,6 +18,7 @@
1818
1919#include "Greeter.h"
2020#include "GreeterPrivate.h"
21+#include <QCoreApplication>
2122#include <QFuture>
2223#include <QFutureInterface>
2324#include <QFutureWatcher>
@@ -50,6 +51,10 @@ public:
5051 {
5152 qRegisterMetaType<QLightDM::GreeterImpl::ResponseFuture>("QLightDM::GreeterImpl::ResponseFuture");
5253
54+ // Don't get stuck waiting for PAM as we shut down.
55+ connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit,
56+ this, &GreeterImpl::cancelPam);
57+
5358 connect(&futureWatcher, &QFutureWatcher<int>::finished, this, &GreeterImpl::finishPam);
5459 connect(this, SIGNAL(showMessage(pam_handle *, QString, QLightDM::Greeter::MessageType)),
5560 this, SLOT(handleMessage(pam_handle *, QString, QLightDM::Greeter::MessageType)));
@@ -246,7 +251,6 @@ private Q_SLOTS:
246251 Q_EMIT greeter->showPrompt(text, type);
247252 }
248253
249−private:
250254 void cancelPam()
251255 {
252256 if (pamHandle != nullptr) {
@@ -269,6 +273,7 @@ private:
269273 }
270274 }
271275
276+private:
272277 Greeter *greeter;
273278 GreeterPrivate *greeterPrivate;
274279 pam_handle* pamHandle;