← Back to team overview

desktop-packages team mailing list archive

[Bug 445303] Re: policykit-1 password dialog sometimes hangs

 

Launchpad has imported 9 comments from the remote bug at
https://bugs.freedesktop.org/show_bug.cgi?id=30515.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2010-09-30T13:48:27+00:00 James Westby wrote:

Created attachment 39080
Patch to fix the race

Hi,

There's a race that means that the user can type in their
password, have the text entry disappear, and then nothing
else happen for a couple of minutes until the call times
out and they get a cryptic error. If they cancel the
dialog in that time then the program will work as they
are successfully authenticated.

The reason for this is that if the SIGCHLD handler is called
before the stdout one it unregisters the stdout handler, so
it is never triggered, and that is the only way that a response
is sent, positive or negative, except for cancelling.

I'm attaching a patch which works around this in most
cases by giving the stdout handler a chance to go first.
You may prefer to reorganise a bit to not have one
handler remove the other instead. It also ensures that
the stdout handler is registered first, in case the
child exits very quickly, but I don't know if that's
possible.

I'm also attaching a couple of other patches I produced
in the course of investigating this that might be of
interest. They fix theoretical problems, but they may
never occur in the real world.

Thanks,

James

Reply at: https://bugs.launchpad.net/ubuntu/+source/update-
manager/+bug/445303/comments/46

------------------------------------------------------------------------
On 2010-09-30T13:49:34+00:00 James Westby wrote:

Created attachment 39081
Patch to ensure that the helper is declared running before a handler can fire

Reply at: https://bugs.launchpad.net/ubuntu/+source/update-
manager/+bug/445303/comments/47

------------------------------------------------------------------------
On 2010-09-30T13:50:32+00:00 James Westby wrote:

Created attachment 39082
Patch to ensure that things written to the child are written in full

Reply at: https://bugs.launchpad.net/ubuntu/+source/update-
manager/+bug/445303/comments/48

------------------------------------------------------------------------
On 2010-10-12T11:20:51+00:00 James Westby wrote:

Hi,

I've been asked to patch this in Ubuntu, as there are apparently
a fair number of users for whom policykit rarely works due to this
issue. I'm not sure what the variable is there given that I have
very rarely seen this myself.

Could you review the changes please?

If I don't hear either way soon then I will add distro patch
just reviewed by Ubuntu developers.

Thanks,

James

Reply at: https://bugs.launchpad.net/ubuntu/+source/update-
manager/+bug/445303/comments/52

------------------------------------------------------------------------
On 2010-10-12T11:24:11+00:00 Zeuthen wrote:

Pretty sure these patches don't apply to current master as there were
some changes post 0.96 - any chance you can check if this is still an
issue in master (I can't reproduce this) and, if so, update the patches?
Thanks.

Reply at: https://bugs.launchpad.net/ubuntu/+source/update-
manager/+bug/445303/comments/53

------------------------------------------------------------------------
On 2010-10-12T12:14:52+00:00 James Westby wrote:

(In reply to comment #4)
> Pretty sure these patches don't apply to current master as there were some
> changes post 0.96 - any chance you can check if this is still an issue in
> master (I can't reproduce this) and, if so, update the patches? Thanks.

I can't easily check this either, as I can't reproduce it at will.

I've looked at the changes you make, and textually these won't apply, but
I don't see that they will have fixed the race here, unless the g_source
functions will somehow ensure that the stdout watch is serviced before the
child one?

Thanks,

James

Reply at: https://bugs.launchpad.net/ubuntu/+source/update-
manager/+bug/445303/comments/54

------------------------------------------------------------------------
On 2011-02-23T06:20:45+00:00 Zeuthen wrote:

Still can't reproduce and haven't seen any authentication agent bugs
mentioning this problem so closing as WORKSFORME. Please reopen if you
manage to reproduce. Thanks.

Reply at: https://bugs.launchpad.net/ubuntu/+source/update-
manager/+bug/445303/comments/69

------------------------------------------------------------------------
On 2011-02-23T07:21:01+00:00 James Westby wrote:

Hi,

I have no consistent way to reproduce, but the Ubuntu bug report
was very "popular" indeed, with many duplicates.

https://bugs.launchpad.net/ubuntu/+source/policykit-1/+bug/649939 for where
I worked with Jean-Baptiste to find the patch, and https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/445303 for the bug that received most of the attention.

There was a theoretical race that I found via code inspection, and a
patch to remove it was confirmed to fix the issue with someone who
could reliably reproduce. Unless you know that the g_source functions
remove the race, then I think you should apply the patch.

Thanks,

James

Reply at: https://bugs.launchpad.net/ubuntu/+source/update-
manager/+bug/445303/comments/70

------------------------------------------------------------------------
On 2015-03-07T15:15:44+00:00 Simon McVittie wrote:

In the absence of a recent polkit release, I'm looking into updating
Debian experimental's polkit (which currently includes this patch) to
current git master.

This looks suspiciously like Bug #60847. James, does the patch that was
merged for that bug look OK? It stops using the child watch at all, and
only reads stdout, which seems a more correct solution to this.

Reply at: https://bugs.launchpad.net/ubuntu/+source/update-
manager/+bug/445303/comments/78

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to policykit-1-gnome in Ubuntu.
https://bugs.launchpad.net/bugs/445303

Title:
  policykit-1 password dialog sometimes hangs

Status in PolicyKit:
  Invalid
Status in PolicyKit GNOME component:
  Unknown
Status in aptdaemon package in Ubuntu:
  Invalid
Status in policykit package in Ubuntu:
  Invalid
Status in policykit-1-gnome package in Ubuntu:
  Invalid
Status in update-manager package in Ubuntu:
  Invalid
Status in aptdaemon source package in Karmic:
  Invalid
Status in policykit source package in Karmic:
  Invalid
Status in policykit-1-gnome source package in Karmic:
  Won't Fix
Status in update-manager source package in Karmic:
  Invalid

Bug description:
  Binary package hint: update-manager

  Using current karmic versions after entering the polkit password for
  org.debian.apt-upgrade-packages and pressing enter the dialog for
  authentification didn't close, button to cancel or validate were not
  responsive, after a minute or so the dialog closed and update-manager
  displayed an error saying there was probably an issue with aptdaemon
  and apport triggered

  Traceback (most recent call last):
    File "/usr/lib/pymodules/python2.6/dbus/connection.py", line 579, in msg_reply_handler
      *message.get_args_list()))
    File "/usr/lib/python2.6/dist-packages/aptdaemon/gtkwidgets.py", line 468, in _on_error
      raise error
  DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

To manage notifications about this bug go to:
https://bugs.launchpad.net/policykit/+bug/445303/+subscriptions