gnome displays nfs mounts on the desktop

Bug #191512 reported by Niall Sheridan
8
Affects Status Importance Assigned to Milestone
glib2.0 (Ubuntu)
Fix Released
Low
Ubuntu Desktop Bugs
Hardy
Fix Released
Low
Ubuntu Desktop Bugs

Bug Description

Every time autofs mounts a new nfs volume, the volume appears on my desktop and nautilus immediately opens a window. Finding my desktop swamped with over 50 (and counting) automounted volumes and a nautilus window for each one is somewhat annoying. There should at least be an "ignore nfs" option for nautilus/gnome/gvfs/whatever controls this behaviour.

Tags: regression

Related branches

Revision history for this message
Philip Walls (ubuntu-rabidgeek) wrote :

This regression went away some time around Feb 20th and recently snuck back in sometime near the beginning of this month (March). Makes it nearly impossible to use the gnome desktop with many NFS partitions (eg. via autofs).

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

The shares that are mounted in /media are shown.

Revision history for this message
Markus Golser (golserma) wrote :

Same problem here

Revision history for this message
Philip Walls (ubuntu-rabidgeek) wrote :

Timo,

The issue is not limited to only things mounted under /media. Mounts under /home also create desktop icons and pop up a new Nautilus window.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report. Do you still get the issue using the current versions?

Changed in nautilus:
assignee: nobody → desktop-bugs
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Philip Walls (ubuntu-rabidgeek) wrote :

Yes, the version of nautilus in latest hardy/unstable still has this problem.

Revision history for this message
Matthew Williams (number6) wrote :

Another example of this problem: I use pam_mount to automagically mount a crypt filesystem under /home/myusername. I now see an icon for /home/myusername on my Desktop that was not present in Feisty. This is on Hardy Beta with updates as of 2008-03-23.

As a workaround, setting /apps/nautilus/icon_view/volumes_visible to false makes this icon disappear but also makes useful icons disappear as well (e.g. USB flash disks).

Revision history for this message
Sebastien Bacher (seb128) wrote :

the users mounts are listed that's the wanted behaviour, not a bug, and a different topic

Revision history for this message
Matthew Williams (number6) wrote :

The behaviour that I am seeing in Hardy is different from Feisty and Gutsy and, IMHO, is not wanted behaviour. Reading my initial comment, I can see that I was not 100% clear. Let me rephrase:

- let the username be "myusername"
- /home/myusername is an empty mountpoint
- when myusername logs in via gdm, pam_mount mounts a crypted block device at /home/myusername
- /home/myusername appears as an icon on the Desktop for the user myusername This icon did NOT appear in Feisty and Gutsy

The reason I believe that this is a related problem is that the original bug report is about Nautilus displaying unwanted mounted volumes that were automatically mounted. If you believe that this is wanted behaviour then I would question why the behaviour in Feisty and Gutsy is different. If you believe that this is an unrelated issue to the NFS one, then I will raise a new bug report.

thanks!

Revision history for this message
Sebastien Bacher (seb128) wrote :

The behaviour is different from previous cycles for a good reason, gnomevfs has been replaced by the new gvfs and what is used now is a new clean design. Gnome-vfs was not doing any mounting for you and using urls, not gvfs is doing mounts so any desktop application can access those locations. The way mounts are handled also changed, now every mounts in the user or media directories are listed. There is some corner cases which might have not been considered correctly yet though. You can describe your usecase, the issue and maybe what you suggest to solve the issue. The nfs mounts are one issue, they should respond to the same criterium than the other mounts though, which just means changing the mountpoint will be enough to get those displayed or not. If that's not enough you are welcome to describe the exact issue. The special mount you are using is a different usecase and should be discussed in a new bug and not this one

Changed in nautilus:
status: Incomplete → New
Revision history for this message
Philip Walls (ubuntu-rabidgeek) wrote :

Would it be reasonable to only display mounts in /media on the desktop?

Revision history for this message
Philip Walls (ubuntu-rabidgeek) wrote :

To clarify, this is an issue if you use autofs with hundreds or thousands of automount entries in autofs map. Based on my understanding, there are two simple ways to resolve this problem while maintaining a good user experience for flash drives and the like:

1) We can specify an inclusive list of directories (eg. /media, /mnt) to show on the desktop and not show any others
2) We can specify a list of commonly used autofs directories (/auto, /home, /net, /vol, etc) to blacklist

I'm personally in favor of #1, as I believe all "user" mounts already go to one of these two directories and removes the need to catch all of the edge cases (eg. /misc, /exports, etc) that people might have. This would solve the problem I am seeing as well as the one that Matthew has reported.

If it's possible to expose this to the end user via a gconf option as a list of directories to include/exclude, some of the implementation details would be taken off of your hands.

Revision history for this message
Sebastien Bacher (seb128) wrote :

