Util-Linux package development
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Miklos Szeredi <mszeredi@suse.cz>
Cc: Petr Uzel <petr.uzel@suse.cz>, util-linux <util-linux@vger.kernel.org>
Subject: Re: [PATCH] umount: allow non-root umount of FUSE even if not in fstab
Date: Tue, 29 Mar 2011 12:13:09 +0200	[thread overview]
Message-ID: <20110329101309.GB2475@nb.net.home> (raw)
In-Reply-To: <1301388524.22846.86.camel@tucsk.pomaz.szeredi.hu>

On Tue, Mar 29, 2011 at 10:48:44AM +0200, Miklos Szeredi wrote:
> On Tue, 2011-03-29 at 10:28 +0200, Karel Zak wrote:
> > On Mon, Mar 28, 2011 at 04:23:20PM +0200, Miklos Szeredi wrote:
> > > On Mon, 2011-03-28 at 16:04 +0200, Petr Uzel wrote:
> > > > Hi all,
> > > > 
> > > > I hacked the following patch with which it is possible to use 
> > > > "umount $dir" instead of "fusermount -u $dir", which IMHO is an
> > > > improvement in usability. It seems to work (at least for me), however,
> > > > I have to admit that I don't like it very much, because:
> > > > - it complicates umount
> > > > - duplicates code from fusermount
> > > 
> > > And this is not the only one that would have to be duplicated.  The
> > > mount and umount races that were fixed in fusermount in recently and not
> > > so recently would also have to be added to util-linux, which would
> > > actually be a good thing, since in theory they could affect fstab based
> > > user mounts as well (though that is much more unlikely than with fuse,
> > > where the user chooses the mountpoint).
> > 
> >  Maybe we need to call umount2() with UMOUNT_NOFOLLOW flag for
> >  non-root users in umount(8). I think it should be enough for
> >  umount(8) (where almost all is controlled by system admin in fstab). 
> >  
> >  See below. Comments?
> 
> UMOUNT_NOFOLLOW is a good idea but not enough, it will only deal with
> last path component changing to a symlink.  If previous path component
> is changed then UMOUNT_NOFOLLOW will not have any effect.
> 
> What fusermount does is change cwd to the parent directory, check if cwd
> matches that of the intended path, and then umount with UMOUNT_NOFOLLOW.

Ah.. I see the code. Thanks.

It would be nice to have

        mountat(dirfd, ...)
        umountat(dirfd, ...)

syscalls to avoid any races :-)

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

  reply	other threads:[~2011-03-29 10:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-28 14:04 [PATCH] umount: allow non-root umount of FUSE even if not in fstab Petr Uzel
2011-03-28 14:23 ` Miklos Szeredi
2011-03-29  8:08   ` Petr Uzel
2011-03-29  8:28   ` Karel Zak
2011-03-29  8:48     ` Miklos Szeredi
2011-03-29 10:13       ` Karel Zak [this message]
2011-03-28 22:03 ` Karel Zak
2011-03-29  8:46   ` Petr Uzel
2011-03-29  8:51     ` Miklos Szeredi
2011-03-29  8:56       ` Petr Uzel
2011-03-29 10:03         ` Karel Zak
2011-03-29 10:36     ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110329101309.GB2475@nb.net.home \
    --to=kzak@redhat.com \
    --cc=mszeredi@suse.cz \
    --cc=petr.uzel@suse.cz \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox