Bug 97445

Summary: pkexec fails with "GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie"
Product: PolicyKit Reporter: Michal Soltys <soltys>
Component: libpolkitAssignee: David Zeuthen (not reading bugmail) <zeuthen>
Status: RESOLVED MOVED QA Contact: David Zeuthen (not reading bugmail) <zeuthen>
Severity: normal    
Priority: medium CC: daboross, jan, maxtram95
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Michal Soltys 2016-08-22 21:00:36 UTC
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
Comment 1 Tom Seewald 2016-11-21 19:27:36 UTC
I have ran into this bug as well, fc24 with MATE desktop.  Also tried polkit-devel, and mate-polkit-devel with no change in behavior.

What can I do to help troubleshoot this issue?
Comment 2 GitLab Migration User 2018-08-20 21:34:59 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/polkit/polkit/issues/17.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.