No user pre-selected in authentication dialog

Bug #435227 reported by Hernando Torque
40
This bug affects 6 people
Affects Status Importance Assigned to Milestone
PolicyKit GNOME
Won't Fix
Medium
aptdaemon (Ubuntu)
Invalid
Undecided
Unassigned
policykit-1-gnome (Ubuntu)
Fix Released
Medium
Robert Ancell
update-manager (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: update-manager

On my multi-user system the new authentication dialog pops up with no user selected which is a major annoyance (adds at least one unneeded click to the update process). Worse, the drop-down list shows "Select user..." as a disabled item which doesn't make it clear that there's need for user action.

What I expect is, that the user that started the update-manager gets pre-selected in the drop-down list.

update-manager:
  Installed: 1:0.125.2

Screenshot: http://img.xrmb2.net/images/123320.png

Revision history for this message
James Westby (james-w) wrote :

src/polkitgnomeauthenticationdialog.c in policykit-1-gnome contains (line 255)

  /* Initially select the "Select user..." ... */
  gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);

so it is intentional in the source.

Shouldn't be hard to pick the one if there is only one. If there is more
than one choice my first guess at what the behaviour should be is:

   * If one of the users corresponds to the active user then select that.
   * Otherwise select nothing to force the user to select.

Which might be a little more tricky, I'm not sure.

Thanks,

James

affects: policykit-1 (Ubuntu) → policykit-1-gnome (Ubuntu)
Changed in policykit-1-gnome (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
importance: Medium → High
Revision history for this message
James Westby (james-w) wrote :

Investigation on IRC shows that this only happens if there are multiple users
in the “admin” group. If there is only one then there isn't even a combo box.

Therefore this bug should be:

If there are multiple admin users then the current user should be pre-selected
if they are in the list.

Thanks,

James

Changed in policykit-1-gnome (Ubuntu):
importance: High → Medium
Changed in update-manager (Ubuntu):
status: New → Won't Fix
status: Won't Fix → Invalid
Changed in aptdaemon (Ubuntu):
status: New → Invalid
Revision history for this message
Hernando Torque (htorque) wrote :

Sorry for causing confusion, I really should have mentioned that.

Revision history for this message
Vish (vish) wrote :

This bug is an upstream one and it would be quite helpful if somebody experiencing it could send the bug the to the people writing the software. You can learn more about how to do this for various upstreams at https://wiki.ubuntu.com/Bugs/Upstream. Thanks in advance!

Revision history for this message
James Westby (james-w) wrote :

Note that for policykit-gnome the place to report bugs is

  https://bugzilla.gnome.org/enter_bug.cgi?product=policykit-gnome

Thanks,

James

Changed in policykit-gnome-1:
importance: Undecided → Unknown
status: New → Unknown
Changed in policykit-1-gnome (Ubuntu):
assignee: nobody → Robert Ancell (robert-ancell)
Changed in policykit-1-gnome (Ubuntu):
assignee: Robert Ancell (robert-ancell) → nobody
Revision history for this message
Martin Pitt (pitti) wrote :

I take this for sponsoring, since we are currently in sync with Debian and I can commit that directly to Debian's tree.

Changed in policykit-1-gnome (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
status: Triaged → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

Hey Robert,

I tested your change, and I get segfaults now.

I created a test user "joe", to have a second user to play with.

$ pkexec true # works
$ sudo adduser joe admin
$ pkexec true # also works, I get "Martin Pitt" preselected; press cancel
$ sudo deluser joe admin
# boom, pk-1-gnome crashes

This doesn't happen with the current version, so I guess something is wrong with the patch?

Changed in policykit-1-gnome (Ubuntu):
assignee: Martin Pitt (pitti) → Robert Ancell (robert-ancell)
status: Fix Committed → Incomplete
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Fixed patch, wasn't copying the selected user string

Changed in policykit-1-gnome (Ubuntu):
status: Incomplete → New
Revision history for this message
Martin Pitt (pitti) wrote :
Download full text (3.4 KiB)

Hm, I still get the crash with after either adding or removing the second user from admin. Unfortunately the stack trace is still mostly useless:

(polkit-gnome-authentication-agent-1:16940): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff66d73c6 in ?? () from /lib/libc.so.6
(gdb) bt
#0 0x00007ffff66d73c6 in ?? () from /lib/libc.so.6
#1 0x00007ffff66d97ee in malloc () from /lib/libc.so.6
#2 0x00007ffff28d40f2 in ?? () from /usr/lib/libxcb.so.1
#3 0x00007ffff28d42c8 in xcb_poll_for_event () from /usr/lib/libxcb.so.1
#4 0x00007ffff5eba9bd in ?? () from /usr/lib/libX11.so.6
#5 0x00007ffff5ebb257 in _XEventsQueued () from /usr/lib/libX11.so.6
#6 0x00007ffff5ea3f9d in XPending () from /usr/lib/libX11.so.6
#7 0x00007ffff640c6d8 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#8 0x00007ffff6a0ca9a in IA__g_main_context_check (context=0x64fec0, max_priority=2147483647,
    fds=<value optimized out>, n_fds=32767) at /build/buildd/glib2.0-2.22.0/glib/gmain.c:2469
#9 0x00007ffff6a0d280 in g_main_context_iterate (context=0x64fec0, block=<value optimized out>,
    dispatch=<value optimized out>, self=<value optimized out>)
    at /build/buildd/glib2.0-2.22.0/glib/gmain.c:2588
