FMOUNT(2)

NAME
fmount, funmount - mount or remove file system

SYNOPSIS
int fmount(type, fildes, name, flag)
char *name;

int funmount(name)
char *name;

#include <sys/label.h>

int fmount5(type, fildes, name, flag, ceiling)
char *name;
struct label *ceiling;

DESCRIPTION
Fmount mounts a file system of the named type described by the file descriptor fildes on pathname name. The ceiling label, described under fmount5, is given a default value. Henceforth, references to name (the mount point) will refer to the root file on the newly mounted file system.

Name must already exist. Its old contents are inaccessible while the file system is mounted.

The meaning of flag varies with the file system type.

Allowed types are

0   Regular (block device) file system. Fildes should be a block special file. If flag is nonzero, the file system may not be written on; this must be used with physically write-protected media or errors will occur when access times are updated, even if no explicit write is attempted. The default ceiling label is lattice top with all privileges.

1   Obsolete version of the network file system.

2   Process file system, proc(4). Fildes is ignored.

3   Mounted stream. Fildes must refer to a stream; future calls to open(2) on name will reopen the stream. The mount is undone if the other end of the stream is closed or hung up.

4   Stream (network) file system. Fildes is a stream, whose other end is handled by a file system server, netfs(8). The default ceiling label is lattice bottom with no privileges.

Types 5 and 6 are used internally to close off errors and for pipes; these types may not be mounted.

Fmount5 performs the function of fmount and, on file systems of type 0 or 4, imposes a specified ceiling label. No file in the file system can be accessed - regardless of privilege - unless the label of the file is dominated by the file system ceiling. Moreover, in determining capabilities during exec(2), capability and license bits in the file label are masked by corresponding bits in the ceiling.

Ceilings may be used to limit the labels of data placed in file systems for export to untrusted destinations, and to limit the acquisition of privilege by programs in file systems of untrusted origin.

Funmount removes knowledge of the file system on which name resides. The mount point reverts to its previous interpretation.

Anyone may mount or unmount process file systems (type 3); for other types, these calls are restricted to the super-user. All require capability T_EXTERN; see getplab(2).

SEE ALSO
labmount(2), mount(8)

DIAGNOSTICS
EBADF, EBUSY, EINVAL, EIO, ELAB, ENODEV

BUGS
Although fildes for type 2 file systems is ignored, it must be a valid file descriptor.