muserfs(1)

NAME
muserfs - mount a user process as a filesystem

SYNOPSIS
muserfs [-a] program mount-point [args...]

DESCRIPTION
muserfs is a suid root command which allows normal users to mount processes as filesystems. muserfs does all the validation of the mount point and invokes the mount(2) syscall for a filesystem type of userfs.

The mount will only be allowed if the invoker owns the specified mount-point and it is writable, or if the invoker is the superuser. muserfs will update /etc/mtab with the new filesystem, with details of the invoker, the process and mount flags. The filesystem will always be mounted with the MS_NOSUID and MS_NODEV flags set.

The PATH variable is searched to find program. The process runs with muserfs's invoker's privileges. muserfs waits for the process as it runs. It catches various termination signals and attempts to unmount the filesystem. The filesystem process itself should only terminate on EOF from the kernel. The -a option is ignored unless the invoker is the superuser. It makes muserfs terminate immediately after invoking the process, and superuser must then explicitly use umount(8) to unmount the filesystem.

INVOCATION OF THE FILESYSTEM
The filesystem process is invoked with at least three arguments:

-o n
    Where n is the file descriptor number the process should write to the kernel on.

-i n
    Where n is the file descriptor to read kernel requests from.

-m mpoint
    Where mpoint is the path of the mountpoint.

These arguments are followed by any arguments for the filesystem specified to muserfs .

CAVEATS
If any part of the mounted filesystem is in use (either because a file is open, a process has a current directory in the filesystem or because a directory in the filesystem is a mountpoint) the filesystem cannot be unmounted. Use fuser(8) to find processes which are using a filesystem.

A filesystem that is a mounted process is completely under the control of the process. No assumptions at all can be made about the filesystem under the mount point. For example, normal expectations about the behaviours of simple things like . and .. do not apply. It is never a good idea to run any root privilege command in an untrusted userfs filesystem.

BUGS
If the filesystem doesn't get through the earliest stages of the mount protocol (for example the program given can't be found), then the mountpoint goes into an odd state and can neither be unmounted or mounted on again. /etc/mtab is left with the filesystem which failed to mount in it.

There is no way for users to unmount their own filesystems if muserfs dies unexpectedly.

AUTHOR
Jeremy Fitzhardinge <jeremy@sw.oz.au>

SEE ALSO
mount(2), mount(8), umount(8), mtab(5), fuser(8).