Re: uid of user who mounts

From: Steve French (smfrench_at_austin.rr.com)
Date: 07/31/04

  • Next message: David Brownell: "Re: Solving suspend-level confusion"
    To: Miklos Szeredi <miklos@szeredi.hu>
    Date:	Sat, 31 Jul 2004 12:49:45 -0500
    
    

    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@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: David Brownell: "Re: Solving suspend-level confusion"

    Relevant Pages

    • Re: uid of user who mounts
      ... > built version of umount via ddd (although it is clearly not making it ... Mount is suid and does certain things in a certain way. ... For filesystems that have their own private mount program, ...
      (Linux-Kernel)
    • Re: uid of user who mounts
      ... That is an interesting patch. ... filesystems - I had odd results on umounting my cifs mounts e.g. - after ... the mount helper mount.cifs.c, when running mount.cifs suid). ... built version of umount via ddd (although it is clearly not making it ...
      (Linux-Kernel)
    • Re: How to make mount command mount partions as user not only as root ?
      ... umount certain filesystems. ... 'Only root can do that' ... Only root is allowed to pass parameters to mount. ...
      (comp.os.linux.hardware)
    • Re: -mm -> 2.6.13 merge status (fuse)
      ... Miklos Szeredi wrote: ... >> System where users can mount their own filesystems should not be ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Unable to unmount idle filesystem on 6.2
      ... devfs on /dev ... # umount -f /usr/ports ... # mount -o ro /usr/ports ... The filesystem was mounted read-only, then upgraded to rw so I could update the ports tree. ...
      (freebsd-questions)