Bug 21031 - deadlock when PAM_TEXT_INFO is used
Summary: deadlock when PAM_TEXT_INFO is used
Status: RESOLVED INVALID
Alias: None
Product: PolicyKit
Classification: Unclassified
Component: libpolkit (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: David Zeuthen (not reading bugmail)
QA Contact: David Zeuthen (not reading bugmail)
URL: https://bugs.launchpad.net/ubuntu/+so...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-03 07:49 UTC by James Westby
Modified: 2009-10-21 10:39 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Only expect a reply from messages that should have a reply (3.12 KB, patch)
2009-04-13 06:41 UTC, James Westby
Details | Splinter Review

Description James Westby 2009-04-03 07:49:30 UTC
Hi,

As reported in

  https://bugs.launchpad.net/ubuntu/+source/policykit/+bug/354378

the authentication dialog will sometimes hang.

In particular it hangs if your password is about to expire, in which
case pam will send a message.

This message is sent as PAM_AUTH_INFO from polkit-grant-helper-pam,
and relayed by polkit-grant-helper. It is then passed on to the authentication
agent by polkit-grant. polkit-grant doesn't allow the agent to respond to
these, and so it proceeds to wait for the next line of the conversation.
However, polkit-grant-helper is waiting for a response to this, as it does
for everything sent by the child, but it is never going to get one, and doesn't
even need to bother, as polkit-grant-helper-pam isn't expecting one.

It seems to me that there are two ways to fix this. Either have
polkit-grant-helper inspect the messages and know which get responses
(duplicating some logic), or have everything get a response, and have
polkit-grant-helper-pam wait for the empty responses.

Thanks,

James
Comment 1 James Westby 2009-04-13 06:41:09 UTC
Created attachment 24750 [details] [review]
Only expect a reply from messages that should have a reply

Hi,

Here's a patch to implement my first suggested fix,
only waiting for a reply from the parent when they
are going to send one.

I tested the fix by setting my password to expire in
2 days and then unlocking users-admin, which showed
the bug previously, and works with the patch.

This doesn't seem to be an issue in git HEAD, but
it seems quite important for the 0.9 branch.

Thanks,

James
Comment 2 James Westby 2009-04-28 04:10:09 UTC
Hi,

Do you have any comment on this patch? I would like to
push it in to Ubuntu stable releases, and if I could get
your review first that would be great.

Thanks,

James
Comment 3 David Zeuthen (not reading bugmail) 2009-10-21 10:39:44 UTC
This bug report is for the old version of PolicyKit. Closing as all of the code has been rewritten. Please reopen if the bug report applies to the latest version of PolicyKit. Thanks.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.