Bug 1255907 - unable to mount USB device on logins after the first without providing admin password
unable to mount USB device on logins after the first without providing admin ...
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
21
Unspecified Linux
unspecified Severity medium
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-21 16:40 EDT by Aran Cox
Modified: 2015-09-01 15:06 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-28 11:33:25 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
workaround for USB mounting (1.11 KB, patch)
2015-09-01 15:06 EDT, Aran Cox
no flags Details | Diff

  None (edit)
Description Aran Cox 2015-08-21 16:40:13 EDT
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 11:33:25 EDT
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 12:49:46 EDT
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 15:05:36 EDT
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 15:06:36 EDT
Created attachment 1069115 [details]
workaround for USB mounting

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

Note You need to log in before you can comment on or make changes to this bug.