Bug 416956

Summary: Mounting and umount of external USB drive as non-root user does not work
Product: [openSUSE] openSUSE 11.0 Reporter: Bulawa Akula <digital_tank>
Component: GNOMEAssignee: E-mail List <gnome-bugs>
Status: RESOLVED NORESPONSE QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P2 - High CC: auxsvr, behlert, d, dpbasti, info, jcs
Version: Final   
Target Milestone: ---   
Hardware: x86   
OS: openSUSE 11.0   
Whiteboard:
Found By: Community User Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: list of installed packages

Description Bulawa Akula 2008-08-13 11:56:33 UTC
Hello,

mounting and unmounting of external USB drives as non-root user does not work. Fixed it by editing: /usr/share/PolicyKit/policy/org.freedesktop.hal.storage.policy

<action id="org.freedesktop.hal.storage.mount-removable">
 
=> <allow_inactive>no</allow_inactive> to <allow_inactive>yes</allow_inactive>

<action id="org.freedesktop.hal.storage.eject">

=> <allow_inactive>no</allow_inactive> to <allow_inactive>yes</allow_inactive>
Comment 1 Bulawa Akula 2008-08-15 15:00:55 UTC
In Reply to: Cyril Hrubis <chrubis@novell.com> changed:
 
What|Removed |Added
----------------------------------------------------------------------------
         AssignedTo|bnc-team-screening@forge.provo.novell.com       |dkukawka@novell.com
 
<action id="org.freedesktop.hal.storage.mount-removable">
<description>Mount file systems from removable drives.</description>
<message>System policy prevents mounting removable media</message>
<defaults>
<allow_inactive>no</allow_inactive>

Changed to: <allow_inactive>yes</allow_inactive>

<allow_active>yes</allow_active>
</defaults>
</action>

<action id="org.freedesktop.hal.storage.eject">
<description>Eject removable media.</description>
<message>System policy prevents ejecting removable media</message>
<defaults>
<allow_inactive>no</allow_inactive>

Changed to: <allow_inactive>yes</allow_inative>

<allow_active>yes</allow_active>
</defaults>
</action>
Comment 2 Danny Al-Gaaf 2008-08-18 11:41:42 UTC
Please check if you have ConsoleKit (rcconsolekit status) running and check what 'env | grep COOK' prints.

Did you try to eject/umount the device from a active desktop session or e.g. from a remote session. Which desktop (KDE or GNOME) do you use?
Comment 3 Bulawa Akula 2008-08-18 16:15:45 UTC
Hello,

I use XFCE and tried to mount it there. Before this hack I mounted it in a terminal as root. At the moment I have no access to this machine but I will let you know what above command will print out. It's a vanilla opensuse netinstall and the only thing which is different is that I use XFCE not KDE or Gnome. 
Comment 4 David Solbach 2008-08-28 17:33:56 UTC
Created attachment 236073 [details]
list of installed packages
Comment 5 David Solbach 2008-08-28 17:34:35 UTC
I can reproduce the bug. same error message when trying to mount removable devices in dolphin.

@danny here are the results for your question:

---
linux-pngl:/home/david # rcconsolekit status
Checking for service ConsoleKit daemon                               running
linux-pngl:/home/david # env | grep COOK
linux-pngl:/home/david #
---

additionally I attach a list of installed packages since I'm using the kde4 unstable repos.

Comment 6 Danny Al-Gaaf 2008-08-28 17:38:36 UTC
You have to run the 'env | grep COOK' within a session of the user. Did you?
Comment 7 David Solbach 2008-08-28 20:41:05 UTC
oh, I ran it as root. Now i ran it as user, same result... (no env variable set that matches "COOK").
Comment 8 Danny Al-Gaaf 2008-08-29 10:32:11 UTC
It's then a XFCE bug. XFCE need to register a active session/new user to ConsoleKit. By this it should get a XDG_SESSION_COOKIE which identifiy the user/session. Otherwise the user is marked as inactive which prevents the needed privileges to do e.g. mount/umount.
Comment 9 David Solbach 2008-08-29 14:31:22 UTC
XFCE? Am I using XFCE If I run KDE4 with it's Kwin?
Comment 10 Sebastian Turzański 2008-09-13 22:35:24 UTC
Well i confirm this bug in the Factory repo
on my desktop which uses kde4 factory I have this bug that XDG_SESSION_COOKIE is not set resulting in no posiblitiy to mount removable drives no matter what you put in policies.

In kde4 without factory repo on my laptop mounting works ok and XDG_SESSION_COOKIE is set

IMHO this bug is critical
Comment 11 Pavol Rusnak 2008-09-17 13:38:55 UTC
David is not using Xfce and encounters the same bug. Reassigning back to Danny.

Adding Stefan Dirsch to CC as this is similar to bug 410817.
Comment 12 Stefan Dirsch 2008-09-17 15:53:09 UTC
I'm afraid I can't help here.
Comment 13 Danny Al-Gaaf 2008-09-17 17:10:00 UTC
If you are using KDE, it's a KDE bug. Reassign to KDE guys
Comment 14 JP Rosevear 2008-09-18 16:02:38 UTC
Please get the output of  ck-list-sessions on the command line.  Do you have your own .xsession file?  And is this 4.0 or 4.1 from the repos (for the 11.0 user).
Comment 15 Sebastian Turzański 2008-09-18 16:16:34 UTC
I'm using KDE 4.1++ (4.1.66) which is 4.1 with Factory repo enbled.
My windowmanager is XGL with compiz

