Re: uid of user who mounts

From: Steve French
Date: Sat Jul 31 2004 - 12:51:57 EST


On Sat, 2004-07-31 at 19:31 +0200, Miklos Szeredi wrote:
> Steve French wrote:
> >
> > I confirmed what Randy had mantioned about the user= entries in mtab
> > allowing umounts (at least it works that way for a few of the local
> > filesystems I tried) but did not seem to work so well on other
> > filesystems - I had odd results on umounting my cifs mounts e.g. - after
> > adding at mount time "user=someuser" to /etc/mtab (by a minor change to
> > the mount helper mount.cifs.c, when running mount.cifs suid). umount of
> > those mounts failed
>
> I've seen failure to unmount only if there is no matching entry in
> /etc/fstab. It sounds a bit too much paranoia, but who knows.
>
> Miklos

This is getting hard to debug because the mount and umount that ship
with Fedora doesn't match the behavior of mount & umount current source
on kernel.org for the mount utils. What I have discovered so far is
that the failure in unmount is the check in sys_umount in fs/namespace.c

if (!capable(CAP_SYS_ADMIN))

which fails presumably because mount did not find a match in /etc/fstab
although I have tried various experiments and it looks like the umount
should have matched the /etc/mtab entry. My guess is that the matching
rules don't work very well for filesystems unless they specify either a
physical device or name (I had been specifying a UNC name as the device,
but am experimenting with having cifs use the nfs server:export format
to see if that will make umount happier).

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/