#10 0x00007ffff6a0d9e5 in IA__g_main_loop_run (loop=0x6a3380)
    at /build/buildd/glib2.0-2.22.0/glib/gmain.c:2799
#11 0x0000000000407e98 in main (argc=1, argv=0x7fffffffe628) at main.c:255
(gdb) bt full
#0 0x00007ffff66d73c6 in ?? () from /lib/libc.so.6
No symbol table info available.
#1 0x00007ffff66d97ee in malloc () from /lib/libc.so.6
No symbol table info available.
#2 0x00007ffff28d40f2 in ?? () from /usr/lib/libxcb.so.1
No symbol table info available.
#3 0x00007ffff28d42c8 in xcb_poll_for_event () from /usr/lib/libxcb.so.1
No symbol table info available.
#4 0x00007ffff5eba9bd in ?? () from /usr/lib/libX11.so.6
No symbol table info available.
#5 0x00007ffff5ebb257 in _XEventsQueued () from /usr/lib/libX11.so.6
No symbol table info available.
#6 0x00007ffff5ea3f9d in XPending () from /usr/lib/libX11.so.6
No symbol table info available.
#7 0x00007ffff640c6d8 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
No symbol table info available.
#8 0x00007ffff6a0ca9a in IA__g_main_context_check (context=0x64fec0, max_priority=2147483647,
    fds=<value optimized out>, n_fds=32767) at /build/buildd/glib2.0-2.22.0/glib/gmain.c:2469
        result = <value optimized out>
        check = 0x20
        source = 0x64fe40
        pollrec = <value optimized out>
        n_ready = 0
        i = <value optimized out>
#9 0x00007ffff6a0d280 in g_main_context_iterate (context=0x64fec0, block=<value optimized out>,
    dispatch=<value optimized out>, self=<value optimized out>)
    at /build/buildd/glib2.0-2.22.0/glib/gmain.c:2588
        max_priority = 2147483647
        timeout = -1
        some_ready = <value optimized out>
        nfds = 3
        allocated_nfds = -157179600
        fds = 0x8db4c0
        __PRETTY_FUNCTION__ = "g_main_context_iterate"
#10 0x00007ffff6a0d9e5 in IA__g_main_loop_run (loop=0x6a3380)
    at /build/bu...

Read more...

Changed in policykit-1-gnome (Ubuntu):
status: New → Incomplete
Revision history for this message
Robert Ancell (robert-ancell) wrote :

pitti, can you recheck that you still get the crash? I got that stack trace on the first patch but I've tried with running the git version and the .deb built with that debdiff and I can't reproduce the crash here.

Revision history for this message
Martin Pitt (pitti) wrote :

Yes, I tried it again yesterday (more or less by accident), and it still crashes in an adduser joe admin / pkexec true / deluser joe admin loop.

Revision history for this message
Sebastien Bacher (seb128) wrote :

