Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't crash on start-up if polkit encounters a dbus error #12549

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ Depends:
metacity,
nemo,
network-manager-gnome [linux-any],
policykit-1-gnome,
python3,
python3-dbus,
python3-distro,
Expand Down
20 changes: 19 additions & 1 deletion js/ui/polkitAuthenticationAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const CinnamonEntry = imports.ui.cinnamonEntry;
const PopupMenu = imports.ui.popupMenu;
const UserWidget = imports.ui.userWidget;
const Util = imports.misc.util;
const Main = imports.ui.main;

const DIALOG_ICON_SIZE = 64;
const DELAYED_RESET_TIMEOUT = 200;
Expand Down Expand Up @@ -523,5 +524,22 @@ var AuthenticationAgent = class {
}

function init() {
let agent = new AuthenticationAgent();
try {
let agent = new AuthenticationAgent();
} catch(err) {
if(!(err instanceof Error)) {
err = new Error(err);
}

log('polkitAuthenticationAgent: init error ' + err);

let icon = new St.Icon({ icon_name: 'dialog-warning',
icon_type: St.IconType.FULLCOLOR,
icon_size: 36 });

Main.warningNotify(_('Unable to start Cinnamon PolicyKit Agent'), err.message +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Unable to start the PolicyKit agent'

"\n\n" +
_("If you have another PolicyKit Agent configured to autostart, it should be disabled."),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be "agent", not "Agent".

icon);
}
}
Loading