On Thu, Jan 10, 2008 at 07:07:54PM +0100, Josselin Mouette wrote: > > I've been unable to find in Nautilus documentation what criteria does it use > > to present volumes in the user's Desktop and how to adjust that criteria to > > suit my needs. > > The exclusion list is hardcoded in gnome-vfs and based on the FHS v2.3.
Do you mean this? gnome-vfs-2.20.1/libgnomevfs/gnome-vfs-hal-mounts.c: 628 const char *fhs23_toplevel_mount_points[] = { 629 "/", 630 "/bin", 631 "/boot", 632 "/dev", 633 "/etc", 634 "/home", 635 "/lib", 636 "/lib64", 637 "/media", 638 "/mnt", 639 "/opt", 640 "/root", 641 "/sbin", 642 "/srv", 643 "/tmp", 644 "/usr", 645 "/var", 646 "/proc", 647 "/sbin", 648 NULL 649 }; The way it is implemented, the exclusion list fails to exclude filesystems that are mounted under those that it hides (in my situation /home/mirrors under /home, which is excluded). Is this a bug? Maybe it should be changed (line 694): if (strcmp (mount_point, fhs23_toplevel_mount_points[i]) == 0) to if (strncmp (mount_point, fhs23_toplevel_mount_points[i], sizeof(fhs23_toplevel_mount_points[i])) == 0) so that it would exclude both '/home/' and any filesystems mounted under '/home'? This is just an example, it should be more elaborate since the above code can lead to false positives as it would also exclude the '/home_company' filesystem (which would not mounted underneath '/home'). It wouldn't be too difficult to implement a patch for this feature (hide a system volume and all volumes underneath it). Should I do it? You say that Nautilus only blacklists from a hardcoded list but, actually, reading that code I see it calls libhal_volume_should_ignore() to explicitly ignore volumes. It seems that if a volume has the property "volume.ignore" defined in HAL it is not presented. So it actually seems that the sysadmin could adjust the configuration files under /etc/hal/fdi to explicitly tell nautilus to ignore a volume. After tinkering a bit I've found that I can drop a file to /etc/hal/fdi/policy/ (I named it 'ignore.fdi') for HAL to parse: ------------------------------------------------------------------- <?xml version="1.0" encoding="UTF-8"?> <!-- -*- SGML -*- --> <deviceinfo version="0.2"> <device> <match key="block.is_volume" bool="true"> <match key="volume.fstype" string="ext3"> <merge key="volume.ignore" type="bool">true</merge> </match> </match> </device> </deviceinfo> ------------------------------------------------------------------- This file tells HAL to set the 'ignore' flag on any ext3 filesystems it find. This effectively solves my problem with Nautilus as all the volumes I don't want my users to see are ext3. I have confirmed through 'lshal' (which I just found about) and through nautilus that introducing this file and restarting hal is sufficient for my needs. However, as I've said before, it shouldn't be so difficult (a user shouldn't need to parse the code) to find this out. It should be written somewhere. > > Could this behaviour please be documented somewhere? > > It could, but I???m not sure where to put it so that people interested in > it will find it. It should be in Nautilus "Help" documentation (as the manpage is very brief). That's where I tried to look for it first. Other options would be GNOME's System Admistrators Guide, maybe under the 'lockdown' section. Since this is actually limiting what users "see" of the system underneath from their Desktops. Regards Javier
signature.asc
Description: Digital signature