Re: About /etc/mtab and /proc/mounts

DervishD
2003-03-04T11:05:29Z

Hi Kasper and J.W. :)

Kasper Dupont dixit:
> As long as these options is not yet stored in the kernel, we
> need /etc/mtab. The question is how to get them into the kernel.

That was my first question. Certainly there should be a way to
tell the kernel those options, but... Do we really need them. As you
said, those options (the user options) are used by mount itself, so
the kernel doesn't need to know them. If we are concerned by the
'user' option, that allows normal users to mount and umount
filesystems, and that option is not in the syscall, I think that it
should be done with other approach. See below.

> Before we can get rid of /etc/mtab we need to agree on how
> to solve those problems. There might be other cases I don't
> know about, where /etc/mtab contains special values.

In the case of normal users mounting and umounting filesystems,
this could be done throught the use of capabilities, I think. And
surely better methods exist. If we could tell the kernel that some
user 'a' mounted filesystem 'f', then at umount time the umount
syscall will only success if root or 'a' umounts 'f'. The question is
if we can tell it to the kernel. The mount syscall maybe? Maybe a VFS
flag just for this purpose (that seems to be very important). Other
user flats like the permissions, etc... are merely informative and
that info is present in /etc/fstab anyway (usually).

The loopback issue is more a problem of consistency, I think.

Raúl