HELP!! how to prevent floppy mounts under Hardy/LTS

Marc Gariépy gariepy.marc at gmail.com
Tue Sep 22 03:22:05 BST 2009


john wrote:
> Hi all,
>
> We're having a problem with lots of floppy icons showing up on users
> desktops. Basically whenever a user logs on from a computer with a
> floppy drive built in it is automagically mounted and shows up on ALL
> users desktops. The links never go away and they accumulate as other
> users log on and off of those computers. Users cannot delete the
> links.
>
> The floppy icons have dynamically generated entries in
> ~/.nautilus/metafiles/x-nautilus-desktop
>
> it looks like this.
>
> vbuntu:~/.nautilus/metafiles$ cat x-nautilus-desktop\:%2F%2F%2F.xml
> <?xml version="1.0"?>
> <directory><file name="floppy0.volume.4" timestamp="1253553871"
> icon_position="64,22"/><file name="floppy0.volume.3"
> timestamp="1253553871" icon_position="64,102"/><file
> name="floppy0.volume.2" timestamp="1253553871"
> icon_position="64,182"/><file name="floppy0.volume"
> timestamp="1253553871" icon_position="64,262"/></directory>
>
> Deleting the xml file has no effect on the links.
>
> The floppys have a mount point in /media under the usersname it might
> look something like this.
>
> /media/doe.john/floppy0
>
> ls is not allowed to list ownership/permissions even by root
>
>  ls -la
> ls: cannot access floppy0: Permission denied
> total 8
> drwxr-x---  3 root domain users 4096 2009-09-21 08:56 .
> drwxr-xr-x 34 root root         4096 2009-09-21 10:37 ..
> d?????????  ? ?    ?               ?                ? floppy0
>
> the only way to see the correct permissions and remove this is to do:
>
> umount -fl floppy0
>
> which then lets you do ls:
>
>  ls -la
> total 12
> drwxr-x---  3 root domain users 4096 2009-09-21 08:56 .
> drwxr-xr-x 34 root root         4096 2009-09-21 10:37 ..
> drwxr-x---  2 root domain users 4096 2009-09-21 08:56 floppy0
>
> then root can do rmdir floppy0
>
> I guess I'd like an explanation of what the heck is going on and then
> hopefully some advice about
> how to tell gvfs or whatever is mounting floppies to stop.
>
> thanks!
>
> John
>
>   
Hi John,

To fix your problem you need to add a script to fix perm of the /media/$USER because your user all belong to the same group.


* Install perl-suid on the server

then create a script in /etc/ltspfs/mounter.d (you may have to create that
directory) on the application server
and a script called fixperm inside it, containing:
== cut here ==
#!/usr/bin/perl
if ( $ARGV[0] eq 'add' ) {
	$ENV{'PATH'} = '/bin:/usr/bin';
	$user=getpwuid($<);
	system "chown", "$user.root","//media//$user";
}
== cut here ==
then you have to set permission 4755 on that script

Marc






More information about the edubuntu-users mailing list