Merge lp:~gerboland/unity8/pamCancel into lp:unity8

Proposed by Gerry Boland
Status: Merged
Approved by: Michał Sawicz
Approved revision: 1162
Merged at revision: 1194
Proposed branch: lp:~gerboland/unity8/pamCancel
Merge into: lp:unity8
Diff against target: 45 lines (+18/-8)
1 file modified
tests/mocks/LightDM/demo/GreeterPrivate.cpp (+18/-8)
To merge this branch: bzr merge lp:~gerboland/unity8/pamCancel
Reviewer Review Type Date Requested Status
Christopher Townsend Approve
PS Jenkins bot (community) continuous-integration Approve
Michael Terry Approve
Michał Sawicz Approve
Review via email: mp+230945@code.launchpad.net

Commit message

Cancel open PAM interactions on shutdown - fixes hang on logout on desktop

Description of the change

Cancel open PAM interactions on shutdown - fixes hang on logout on desktop

* Are there any related MPs required for this MP to build/function as expected?
N
* Did you perform an exploratory manual test run of your code change and any related functionality?
Y
* Did you make sure that your branch does not contain spurious tags?
Y
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A
* If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
Michał Sawicz (saviq) wrote :

Looking good.

I'll ask Chris to verify this.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Terry (mterry) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Christopher Townsend (townsend) wrote :

I tried this and it works for me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/mocks/LightDM/demo/GreeterPrivate.cpp'
--- tests/mocks/LightDM/demo/GreeterPrivate.cpp 2014-07-15 16:38:02 +0000
+++ tests/mocks/LightDM/demo/GreeterPrivate.cpp 2014-08-15 09:47:23 +0000
@@ -53,16 +53,15 @@
53 this, SLOT(handlePrompt(QString, QLightDM::Greeter::PromptType, QLightDM::GreeterImpl::ResponseFuture)));53 this, SLOT(handlePrompt(QString, QLightDM::Greeter::PromptType, QLightDM::GreeterImpl::ResponseFuture)));
54 }54 }
5555
56 ~GreeterImpl()
57 {
58 cancelPam();
59 }
60
56 void start(QString username)61 void start(QString username)
57 {62 {
58 // Clear out any existing PAM interactions first (we can't simply63 // Clear out any existing PAM interactions first
59 // cancel our QFuture because QtConcurrent::run doesn't support cancel)64 cancelPam();
60 if (pamHandle != NULL) {
61 pam_handle *handle = pamHandle;
62 pamHandle = NULL; // to disable normal finishPam() handling
63 while (respond(QString())); // clear our local queue of QFutures
64 pam_end(handle, PAM_CONV_ERR);
65 }
6665
67 // Now actually start a new conversation with PAM66 // Now actually start a new conversation with PAM
68 pam_conv conversation;67 pam_conv conversation;
@@ -212,6 +211,17 @@
212 }211 }
213212
214private:213private:
214 void cancelPam()
215 {
216 // Unfortunately we can't simply cancel our QFuture because QtConcurrent::run doesn't support cancel
217 if (pamHandle != NULL) {
218 pam_handle *handle = pamHandle;
219 pamHandle = NULL; // to disable normal finishPam() handling
220 while (respond(QString())); // clear our local queue of QFutures
221 pam_end(handle, PAM_CONV_ERR);
222 }
223 }
224
215 Greeter *greeter;225 Greeter *greeter;
216 GreeterPrivate *greeterPrivate;226 GreeterPrivate *greeterPrivate;
217 pam_handle* pamHandle;227 pam_handle* pamHandle;

Subscribers

People subscribed via source and target branches