! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Different behave to cancel device authentication. Annoying behave when cannot...
Status:
RESOLVED: FIXED

Comments

Description hapical 2020-05-11 21:00:26 CEST
Way to reproduce:

Need to have devices that need authentication to open it.

Open thunar with treeview side bar.

Behave 1: click on the treeview ICON device that need authenticatoin (e.g. another partition). You can cancel authentication. IT'S OK.

Behave 2: click on the treeview expander device (the little arrow to the left). YOU CANNOT cancel authentication. It's very easy to click there by mistake.

Annoying when working with many tabs and need to close thunar to avoid that authentication dialog clicked by mistake.

Thanks.
Comment 1 Theo Linkspfeifer editbugs 2020-05-11 21:13:45 CEST
> Need to have devices that need authentication to open it.
Can you please provide some details? How can one set up those devices?
Comment 2 hapical 2020-05-13 02:26:51 CEST
Devices in Thunar side-bar can be usb, mtp, system partitions, etc. With Archlinux system partitions are protected by default. 

You can protect devices access with authentication changing polkit rules:
https://wiki.archlinux.org/index.php/Polkit#Authorization_rules

I don't understand why some Linux/GNU distributions allow access by default to system partitions, but that's another history.
Comment 3 Theo Linkspfeifer editbugs 2020-05-13 10:35:33 CEST
> You can protect devices access with authentication changing polkit rules:
> https://wiki.archlinux.org/index.php/Polkit#Authorization_rules
Where can I find this particular rules file? Alternatively, you could attach it to this report.
Comment 4 hapical 2020-05-13 17:22:16 CEST
Created attachment 9861 
udisk2  polkit

/usr/share/polkit-1/actions/org.freedesktop.UDisks2.policy     is part of udisks2
Comment 5 hapical 2020-05-13 17:23:14 CEST
look for   <action id="org.freedesktop.udisks2.filesystem-mount">     this one control removable media (pendrive)
change

    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>

with

    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>auth_admin</allow_active>
    </defaults>

execute in terminal "thunar -q" to terminate totally thunar daemon
insert usb, follow the 'way to reproduce' in my first post


after you finish, restore the /usr/share/polkit-1/actions/org.freedesktop.UDisks2.policy


*we can create an overrule in /etc/polkit-1/rules.d to make it permanent but in this way is more compressible. 
file /usr/share/polkit-1/actions/org.freedesktop.UDisks2.policy will be overwritten with udisks2 updates


Thanks
Comment 6 Theo Linkspfeifer editbugs 2020-05-14 11:14:35 CEST
Created attachment 9864 
patch

The instructions were helpful. Thanks!

A small change in thunar_tree_view_mount_finish() fixes this issue.
Comment 7 Git Bot editbugs 2020-05-14 21:58:39 CEST
Theo Linkspfeifer referenced this bugreport in commit bad07aaa9803c9255ba62eb32fab623dfe05132f

Only open device after successful mount attempt (Bug #16831)

https://gitlab.xfce.org/xfce/thunar/commit/bad07aaa9803c9255ba62eb32fab623dfe05132f
Comment 8 Git Bot editbugs 2020-05-14 22:00:36 CEST
Theo Linkspfeifer referenced this bugreport in commit 713b1266546b7d094dfeb13490591a7e645c95c3

Only open device after successful mount attempt (Bug #16831)

https://gitlab.xfce.org/xfce/thunar/commit/713b1266546b7d094dfeb13490591a7e645c95c3
Comment 9 alexxcons editbugs 2020-05-14 22:03:36 CEST
Thank you for reporting hapical, and thanks alot for the patch, Theo !

I can reproduce the bug, and I can confirm that the patch fixes it.

Pushed to master and 4.14 branch, to be released in thunar 1.9.0 and thunar 1.8.15

Bug #16831

Reported by:
hapical
Reported on: 2020-05-11
Last modified on: 2020-05-14

People

Assignee:
Xfce Bug Triage
CC List:
2 users

Version

Version:
1.8.14

Attachments

udisk2 polkit (310.63 KB, text/plain)
2020-05-13 17:22 CEST , hapical
no flags
patch (846 bytes, patch)
2020-05-14 11:14 CEST , Theo Linkspfeifer
no flags

Additional information