==2185== Invalid free() / delete / delete[]
==2185== at 0x4024836: free (vg_replace_malloc.c:325)
==2185== by 0x45CD185: g_free (in /lib/libglib-2.0.so.0.2200.2)
==2185== by 0x804D579: polkit_gnome_authentication_dialog_finalize (polkitgnomeauthenticationdialog.c:499)
==2185== by 0x455B1BA: g_object_unref (in /usr/lib/libgobject-2.0.so.0.2200.2)
==2185== by 0x41A8B5D: gtk_object_destroy (gtkobject.c:406)
==2185== by 0x804CC40: polkit_gnome_authenticator_finalize (polkitgnomeauthenticator.c:108)
==2185== by 0x455B1BA: g_object_unref (in /usr/lib/libgobject-2.0.so.0.2200.2)
==2185== by 0x804C22C: do_initiate (polkitgnomeauthenticator.c:467)
==2185== by 0x45C30F0: ??? (in /lib/libglib-2.0.so.0.2200.2)
==2185== by 0x45C4E77: g_main_context_dispatch (in /lib/libglib-2.0.so.0.2200.2)
==2185== by 0x45C871F: ??? (in /lib/libglib-2.0.so.0.2200.2)
==2185== by 0x45C8B8E: g_main_loop_run (in /lib/libglib-2.0.so.0.2200.2)
==2185== Address 0x5062258 is 0 bytes inside a block of size 7 free'd
==2185== at 0x4024836: free (vg_replace_malloc.c:325)
==2185== by 0x45CD185: g_free (in /lib/libglib-2.0.so.0.2200.2)
==2185== by 0x45E5D7F: g_strfreev (in /lib/libglib-2.0.so.0.2200.2)
==2185== by 0x804D568: polkit_gnome_authentication_dialog_finalize (polkitgnomeauthenticationdialog.c:498)
==2185== by 0x455B1BA: g_object_unref (in /usr/lib/libgobject-2.0.so.0.2200.2)
==2185== by 0x41A8B5D: gtk_object_destroy (gtkobject.c:406)
==2185== by 0x804CC40: polkit_gnome_authenticator_finalize (polkitgnomeauthenticator.c:108)
==2185== by 0x455B1BA: g_object_unref (in /usr/lib/libgobject-2.0.so.0.2200.2)
==2185== by 0x804C22C: do_initiate (polkitgnomeauthenticator.c:467)
==2185== by 0x45C30F0: ??? (in /lib/libglib-2.0.so.0.2200.2)
==2185== by 0x45C4E77: g_main_context_dispatch (in /lib/libglib-2.0.so.0.2200.2)
==2185== by 0x45C871F: ??? (in /lib/libglib-2.0.so.0.2200.2)
==2185==

the error is when canceling the dialog

Revision history for this message
Sebastien Bacher (seb128) wrote :

the valgrind log was from the first change, the second one works fine there

Revision history for this message
Robert Ancell (robert-ancell) wrote :

I've removed the incorrect patch so there is only the correct one in this bug report.

Revision history for this message
Martin Pitt (pitti) wrote :

Ah, now I know what went wrong. I applied the correct patch, but apparently I only installed the new pk-1-gnome .deb, not the new libpolkit* (which actually has the fix). Works now, thanks!

Committed to http://git.debian.org/?p=pkg-utopia/policykit-gnome.git;a=commit;h=230873a72c8ff40e0c9e0eb76fb8192d73e58659

Changed in policykit-1-gnome (Ubuntu):
status: Incomplete → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package policykit-1-gnome - 0.94-1+1git.230873

---------------
policykit-1-gnome (0.94-1+1git.230873) karmic; urgency=low

  * Upload Debian packaging git head which includes our Ubuntu delta and fixes
    the default user selection.

  [ Martin Pitt ]
  * Add 03-status-icon-whitespace.patch: Fix leftover white-space in
    the notification area after hiding the icon. Thanks to Chris Coulson for
    the patch! (https://bugzilla.gnome.org/show_bug.cgi?id=597346)

  [ Michael Vogt ]
  * rename debian/patches/01-xfce-autostart.patch
    to debian/patches/01-fix-autostart.patch
  * debian/patches/01-fix-autostart.patch:
    - comment the OnlyShowIn line out to make it autostart on
      KDE as well (LP: #444661) (until KDE gets its own native
      agent)

  [ Robert Ancell ]
  * Add 02-select-default-user.patch: Select the current user to authenticate
    with by default (LP: #435227)

 -- Martin Pitt <email address hidden> Fri, 09 Oct 2009 16:29:32 +0200

Changed in policykit-1-gnome (Ubuntu):
status: Fix Committed → Fix Released
Changed in policykit-1-gnome:
importance: Unknown → Medium
status: Unknown → New
Changed in policykit-1-gnome:
status: New → Confirmed
Changed in policykit-1-gnome:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.