pkexec fails with "GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie"
Submitted by Michal Soltys
Assigned to David Zeuthen @david
Description
When no authentication agents are registered and pkexec falls back to pkttyagent, any attempt to authenticate ends with:
pkexec bash ==== AUTHENTICATING FOR org.freedesktop.policykit.exec === Authentication is needed to run `/usr/bin/bash' as the super user Authenticating as: nozo 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
Note that pkexec works fine with any other authentication agent, for example if I preceeded the above with
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
everything would work fine. By itself, pkttyagent works fine with other commands needing authentication, e.g.
systemctl restart systemd-udevd.service
would execute correctly.
Looks like something is amiss between pkexec and pkttyagent in 0.113. Tested on recent and fully updated Archlinux. For the record, polkit is compiled with following configure line on arch:
./configure --prefix=/usr --sysconfdir=/etc
--localstatedir=/var --libexecdir=/usr/lib/polkit-1
--enable-libsystemd-login=yes --disable-static
--enable-gtk-doc --with-os-type=redhat