udisks
udisks copied to clipboard
Regarding polkit authorization prompts
https://github.com/user-attachments/assets/5916c152-27fc-48dc-8b73-780d9fb4620a
Regarding polkit authorization prompts, when udisks determines that an operation on a partition requires user authorization, the device name is displayed using the drive name + device descriptor format. However, this approach is somewhat counterintuitive. Users are interacting with a partition rather than the entire disk, and average users may not understand the origin of the displayed disk name.
To improve clarity, we propose the following adjustment:
• If a partition has an idLabel (e.g., a user-defined label), display the device name as idLabel (device descriptor).
• If the idLabel is empty, retain the original display format (drive name + device descriptor).
This change would align the prompt with user expectations and reduce confusion. For a practical demonstration, please refer to the example video.
Key Points:
- User-Centric Terminology: Use partition labels (
idLabel) when available, as they are more recognizable to users. - Fallback Mechanism: Maintain backward compatibility for partitions without labels.
- Clarity: Explicitly distinguish partitions from their parent disks in authorization prompts.
@tbzatek could you please check this, if it's acceptable, I can make a PR.
Could you provide udisksctl dump and gio mount -l please?
I believe this should be consistent with what gvfs-udisks2-volume-monitor presents, as much as possible. As the labels can be duplicate, I believe displaying device file is still a necessity. Cc: @ondrejholy
This is the code in question in gvfs: https://gitlab.gnome.org/GNOME/gvfs/-/blob/master/monitor/udisks2/gvfsudisks2volume.c?ref_type=heads#L292-L327
So yes, I agree with your proposal, it should just distinguish different volume types.
Btw. are you running a desktop session as root?! (/run/media/root/)
gio_mount_l.txt udisksctl_dump.txt Hi @tbzatek , here are logs.
I understand what you say, and I'll modify the code and push later, and maybe I should remove all the *.po changes.
I'm not running desktop session as root, but just mounted the partitions by root user so that the polkit dialog could be raised to show the changes when I unmount them by another user.
Hi @tbzatek , I have tested the modify on latest debian trixie, and the code has been pushed. Could you please review it and give some advise or allow me to merge it?
https://github.com/storaged-project/udisks/pull/1363
Thanks for the screenshots, looks good to me.