#1008313 lxpolkit: no authentication dialog can't use it

Package:
lxpolkit
Source:
lxsession
Description:
LXDE PolicyKit authentication agent
Submitter:
realroot
Date:
2023-03-03 21:27:03 UTC
Severity:
grave
Tags:
#1008313#5
Date:
2022-03-26 16:59:53 UTC
From:
To:
Dear Maintainer,

If I try to use pkexec:
---------------

==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/usr/bin/env' as the super user
Authenticating as: root
Password:
polkit-agent-helper-1: error response to PolicyKit daemon:
GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ===
Error executing command as another user: Not authorized

This incident has been reported.
------------------- If I try to launch a program tha requires root like gparted: /usr/sbin/gparted Error executing command as another user: No authentication agent found.
#1008313#10
Date:
2022-12-30 15:21:15 UTC
From:
To:
Dear maintainers,

[Release Team member hat on].

Can you at least please comment on this bug? Do you recognize it? Can
you reproduce it (I would guess not, seems like this would make lxde
nearly useless for everybody)? *If* lxde is nearly useless for
everybody, I'd like to know, then I think we shouldn't ship it with
bookworm.

Paul

#1008313#15
Date:
2022-12-30 19:33:06 UTC
From:
To:
Hello dear Paul and all Release Team!

Actually I did not managed yet to reproduce this bug although I have a
bit of problems with electricity (you know, there is a war ongoing in
Ukraine) so it's a bit hard right now to create a clean environment for
testing. It would be good to get some help with this issue actually. I
hope I can make some testing in the nearest future but cannot promise
anything yet. I'm sorry.

And yet I use LXDE myself each day, I cannot say it's *nearly useless*
but many people use it and rarely have problems.

#1008313#20
Date:
2022-12-30 20:17:34 UTC
From:
To:
Control: tags -1 help

So, let's tag the bug accordingly.

Good to know. I'll not try to remove LXDE based on this bug report then ;).

Paul

#1008313#27
Date:
2023-03-02 10:37:01 UTC
From:
To:
Control: severity -1 normal
Control: tags -1 + moreinfo unreproducible

I happen to have installed a Debian 12 virtual machine with LXDE recently
while investigating a different bug, so I tried checking what happens in a
default installation.

By default, task-desktop-lxde installs both lxpolkit (lxsession dependency)
and policykit-1-gnome (gnome-system-tools dependency). With these installed,
when I am logged in to a LXDE session, pkexec works as expected. I didn't
test gparted.

I also tried removing policykit-1-gnome (which requires removing
gnome-system-tools) so that lxpolkit was the only polkit agent on the
system, and then rebooting. With only lxpolkit installed, when I am
logged in to a LXDE session, pkexec and gparted both work as expected.

LXDE is not my preferred desktop environment and has more dependencies on
unmaintained components than I'm really happy about, but I confirm that
it works, is not useless, and does not need to be removed from bookworm.
...

I suspect the situation here might be that the user reporting the bug is
not using a complete desktop environment, but has installed individual
packages to make their own desktop environment out of components.

This is something that can be made to work, but if you do this, it's up
to you to make sure you're running all the necessary pieces, and that
includes choosing and running a suitable polkit agent.

For example, if I log in to a plain Openbox session, that doesn't
include a polkit authentication agent, and running gparted will fail;
but if I run `lxpolkit &` and then run gparted again, this time I get
a lxpolkit prompt. A more realistic setup would be to run both openbox
and lxpolkit from ~/.xsession.

It is not possible to auto-start a polkit agent via D-Bus activation,
because the system does not know which of potentially several polkit
agents is the one you wanted to include in your desktop environment.

pkexec is meant to be able to operate without a polkit agent, but
something is wrong in its implementation, leading to the "No session for
cookie" error message (this is a known bug, #1031676). systemctl is an
example of a component that can do the equivalent thing correctly. If
someone works out what pkexec is doing wrong, patches would be welcome.

    smcv

#1008313#36
Date:
2023-03-03 21:24:48 UTC
From:
To:
I didn't try that on LXDE.
I apologize I didn't start lxpolkit.

If I open gparted it opens the lxpolkit prompt.
And also pkexec opens it.
------- Original Message -------