not sure what autofs is and how it's working but as described before only the user directory and media mounts are listed so using an autofs directory should work correctly and make those not being listed

Revision history for this message
Andrew Pollock (apollock) wrote :

The problem is, it is firing on autofs mounts. Take a look at the attached screenshot. It doesn't highlight the problem terribly well, but notice the number of windows in the task bar at the bottom? They're all autofs volumes.

Revision history for this message
Sebastien Bacher (seb128) wrote :

the screenshot is not really informative, you can get the same opening several local directories, how do you configure autofs and where do you mount those?

Revision history for this message
Mark Painter (mpainter) wrote :

The story of that screenshot is that when I left my machine (and locked the screen) on Friday, my desktop was empty. When I came in on Monday and unlocked it, that's what was there. The mount point in question would be /home/mpainter, which is mounted by automount whenever something under /home/mpainter is requested. The windows all ended up blank by the end of the weekend as they were also getting permission denied reading the mounts (as my auth had expired).

Revision history for this message
Philip Walls (ubuntu-rabidgeek) wrote :

Sebastien,

autofs is a daemon that interacts with the Linux kernel automounter to mount directories when they are accessed for the first time. The volumes are mounted by "root", not by the user accessing the directory. This is especially helpful when you have thousands of home directories exported via NFS, but you don't want to mount all of them on boot, but only as needed.

Is there a particular reason that home directories need to be displayed on the desktop? I understand the need for /media, but not the need for /home/$USER. What we're trying to get at is that this behavior is a regression from Dapper and Gutsy (and also Edgy and Feisty) which causes the Gnome desktop to be somewhat at odds with very large deployments such as those found in universities or large corporations. As far as I can see, this regression poses no significant benefit to end users who already have sufficient methods of getting to their home directory.

-P

Revision history for this message
Philip Walls (ubuntu-rabidgeek) wrote :

Sebastien, if you'd like to discuss this in depth I would be happy to meet with you on Freenode. I am currently in #ubuntu, #ubuntu-devel and #ubuntu-bugs and I'd be more than happy to speak via /query with you if you prefer. My IRC nick is 'pawalls'.

Revision history for this message
Sebastien Bacher (seb128) wrote :

user mounts are listed because when you mount something in your user directory that's usually to use it, not sure how those could be filtered easily though

Revision history for this message
Philip Walls (ubuntu-rabidgeek) wrote :

Sebastien,

Perhaps we can reach a compromise by allowing mounts relative to the user's home directory, but not the home directory itself? This would prevent the specific issue we're reporting here.

Revision history for this message
Philip Walls (ubuntu-rabidgeek) wrote :

Sebastien,

I didn't think of this until after you signed off IRC.

DISCLAIMER: code might crash, I'm not a C/glib guru and haven't tested this specific patch.

You could solve both problems reported at http://bugzilla.gnome.org/show_bug.cgi?id=525866 by doing something like this:

__SNIP__

/* mount_path never has trailing separator, and neither does g_get_home_dir().
    We append a separator to g_get_home_dir() and require mount_path to match
    that prefix. This ensures that /home/user1 doesn't see mounts for /home/user123
    and also that the user's actual homedir doesn't get displayed (only subdirs) */

if (g_str_has_prefix (mount_path, g_strconcat(g_get_home_dir(), G_DIR_SEPARATOR, NULL)))
  return TRUE;

__SNIP__

Also, the comparison for /.gvfs (just above the one we're talking about) is a bit disconcerting, as mounts relative to that path would show up on all users' desktops. Should this instead be:

__SNIP__

if (g_str_has_prefix (mount_path, g_strconcat(g_get_home_dir, G_DIR_SEPARATOR, "/.gvfs/")))
  return TRUE;

__SNIP__

In which case, it would be a bit redundant as these mounts would already be picked up by the other conditional.

Thanks,

-P

Revision history for this message
Philip Walls (ubuntu-rabidgeek) wrote :

Actually, right off the bat.. g_strconcat() allocates heap memory and returns a pointer to the string. Probably necessary to do something like homedir = gstrconcat(g_get_home_dir(), G_DIR_SEPARATOR, NULL) and then free(homedir) when done. Also missing NULL termination in the second __SNIP__ and should have been g_get_home_dir() instead of g_get_home_dir.

-P

Changed in gvfs:
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package glib2.0 - 2.16.2-1ubuntu1

---------------
glib2.0 (2.16.2-1ubuntu1) hardy; urgency=low

  * Sync on Debian
    - use correct versionning (lp: #209308)
  * debian/patches/06_dont_list_userdir.patch:
    - don't list the userdir as a mount, fix nautilus and autofs issues
      (lp: #191512)

 -- Sebastien Bacher <email address hidden> Thu, 03 Apr 2008 22:15:57 +0200

Changed in glib2.0:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.