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
1=== modified file 'tests/mocks/LightDM/demo/GreeterPrivate.cpp'
2--- tests/mocks/LightDM/demo/GreeterPrivate.cpp 2014-07-15 16:38:02 +0000
3+++ tests/mocks/LightDM/demo/GreeterPrivate.cpp 2014-08-15 09:47:23 +0000
4@@ -53,16 +53,15 @@
5 this, SLOT(handlePrompt(QString, QLightDM::Greeter::PromptType, QLightDM::GreeterImpl::ResponseFuture)));
6 }
7
8+ ~GreeterImpl()
9+ {
10+ cancelPam();
11+ }
12+
13 void start(QString username)
14 {
15- // Clear out any existing PAM interactions first (we can't simply
16- // cancel our QFuture because QtConcurrent::run doesn't support cancel)
17- if (pamHandle != NULL) {
18- pam_handle *handle = pamHandle;
19- pamHandle = NULL; // to disable normal finishPam() handling
20- while (respond(QString())); // clear our local queue of QFutures
21- pam_end(handle, PAM_CONV_ERR);
22- }
23+ // Clear out any existing PAM interactions first
24+ cancelPam();
25
26 // Now actually start a new conversation with PAM
27 pam_conv conversation;
28@@ -212,6 +211,17 @@
29 }
30
31 private:
32+ void cancelPam()
33+ {
34+ // Unfortunately we can't simply cancel our QFuture because QtConcurrent::run doesn't support cancel
35+ if (pamHandle != NULL) {
36+ pam_handle *handle = pamHandle;
37+ pamHandle = NULL; // to disable normal finishPam() handling
38+ while (respond(QString())); // clear our local queue of QFutures
39+ pam_end(handle, PAM_CONV_ERR);
40+ }
41+ }
42+
43 Greeter *greeter;
44 GreeterPrivate *greeterPrivate;
45 pam_handle* pamHandle;

Subscribers

People subscribed via source and target branches