polkit-org / polkit

polkit (formerly PolicyKit) is a toolkit for defining and handling authorizations. It is used for allowing unprivileged processes to speak to privileged processes.
Other
41 stars 22 forks source link

pidfd tracking breaks gnome authentication agent #457

Open triallax opened 1 month ago

triallax commented 1 month ago

Describe the bug The pidfd tracking feature added in polkit 124 causes e.g. pkexec echo hi to show a terminal password prompt instead of the gnome password modal dialog that it would show on previous versions.

Commenting out this line to disable pidfd tracking fixes the issue and makes pkexec echo hi again show the gnome authentication dialog as it should: https://github.com/polkit-org/polkit/blob/82f0924dc0eb23b9df68e88dbaf9e07c81940a5a/meson.build#L226

To Reproduce Steps to reproduce the behavior:

  1. Log in to GNOME with polkit 124 installed
  2. Open a terminal
  3. Run pkexec echo hi
  4. Observe it showing a terminal password prompt

Expected behavior pkexec should show the gnome authentication dialog, even with pidfd tracking on.

Screenshots

polkit 124: `pkexec echo hi` running in my terminal, showing a terminal password prompt

previous polkit versions or polkit 124 with pidfd tracking disabled: gnome authentication dialog shown on previous versions of polkit

Desktop (please complete the following information):

Additional context Notably. enough, this issue seems to only be happening with gnome's polkit auth agent. I could not reproduce the issue while running KDE Plasma with its polkit agent, and even while running gnome, starting polkit-mate-authentication-agent-1 or polkit-kde-authentication-agent-1 manually and then running pkexec echo hi would show the respective authentication dialog as expected.

Also, here are the options we're passing to meson:

-Dsession_tracking=libelogind
-Dsystemdsystemunitdir=""
-Dpolkitd_user=_polkitd
-Djs_engine=duktape
-Dauthfw=pam
-Dpam_include=dummy
-Dos_type=redhat
-Dman=true
-Dintrospection=true
-Dtests=false
-Dgtk_doc=false