Bug 473210 - polkit auth dialog does not show which account it tries to authenticate with if there's only a single admin account but multiple accounts of any type present
Summary: polkit auth dialog does not show which account it tries to authenticate with ...
Status: RESOLVED FIXED
Alias: None
Product: policykit-kde-agent-1
Classification: Plasma
Component: general (show other bugs)
Version: 5.27.6
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2023-08-09 13:30 UTC by postix
Modified: 2023-08-25 19:17 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0
Sentry Crash Report:


Attachments
Screenshot: Discover and the polkit auth dialog (358.00 KB, image/png)
2023-08-09 13:46 UTC, postix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description postix 2023-08-09 13:30:30 UTC
SUMMARY

I have two user accounts, a standard user which I regularly use and one root account.
The root account can be accessed via `su`. When trying to install software in Discover, the polkit auth dialog appears, asking for a password. When I enter my user password or the root password, the authentication fails. (Passwords were correct!).

Journalctl logs:
```
polkit-agent-helper-1[26350]: pam_unix(polkit-1:auth): authentication failure; logname= uid=1000 euid=0 tty= ruser=admin rhost=  user=admin
polkit-kde-authentication-agent-1[26350]: polkit-agent-helper-1: pam_authenticate failed: Authentication failure
```

STEPS TO REPRODUCE
1. Be logged in as a standard user, which is not in the wheel group
2. Have also a root account set up on the system
2. Try to install some software in Discover

OBSERVED RESULT
The polkit auth dialog appears, asking for a password. Neither the one for the user nor the one for root account is accepted. There's no further explanation or hint.

EXPECTED RESULT
* Authentication as root or some other sys-admin account works.
* Otherwise no password dialog but a hint that the installation is impossible for the current user +  and explanation of possible steps to proceed.


SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 38
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10
Kernel Version: 6.4.7-200.fc38.x86_64 (64-bit)
Graphics Platform: Wayland
Comment 1 postix 2023-08-09 13:44:26 UTC
Update:

I forgot to mention that I also have a second account called "admin", which has sudo privileges as its in the wheel group. It would be helpful if the polkit dialog showed that it wants to authenticate this very account.
Comment 2 postix 2023-08-09 13:46:21 UTC
Created attachment 160864 [details]
Screenshot: Discover and the polkit auth dialog
Comment 3 postix 2023-08-09 14:02:30 UTC
After having removed the "admin" account, the polkit auth dialog says "Password for root". 
So with the "admin" account I would have expected that it says "Password for admin". 

If there are two or more administration accounts, there's a huge button to let you choose an account, so it this issue applies only when having a single admin account on the system.
Comment 4 Nate Graham 2023-08-25 19:17:43 UTC
This appears to already be fixed in Plasma 6 with the shiny new QML dialog. Based on code inspection, it always shows the user switcher if there's more than user account--no matter the type.