To reproduce:
* Have a user in the sudo group, and default polkitd configuration, so
they can do root-equivalent things after authenticating as themselves
* Initial state: do not be logged in to the machine at all
* Log in on a text virtual console (getty/login) or with interactive ssh,
or use `ssh -t machine pkexec ...` to force allocation of a
pseudo-terminal
* Run: systemctl restart avahi-daemon.service
(or any other service that is installed and is harmless to restart)
* Run: pkexec true
* Enter the user's correct password whenever prompted to authenticate
Expected result:
* `systemctl restart avahi-daemon.service` prompts for the user's password,
then restarts avahi-daemon, successfully
* `pkexec true` prompts for the user's password, then runs `true`,
successfully
Actual result:
systemctl successfully prompts for the user's password, demonstrating
that polkitd is working as intended (so this is a pkexec bug and not a
polkitd bug):
but pkexec fails with "No session for cookie":
Logging in on tty6 with getty/login has similar symptoms. I used ssh for
the version quoted here because it was easier to copy/paste.
smcv