Bug 1255907

Summary: unable to mount USB device on logins after the first without providing admin password
Product: [Fedora] Fedora Reporter: Aran Cox <arancox>
Component: systemdAssignee: systemd-maint
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 21CC: edgar.hoch, johannbg, jsynacek, lnykryn, msekleta, s, systemd-maint, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-28 15:33:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
workaround for USB mounting none

Description Aran Cox 2015-08-21 20:40:13 UTC
Description of problem:

policykit requires an admin password to mount a USB device, but only on logins after the first one even if the user logs out properly from the first session. I believe some aspect of the session isn't being cleaned up. This problem occurs even if it's the same user. It occurs when using, kdm, gdm, GNOME and Xfce.  The policykit action is org.freedesktop.udisks2.filesystem-mount.


Version-Release number of selected component (if applicable):
systemd-216-25.fc21.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Log in as non-root user.
2. Insert usb device.
3. USB device can be mounted (either via a filemanager or gnome on-screen prompt.)
4. umount USB device (using filemanager) and remove device
5. logout 
6. log in as same (or different) non-root user
7. insert USB device (nothing happens)
8. try to mount device by clicking on icon in file manager
9. get prompted for admin password


Actual results:
Unable to mount USB device after initial login.

Expected results:
Users should be able to mount USB devices if the prior user logged out.  It worked this way in Fedora 20.

Additional info:
It appears to my that the policykit/udisks2 policy has not changed from Fedora 20.
I can make the subsequent logins be able to mount USB by using loginctl kill-session X on the old session.
I examined loginctl info for sessions on Fedora 20 and Fedora 21 and I don't see any difference.  The current (2nd) session is always shown as Active.

Comment 1 Aran Cox 2015-08-28 15:33:25 UTC
This appears to be fixed in the version of systemd shipped with Fedora 22.

My description doesn't quite match what was happening either.

Basically if you log in, log out, and log in again you cannot use any of the policykit actions that require you to be considered "active" even though all the loginctl output indicates you are in fact "active".

If another user logs in you can log in and it will work.  It's only two logins from the same user in a row that breaks all the policykit actions (requires admin.)

Comment 2 Edgar Hoch 2015-09-01 16:49:46 UTC
Is it possible to take the fix to Fedora 21?

Either backporting the fix, or upgrading to an newer systemd version?
Or is there a workaround (for a single non-root user), other than rebooting the machine or searching for another use who will temporary log in at the console?

Its a problem for our users because most of use the same machine all day and some log out in the evening and log in again at the next morning.

Thanks in advance!

Comment 3 Aran Cox 2015-09-01 19:05:36 UTC
This is what I used to upgrade to release 22 systemd:

yum update --releasever=22 systemd

My other workaround which only worked for USB mounting was to patch /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy

I'll attach the patch I used... you won't need it if you update systemd which probably fixes many other issues users might encounter.

Comment 4 Aran Cox 2015-09-01 19:06:36 UTC
Created attachment 1069115 [details]
workaround for USB mounting

Works around USB issue caused by systemd bug.  Probably requires a polkitd restart.