Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Polkit/Mate: make it ask permission to mount drive?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
djhyland
n00b
n00b


Joined: 26 Nov 2008
Posts: 67
Location: St. Paul MN

PostPosted: Tue Jul 24, 2018 11:06 pm    Post subject: [SOLVED] Polkit/Mate: make it ask permission to mount drive? Reply with quote

Hi all!

First off, apologies if this isn't the right forum to ask, or if I've misdiagnosed the problem I'm having. That said...

A while back, I noticed that my computer changed its behavior when I try to mount a partition through Mate. In the past, when I've clicked on any of my partitions listed in the "Places" menu, it's asked for an administrative password and, once one is given, mounted the drive to /media/$DRIVENAME as expected. Somewhere along the line, though, I started getting error messages when I'd try the same: "Error, Unable to mount $DRIVENAME, Not authorized to perform operation". After some searching, I can get it to mount the partition without any sort of permission by modifying /usr/share/polkit-1/actions/org.freedesktop.UDisks2.policy in such a way:

Code:

  <action id="org.freedesktop.udisks2.filesystem-mount">
    <description>Mount a filesystem</description>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
--      <allow_active>auth_admin</allow_active>
++      <allow_active>yes</allow_active>
    </defaults>
  </action>

  <action id="org.freedesktop.udisks2.filesystem-mount-system">
    <description>Mount a filesystem on a system device</description>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
--      <allow_active>auth_admin</allow_active>
++      <allow_active>yes</allow_active>
    </defaults>
  </action>


Now, this is convenient enough, but not what I want. I'd rather it ask me for my credentials before doing it. I'm not too worried about security--this is my personal computer and I don't really have much of worth on it that could be stolen/destroyed by such poor security--but I know that there's got to be a way to get it to ask properly. Can anyone point me in the right direction?

Just in case it's needed, I'm running an ~amd64 system with an otherwise fairly normal configuration. I'd get rid of polkit entirely if I could, but unfortunately, it seems like Mate needs it, so I've only enabled it on as few things as possible to get Mate installed. My make.conf is here and my package.use is here.

Thanks in advance!


Last edited by djhyland on Sun Aug 05, 2018 10:22 pm; edited 1 time in total
Back to top
View user's profile Send private message
djhyland
n00b
n00b


Joined: 26 Nov 2008
Posts: 67
Location: St. Paul MN

PostPosted: Sun Aug 05, 2018 10:21 pm    Post subject: Reply with quote

Right. I figured it out on my own: I needed to install mate-polkit. After installing it, changing the "yes" options back to "auth_admin", and rebooting my computer, I'm now properly asked for my password when I try to mount an internal drive. Problem solved!
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9678
Location: almost Mile High in the USA

PostPosted: Sun Aug 05, 2018 10:34 pm    Post subject: Reply with quote

Interesting, I would have thought that would have been a dependency of mate.

Thank you for finding the problem, I wonder if this should be an actual ebuild issue, or was there a USE=polkit somewhere that should have been used to automatically pick up mate-polkit. Does not look like it however. Perhaps this should be a feature enhancement to save future hassle?

Perhaps if you want, submit a bug to add this as a feature enhancement on bugs.gentoo.org. That way if USE=polkit is set on mate-base/mate then mate-polkit will automatically be picked up. If someone forgets USE=polkit, well now it's self documented in the ebuild :D
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
djhyland
n00b
n00b


Joined: 26 Nov 2008
Posts: 67
Location: St. Paul MN

PostPosted: Wed Aug 08, 2018 10:41 pm    Post subject: Reply with quote

I think that the problem was that I didn't have a USE=polkit flag set when I first encountered the problem. Once I realized that it was an issue with polkit, I tried removing all colsolekit/polkit dependencies from my system and recompiled my system with a USE=-polkit -policykit in my make.conf. Unfortunately, Mate seems to need consolekit which needs polkit, so I put a sys-auth/consolekit policykit line in my package.use file. I can see why emerge didn't automatically include mate-polkit as a dependency.

That said, it'd have been nice when Mate decided that it needed consolekit and polkit to work properly (during a version bump, I'm pretty sure) if it had added mate-polkit as a dependency.

All told, I'll write this one off as a consequence of my specific configuration rather than file a bug report.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum