Cancelling PolicyKit authorization produces silly error message

Bug #1058072 reported by Matthew Paul Thomas
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Fix Released
Medium
Robert Roth

Bug Description

software-properties-gtk 0.92.6, Ubuntu Q

1. Open Software Sources.
2. Change anything, e.g. check/uncheck any of the checkboxes in the "Ubuntu Software" tab.
3. In the authorization prompt, choose "Cancel".

What happens: An error alert appears, "Authorization failed." - "Software sources can't be changed without permission."

What should happen: No error alert appears. You already know that you cancelled the authorization.

Related branches

Revision history for this message
Edward Donovan (edward.donovan) wrote :

Hi Matthew -

I created that dialog, amidst fixing bug 828850 . The previous situation was: when you canceled authorization, you got an apport crash. It was several months ago, so I don't remember exactly why I thought a message might be needed. But I figured whether to have a dialog, at all, would be reviewed with the patch. I guess that's just happening now, in a way.

If I can get some time, I'll make a patch to remove the dialog. The original patch that included it is attached there at bug 828850. One would remove the five lines that define the dialog. Then in each of the many places that the patch wraps in try-except, replace the dialog with, well, whatever is a pythonic no-op in that if statement.

Changed in software-properties (Ubuntu):
importance: Undecided → Medium
tags: added: quantal
Changed in software-properties (Ubuntu):
status: New → Triaged
Revision history for this message
Matthew Paul Thomas (mpt) wrote :

Edward, thanks for that work, and I'm sorry I didn't see it at the time (I wasn't subscribed to software-properties). Is it possible to distinguish between the case of clicking Cancel, and the case where PolicyKit fails for any other reason? I think we want to show an error alert only in the latter case. And perhaps make it a RecoverableError <https://wiki.ubuntu.com/ErrorTracker#app-requested>, so we can figure out what's causing it, and fix root causes later on.

Revision history for this message
Edward Donovan (edward.donovan) wrote :

Thanks, Matthew, and no problem. :)

For distinguishing the cases...I don't know of a way to do that. For any failed authentication, dbus returns the exception 'PermissionDeniedByPolicy', and with the patch, software-properties catches that. Maybe somewhere in dbus, a finer distinction could be found, but that's just speculation. What I know about this, I just learned at the time of going after this bug.

I'll look next at the cleanest way to change the code, when it catches that exception, to do a no-op, and not pop any dialog.

Revision history for this message
Marius B. Kotsbak (mariusko) wrote :

I experienced something similar, see bug #1074657.

Revision history for this message
Edward Donovan (edward.donovan) wrote :

As I wrote on Marius' bug, he's experiencing a real authorization problem. This bug is a design issue, where the code is working fine, but a change in the interface behavior is wanted. Thanks.

Revision history for this message
Robert Roth (evfool) wrote :

This is indeed a bitesize bug but after fixing this bug #874766 becomes more important: After canceling the authentication dialog you will not get an error dialog, but the comboboxes on the Updates tab will not revert to the original (saved) values, thus you will see wrong values.

Changed in software-properties (Ubuntu):
assignee: nobody → Robert Roth (evfool)
status: Triaged → In Progress
Robert Roth (evfool)
Changed in software-properties (Ubuntu):
status: In Progress → Fix Committed
Changed in software-properties (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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