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

Use Polkit agent for X11 sessions #12272

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SparkyBluefang
Copy link
Contributor

This simplifies packaging since we don't need to worry if an external polkit agent is needed. This is currently a draft since I understand upstream may not be ready for this change yet. But I'm creating this now so I can reference it in Gentoo packaging.

Also, don't crash if the agent doesn't start properly. If another agent happens to be running, this will throw a DBus exception. I figured popping a notification would be most appropriate, since the user may have another agent configured to auto-start.

(cinnamon:9337): Gjs-CRITICAL **: 13:47:05.571: JS ERROR: Polkit.Error: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: An authentication agent already exists for the given subject
_init@/usr/share/cinnamon/js/ui/polkitAuthenticationAgent.js:332:22
AuthenticationAgent@/usr/share/cinnamon/js/ui/polkitAuthenticationAgent.js:323:10
init@/usr/share/cinnamon/js/ui/polkitAuthenticationAgent.js:392:17
start@/usr/share/cinnamon/js/ui/main.js:433:31
@<main>:1:47

Comment on lines +396 to +409
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 +
"\n\n" +
_("If you have another PolicyKit Agent configured to autostart, it should be disabled."),
icon);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was my best guess at how to handle this. I wasn't sure if it belonged here or in main.js

@Fantu
Copy link
Contributor

Fantu commented Jul 4, 2024

Fedora already switched to internal polkit agent also for xorg, probably @leigh123linux can tell you how it's going and if he has encountered any problems

@leigh123linux
Copy link
Contributor

No one has complained yet about the switch to internal polkit, 6.2.x was promoted to F40 stable the other day.

@SparkyBluefang
Copy link
Contributor Author

If that's the case, then maybe this is closer to prime time than I thought :)

@SparkyBluefang SparkyBluefang marked this pull request as ready for review July 6, 2024 08:04
@JosephMcc
Copy link
Contributor

This probably shouldn't be merged currently. Part of the reason we don't use this dialog is because it doesn't support multiple users yet. It's something I'm looking at adding this development cycle. Maybe should revisit the idea then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants