You are not logged in.

#1 2012-10-31 08:58:44

sa1
Member
Registered: 2011-08-21
Posts: 20

[Solved] Storage permissions using logind and polkit 107

I use awesome wm and the X server is started using startx. I have made sure that that the X server starts on the same tty. The session is shown as active.

% loginctl show-session $XDG_SESSION_ID | grep Active
Active=yes

I use devmon for automatic mounting and for unmounting removable media. No authorization is needed for this and things work. But when I unmount a removable drive using nautilus instead, authorization fails. In previous polkit versions, I could work around this by adding myself to the storage group and using the following overriding rules:

[Local Users]
Identity=unix-group:storage
Action=org.freedesktop.udisks2.*
ResultAny=no
ResultInactive=no
ResultActive=yes

This won't work in polkit 107 because it seems to require rules written in javascript. I also don't want to write new rules based on storage group because it seems that it is being recommended to remove yourself from most groups and to depend upon logind for permissions.
What is the best way to unmount using nautilus properly?

Last edited by sa1 (2012-10-31 10:43:28)

Offline

#2 2012-10-31 09:43:23

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: [Solved] Storage permissions using logind and polkit 107

Unless you override the policy like you did, you can only use udisks to umount devices that you have mounted with udisks. I have no idea what devmon does, but it probably doesn't use udisks --mount.

EDIT: Oh, and there may be some udisks vs. udisks2 confusion, I don't know about that.

Last edited by brain0 (2012-10-31 09:44:36)

Offline

#3 2012-10-31 09:54:44

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: [Solved] Storage permissions using logind and polkit 107

Oh, I just found out: GNOME uses udisks2, so you need to use 'udisksctl mount' and 'udisksctl unmount'.

Offline

#4 2012-10-31 09:58:29

sa1
Member
Registered: 2011-08-21
Posts: 20

Re: [Solved] Storage permissions using logind and polkit 107

Ah, it seems devmon can use both udisks and udisks2 but uses udevil by default. I will try configuring devmon to use udisks2 instead. Now I only need to confirm if the mount location is configurable, or at least is the same as gnome's convention of /run/media/$USER. I had this configured in udevil.

Last edited by sa1 (2012-10-31 09:59:28)

Offline

#5 2012-10-31 10:35:57

sa1
Member
Registered: 2011-08-21
Posts: 20

Re: [Solved] Storage permissions using logind and polkit 107

devmon seems to use only udisks1 when used as an automounter.

udisksctl unmount -b /dev/sdb1

when mounted with udisks1 requires authentication.

udisksctl by itself works well and mounts in the correct location.

I will either try changing the command devmon uses or I would just use udevil with some new javascript rules, whichever turns out to be simpler.

EDIT: Scratch the first line. Uninstalling udisks seemed to be the simplest way of making devmon use udisks2. No other configuration method is provided. Everything seems to work now.

Last edited by sa1 (2012-10-31 10:50:41)

Offline

#6 2012-10-31 14:11:57

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: [Solved] Storage permissions using logind and polkit 107

If only KDE used udisks2 yet - KDE 4.10 probably will.

Offline

Board footer

Powered by FluxBB