GNOME Bugzilla – Bug 586644
Eject button present even when the user does not have the rights to unmount
Last modified: 2012-12-10 16:48:14 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."
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?
> 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
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
The linked patch is exceptionally out of date. Broke with Nautilus 2.21.
I think we should use g_mount_can_unmount () now instead.
Mass component change due to BZ cleanup, sorry for the noise.
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.
g_mount_can_unmount() is returning TRUE even for the unprivileged user.
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.
Closing as FIXED as per comment 9.