written by Radovan Garabik 
e-mail: garabik@kassiopeia.juls.savba.sk


mountpy is a python script for quick automatic mounting and umounting of
external filesystems, especially suited for USB removable devices.
mountpy is developped on linux, and is meant for modern linux systems.
However, there is not much code linux-specific, so in theory it could
work on any POSIX system with similar semantics of setuid(2), you just
have to modify mount options.

Motivation: I successfully converted several computer illiterate users
to linux. While they are perfectly content and willing to learn to write
a command before accessing an external filesystem,  and an another
command before removing the device, removable USB mass storage devices
bring a lot of variety - some of them have partition table, some of them
have not, they appear as different sd? devices, keeping /etc/fstab
updated is difficult, and users have problems finding out the correct
device (oce it is /dev/sda, the other time, with the same USB key,
/dev/sdb...).

This script tries to mount everything it can, probing all configured
devices with all possible filesystems, and creating mountpoints as needed.


Instalation:
make && make install
edit /etc/mountpy.conf to suit your needs

Usage:
mountpy is a C-wrapper that calls mountpy.py. For correct usage, it has
to be installed setuid root. You can use mountpy.py directly, but you
have to be root for that (is there a way to find out user who executed
su? this could eliminate having the script setuid in some circumstances)

use:
$ mountpy
to mount all the devices. Short summary will be printed. By default, you 
can find mounted filesystems under /media
use:
$ mountpy -u
or
$ umountpy
to umount everything it can. Short summary will be printed, with warning if some device
could not have been umounted

$ mountpy device
tries to mount only one device, e.g.:
$ mountpy sda
$ mountpy sda fd0 cdrom

use -v to verbosely print what is going on, -vv to get even more information.



Security:
Do not install mountpy on servers with multiuser access! It has no use
in such an envirnment, anyway. While there is nothing directly
exploitable, it is easy to trick python into executing something other 
(by modifying PYTHONPATH, for example). It is perfectly suited for a
workstation or a notebook, if a user already knows the root password, or
in similar circumstances.

Special care has beed taken to avoid accidentally removing directories
during umount, so the script should be safe. Of course, bugs are always
possible. Using broken hardware (bad floppy, cdrom, USB key) can hang
the program, or even crash the kernel, as with ordinary mount.
