On Sat, 28 Mar 2009, Szabolcs Szakacsits wrote:

> As far as I see, this is a mount(8) bug. Canonicalize_mountpoint should be 
> called before mount(2), not after.

Of course that's not possible because fuse/ntfs-3g already called mount(2).

So mount helpers or/and FUSE should do the realpath and call mount(8) -i 
with it and mount(8) should trust it in such case. Apparently the 
mountpoint passed to mount(8) -i is not canonicalized yet (it's probably 
true for most mount helpers).

Another simple workaround is if we don't wait for the result of mtab 
update. This may or may not cause problems depending on how the mntent 
functions work and other things. Moreover technically it's still incorrect 
mount(8) trying to resolve the mountpoint inside the already mounted file 
system.

Couldn't /etc/mtab be just a symlink to /proc/mounts or one of its 
variants? ;-) Then no need to call /bin/mount -i.

        Szaka

> On Sat, 28 Mar 2009, Pascal Terjan wrote:
> 
> > On Sat, Mar 28, 2009 at 7:09 PM, Szabolcs Szakacsits <sz...@ntfs-3g.org> 
> > wrote:
> > >
> > > On Fri, 27 Mar 2009, Szabolcs Szakacsits wrote:
> > >>
> > >> I forwarded the issue to FUSE development. I'll let you know ASAP when
> > >> there is a solution or suggestion where/how the "mount on a symlink with
> > >> audit turned on for the /etc directory" scenario could be fixed.
> > >
> > > Could you please point us to the util-linux-ng source and all the patches
> > > the relevant Mandriva version applied, or tell us why /etc/mtab update
> > > needs to do a symlink(2) on the mount point?
> > 
> > We use util-linux-ng-2.14.1 + patches on
> > http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/util-linux-ng/current/SOURCES/
> > 
> > It does not call symlink but readlink
> > 
> > The function canonicalize_mountpoint will end up calling a myrealpath
> > function dropping extra /, following symlinks, etc...
> > 
> > http://git.kernel.org/?p=utils/util-linux-ng/util-linux-ng.git;a=blob_plain;f=mount/realpath.c;hb=stable/v2.14

------------------------------------------------------------------------------
_______________________________________________
ntfs-3g-devel mailing list
ntfs-3g-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel

Reply via email to