RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 812972 - disable auto-mount of devices when USB auto share is enabled and active
Summary: disable auto-mount of devices when USB auto share is enabled and active
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: spice-gtk
Version: 6.3
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: 6.8
Assignee: Default Assignee for SPICE Bugs
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 844075 844076
Blocks: 808057 922714
TreeView+ depends on / blocked
 
Reported: 2012-04-16 17:10 UTC by David Jaša
Modified: 2015-10-22 12:26 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 922714 (view as bug list)
Environment:
Last Closed: 2015-10-22 12:26:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description David Jaša 2012-04-16 17:10:00 UTC
Description of problem:
disable auto-mount of devices when USB auto share is enabled and active in order to prevent any corruption that might be caused by concurrent raw access to the device

Version-Release number of selected component (if applicable):
virt-viewer-0.5.2-4.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. connect with virt-viewer to VM that features USB sharing
2. ensure that virt-viewer has both keyboard and mouse focus
3. plug in the device
  
Actual results:
* virt-viewer asks for root password to get sharing privileges if necessary
* virt-viewer forwards the device
* gnome components auto mount the device in client

Expected results:
gnome in client mounts the device only if virt-viewer releases it (i.e. if user refuses to forward it to the guest or if he "ejects" it in the guest)

Additional info:
similar issue when working with gparted: 
https://bugzilla.gnome.org/show_bug.cgi?id=324220

Comment 3 Hans de Goede 2012-04-17 20:14:34 UTC
I think this is a reasonable request, but I wonder if there is an API to suspend automounting in gnome / hal / udisks (does RHEL-6 have udisks?). I guess David Zeuthen probably knows, adding him to the CC. David?

Comment 4 David Zeuthen 2012-04-17 22:05:31 UTC
(In reply to comment #3)
> I think this is a reasonable request, but I wonder if there is an API to
> suspend automounting in gnome / hal / udisks (does RHEL-6 have udisks?). I
> guess David Zeuthen probably knows, adding him to the CC. David?

RHEL6 has udisks 1.x and the D-Bus API there is

 http://hal.freedesktop.org/docs/udisks/UDisks.html#UDisks.Inhibit

You can also use the udisks(1) command for this (the --inhibit option), see

 http://hal.freedesktop.org/docs/udisks/udisks.1.html

Hope this helps.

Comment 5 Hans de Goede 2012-06-11 13:35:59 UTC
This should be done in spice-gtk, changing component.

Comment 6 Hans de Goede 2012-06-11 13:47:05 UTC
HI,

(In reply to comment #4)
> (In reply to comment #3)
> > I think this is a reasonable request, but I wonder if there is an API to
> > suspend automounting in gnome / hal / udisks (does RHEL-6 have udisks?). I
> > guess David Zeuthen probably knows, adding him to the CC. David?
> 
> RHEL6 has udisks 1.x and the D-Bus API there is
> 
>  http://hal.freedesktop.org/docs/udisks/UDisks.html#UDisks.Inhibit
> 
> You can also use the udisks(1) command for this (the --inhibit option), see
> 
>  http://hal.freedesktop.org/docs/udisks/udisks.1.html

Hmm, this seems to require root rights, and we want to inhibit it from the spice-client process which runs as normal user. Is there a way to just stop automounting for one user?

Regards,

Hans

Comment 7 David Zeuthen 2012-06-11 13:58:13 UTC
(In reply to comment #6)
> HI,
> 
> (In reply to comment #4)
> > (In reply to comment #3)
> > > I think this is a reasonable request, but I wonder if there is an API to
> > > suspend automounting in gnome / hal / udisks (does RHEL-6 have udisks?). I
> > > guess David Zeuthen probably knows, adding him to the CC. David?
> > 
> > RHEL6 has udisks 1.x and the D-Bus API there is
> > 
> >  http://hal.freedesktop.org/docs/udisks/UDisks.html#UDisks.Inhibit
> > 
> > You can also use the udisks(1) command for this (the --inhibit option), see
> > 
> >  http://hal.freedesktop.org/docs/udisks/udisks.1.html
> 
> Hmm, this seems to require root rights, and we want to inhibit it from the
> spice-client process which runs as normal user. Is there a way to just stop
> automounting for one user?

Not that I can easily think of - if you need this, the best would be to add an inhibitor interface to the automounter (for GNOME 3, it's in the Shell nowadays I think)... which is messy because you'd need all the desktops to implement it.

Best is probably to just unmount all the partitions on the device (including tearing down LUKS) if opening fails? Sure, it's not the "right" or "correct" solution but it may be a lot easier and robust than adding inbitors frameworks.

[1] : just running the umount(8) command is fine and preferred as it is the most portable solution (works on both RHEL6 and F17/RHEL7)

Comment 8 Hans de Goede 2012-06-22 06:36:52 UTC
(In reply to comment #7)
> > Hmm, this seems to require root rights, and we want to inhibit it from the
> > spice-client process which runs as normal user. Is there a way to just stop
> > automounting for one user?
> 
> Not that I can easily think of - if you need this, the best would be to add
> an inhibitor interface to the automounter (for GNOME 3, it's in the Shell
> nowadays I think)... which is messy because you'd need all the desktops to
> implement it.
>
> Best is probably to just unmount all the partitions on the device (including
> tearing down LUKS) if opening fails? Sure, it's not the "right" or "correct"
> solution but it may be a lot easier and robust than adding inbitors
> frameworks.

For those reading along here, after much discussions through other channels we've decided to go with the "add an inhibitor interface to the desktop automounter" solution, for the following reasons:

1) udisks inhibit is global (not per seat / session), udisks inhibit requires root rights and udisk2 does not have an inhibit interface, so doing this at the udisks level is not an option

2) The problem we're trying to fix is a race between automount and auto-usbredir, unmounting partitions first is not going to help, since the may get mounted until after the unmount code runs and before the device redir code detach the usb-storage driver. With that said unmounting partitions first is a good idea for the manual usbredir case and I've put it on my to-do list.

Comment 12 Hans de Goede 2012-07-28 15:59:18 UTC
In order to do this for 6.4, we not only need spice-gtk support, but we also need to have automount-inhibit support added to gnome-session and nautilus. I've filed 2 new bugs for tracking this, gnome-session bug 844075 and nautilus bug 844076, all 3 bugs need to be fixed for this to be actually fixed, and even then it will only be fixed for spice-gtk running under gnome.

Comment 22 Marc-Andre Lureau 2014-03-12 14:07:19 UTC
taking the bug, since we need an assignee, and I will update spice-gtk

Comment 23 Christophe Fergeau 2014-04-29 15:09:15 UTC
gnome-session bug 844075 and nautilus bug 844076 are still in NEW.

Comment 28 David Blechter 2015-10-22 12:26:46 UTC
closing this bug in rhel 6.x. No customer impact, and the solution is already in rhel 7


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