tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: misuse of pathnames in rump (and portalfs?)



On Wed, Nov 24, 2010 at 06:19:50PM +0000, David Laight wrote:
 > > First, background: VOP_LOOKUP is the per-fs vnode operation that takes
 > > a directory and a name and returns the vnode associated with that
 > > name. This currently has a horrific interface and the chief goal of
 > > the namei cleanup is to rectify this so all it needs is a vnode and a
 > > string.
 > 
 > Presuably also some flags - NOFOLLOW etc ....

no, it shouldn't need any flags (particularly not NOFOLLOW...)

 > One thing I have wondered (which might be related to what rump
 > expects) is whether namei could perform 'realpath' as part of its
 > processing - at least optionally?

Yes, it already is supposed to but doesn't quite. There's a
compat_svr4 syscall that needs to do this, plus we want this behavior
in exec for the ELF $ORIGIN thing.

 > At least as far as following symlinks and following "/../", the final
 > path might still be relative (and thus start with ../).

Right. But if you want a guaranteed absolute path you should be able
to do it by calling getcwd first. This is not that hard though -- the
output should be stored into a separate buffer, and if one preseeds
this buffer with the getcwd result it should more or less
automatically DTRT.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index