polrus@linuxatemki:~> ck-list-sessions
Session1:
        uid = '0'
        realname = 'root'
        seat = 'Seat1'
        session-type = ''
        active = FALSE
        x11-display = ''
        x11-display-device = ''
        display-device = '/dev/tty2'
        remote-host-name = ''
        is-local = TRUE
        on-since = '2008-09-18T15:56:58Z'
        idle-since-hint = '2008-09-18T15:59:32Z'
Comment 16 David Solbach 2008-10-12 17:19:35 UTC
Running

--
sudo polkit-auth --user username --grant org.freedesktop.hal.storage.mount-removable
--

solves the problem for me. There is also a Forum post about this:

http://forums.opensuse.org/applications/multimedia/394901-usb-mass-storage-unable-mount.html#post1882370

ck-list sessions returns nothing:

--
david@localhost:~> ck-list-sessions
david@localhost:~>
--

I'm running OpenSUSE 11 with the KDE4 Unstable repo enabled.
Comment 17 JP Rosevear 2008-10-15 12:55:45 UTC
The active=FALSE part is a problem.
Comment 18 Lubos Lunak 2008-11-21 16:46:48 UTC
Mounting/unmounting USB stick works fine for me on openSUSE11.1? Is this problem specific only to the KDE4:/UNSTABLE repo?
Comment 19 David Solbach 2008-12-14 16:43:42 UTC
Might be specific to KDE4:/UNSTABLE repo. At least I don't have the bug after several updates. I'm now on openSUSE 11.1 with KDE4:/UNSTABLE and everithing works fine.
Comment 20 Jaques Chitte 2009-01-09 17:52:18 UTC
No it's not specific to kde4 ! See above it was reported with xfce.

I have just installed from opensuse11.1 dvd using xfce desktop option and have the same issue. 

The c/no/yes/ hack suggested by OP did no change anything neither after rchal restart nor after reboot.

/usr/share/PolicyKit/policy/org.freedesktop.hal.storage.policy

It still shows an error message indicating it is reading a value of "no" for this. The above file does not seem to be beind read.

using polkit-auth worked once but after adding the equivalent for eject it opens an emply filemanager window and the contents are not seen.


I am disappointed to see a release goes out this this sort mess on a major feature. Seems like getting out for Christmas is more important than getting it working. 
Comment 23 Stefan Behlert 2009-01-28 14:03:19 UTC
I tested SLED 11 RC3-candidate with GNOME and KDE4. Both 'default' configured as they came out of the box.
GNOME was able to mount all, and even asked for a password on an encrypted partition.
KDE4 showed the partitions in sysinfo:/ but it was not possible to access the content of the partitions.
Comment 24 Stefan Behlert 2009-01-28 14:07:58 UTC
For KDE4 a slight add-on: The partitions are accessible if one clicks on the partition name in the pop-up window that pops up for a second when plugging in the hard-disk.
Comment 25 Lubos Lunak 2009-01-30 18:18:41 UTC
This bugreport is several different issues messed together:
- original issue is for Xfce - reassigning
- some of the followup comments are for KDE4 unstable packages, which is completely unrelated and should not be a problem anymore
- the SLED issues - this is again unrelated to the original issue, and I cannot reproduce - does the problem exist with an USB-stick too? If so, please open a new bugreport for this.
Comment 26 Pavol Rusnak 2009-03-05 13:29:47 UTC
Updated Xfce 4.6 packages are ready in BuildService - see http://stick.gk2.sk/blog/2009/02/xfce-4-6-0-released-and-ready-for-testing/ for instructions.

I am able to mount/unmount the USB drive as non-root user, thus I'm closing this bug due to previous comment.
Comment 27 Jaques Chitte 2009-03-09 01:08:02 UTC
How can you seriously close this as invalid?

The bug as reported was / is VALID. It exists in the current release. If some irrelevant comments were added that does not invalidate the bug. Saying you have not found it in the pre-release test build means it MAY BE fixed. It does not make it invalid.

Until suse releases fix it is neither INVALIS nor FIXED .
Comment 28 Pavol Rusnak 2009-03-23 10:22:47 UTC
reopening
Comment 29 Tristan Hoffmann 2009-03-29 11:02:37 UTC
I have the same problem with openSUSE 11.1 (fully updated).
The changes proposed in the description of this bug fixed the problem for me too, but since I use an external esata hdd that is considered internal I also had to change

<action id="org.freedesktop.hal.storage.mount-fixed">

=> <allow_inactive>no</allow_inactive> to <allow_inactive>yes</allow_inactive>
=> <allow_active>auth_admin_keep_always</allow_active> to <allow_active>yes</allow_active>


PERMISSION_SECURITY is easy, local in /etc/sysconfig/security, so I think this bug could be easily fixed for most users by setting the values as proposed in the description and in my comment (see above) by default for this security level.
This should work perfectly for normal end users.
Comment 30 Mark Van De Vyver 2009-04-11 00:22:17 UTC
In response to Comment #25, see also Bug #447932 for a more kde4 concentrated case.  I think the problem is not just USB drives, but removable media in general.

Perhaps the KDE4 specifics could be discussed there?  E.g does the suggested fix work for all KDE4 situations of removable-media, I know the suggested fix solved a problem with  accessing DVD's/CDRoms that were correctly recognized by KDE4's 'Device Notifier'.

The Bug #447932 solution may be a duplicate for this bug's solution, either way granting the 'pol-kit --allow ...' would seem to be required urgently.

Is there any likelihood of a patch?
Comment 31 Pavol Rusnak 2009-05-11 13:03:40 UTC
ConsoleKit should be initalized by display manager. Reassigning to GDM maintainers.
Comment 32 Larry Finger 2011-04-02 21:32:01 UTC
The version with which you had the bug is now obsolete. I'll close this as NORESPONSE. If you can still reproduce it in current 11.4, please reopen the bug and move it to the appropriate version. Thanks!