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
68 stars 32 forks source link

pkcheck --list-temp not work #181

Open polkit-github-migration-bot opened 1 year ago

polkit-github-migration-bot commented 1 year ago

In gitlab.freedesktop.org by taisuishen on Nov 8, 2022, 03:29

Link to the original issue: https://gitlab.freedesktop.org/polkit/polkit/-/issues/180

[user@localhost root]$ echo $$
15013
[user@localhost root]$ pkcheck --action-id 'org.freedesktop.NetworkManager.settings.modify.system' --process 15013 -u
polkit\56temporary_authorization_id=tmpauthz1
polkit\56retains_authorization_after_challenge=true
[user@localhost root]$ pkcheck --list-temp

pkcheck --list-temp does not display any information even if temporary permission has been granted.

this bug first proposed in 2014 [https://access.redhat.com/errata/RHBA-2015:0692.html]

However, the final patch does not appear to include removing the --list-temp parameter or fixing this feature.[https://bugs.freedesktop.org/show_bug.cgi?id=29936]

polkit-github-migration-bot commented 1 year ago

In gitlab.freedesktop.org by jrybar on Mar 28, 2023, 17:13

Just tried

$ systemctl restart sshd
 [authentication window now]
$ pkcheck --list-temp
Error opening `/proc/1175521/cmdline': Failed to open file ?/proc/1175521/cmdline?: No such file or directory
authorization id: tmpauthz0
action:           org.freedesktop.systemd1.manage-units
subject:          unix-process:1175521:112888851 (cannot read cmdline)
obtained:         2 sec ago (Tue Mar 28 17:04:51 2023)
expires:          4 min 57 sec from now (Tue Mar 28 17:09:50 2023)

pkcheck --list-temp is supposed to list temp authorization ("authorization cookies") that already exists. Are you sure your tmpauthz really existed? Maybe I just don't understand your reproducer...