After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 586644 - Eject button present even when the user does not have the rights to unmount
Eject button present even when the user does not have the rights to unmount
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: udisks2 volume monitor
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2009-06-22 14:13 UTC by Sebastien Bacher
Modified: 2012-12-10 16:48 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28


Attachments
screenshot of error dialog (10.40 KB, image/png)
2012-08-21 13:29 UTC, William Jon McCann
Details

Description Sebastien Bacher 2009-06-22 14:13:12 UTC
The bug has been opened on https://bugs.launchpad.net/bugs/385571

"When using a loop back mount point or when having another user mounting a device, the eject button is shown in Nautilus even if the user does not have the rights to use the button (to eject the device/mount point).

To reproduce :

sudo mkdir /media/cdrom
sudo mount -o loop jaunty.iso /media/cdrom

Try to eject the mounted device in Nautilus. An error message is printed."
Comment 1 Guillaume Pratte 2009-06-23 15:22:57 UTC
This affects the usability of LTSP deployments. When a user plugs a USB key, a Nautilus window appear with the content of the USB key. The left side panel shows a mount point "usbdisk-sdb1" with an eject icon.

Clicking on the eject icon will produce an error message :
 Unable to unmount usbdisk-sdb1
 umount: /media/username/usbdisk-sdb1 is not in the fstab (and you are not root)

/media/username/usbdisk-sdb1 is a ltspfs fuse filesystem, which means it cannot be unmounted by umount.

Could the eject button be hidden when the user cannot unmount the filesystem? Or maybe there is a way to ask Nautilus to hide the eject button for certain filesystem types, such as all fuse filesystems?
Comment 2 Christian Neumair 2009-09-22 22:50:51 UTC
> Could the eject button be hidden when the user cannot unmount the filesystem?

It is desirable, but currently there is no way to find out whether a mounted file system is really unmountable by the user. There is no umount --dry-run telling you whether the unmount would succeed, and I doubt it is possible for all the file systems. Better show it when we possibly can't perform the operation rather than vice versa.

> Or maybe there is a way to ask Nautilus to hide the eject button for certain
> filesystem types, such as all fuse filesystems?

fuse *should* be unmountable by Nautilus (using umount), but the last time I checked [1] it wasn't possible. I'll check back tomorrow. I am almost tempted to mark this bug report as NOTGNOME. Are you fine with this?

[1] http://thread.gmane.org/gmane.comp.file-systems.fuse.devel/6716
Comment 3 Sense Hofstede 2009-11-12 18:53:11 UTC
This is still an issue in the latest version of GNOME 2.28. 
Oliver Grawert provided an old patch he once wrote that could solve this problem in Nautilus by hiding the umount option for LSTP mounts. It is located at http://people.canonical.com/~ogra/95_suppress_umount_in_ltsp.patch
Comment 4 A. Walton 2009-11-13 15:09:30 UTC
The linked patch is exceptionally out of date. Broke with Nautilus 2.21.
Comment 5 Marcus Carlson 2010-06-26 22:52:17 UTC
I think we should use g_mount_can_unmount () now instead.
Comment 6 Cosimo Cecchi 2012-07-20 16:06:18 UTC
Mass component change due to BZ cleanup, sorry for the noise.
Comment 7 William Jon McCann 2012-08-21 13:29:11 UTC
Created attachment 221995 [details]
screenshot of error dialog

I was able to reproduce this using the listed instructions. However, if I'm an admin I get prompted to enter a password to unmount the device and it works fine albeit with some ugly text in the prompt. If I'm not an admin I get an error dialog like the attached.
Comment 8 William Jon McCann 2012-08-21 14:08:57 UTC
g_mount_can_unmount() is returning TRUE even for the unprivileged user.
Comment 9 David Zeuthen (not reading bugmail) 2012-08-22 19:43:55 UTC
In recent releases, instead of an error dialog you will actually see an authorization dialog asking for an administrator to authenticate. So I don't think there is any problem here.

As I said in bug 682356 comment 3, it is better to use gnome-disk-image-mounter(1) if you want to look inside disk images - that way no authorization dialogs are ever needed.
Comment 10 David Zeuthen (not reading bugmail) 2012-12-10 16:48:14 UTC
Closing as FIXED as per comment 9.