Re: UTF-8 practically vs. theoretically in the VFS API (was: Re: JFS default behavior)

From: Jamie Lokier
Date: Tue Feb 17 2004 - 16:26:33 EST


Linus Torvalds wrote:
> > 1. Eliminate "." and ".." components, leaving only leading ".."s.
>
> Who does this anyway? It's wrong. It gives the wrong answer if there was a
> symlink somewhere.

It's wrong for GCC, but correct for HTML/XLink relative path
resolution.

> > O_NODOTDOT won't protect against that.
>
> Ok, so explain why? O_NODOTDOT will certainly guarantee that it stays
> inside "/var/public/files", since it has no way to escape (modulo
> symlinks/mounts, of course).

Oh, I meant to say "will" but my mailer must have used the wrong
character encoding. :)

> O_NOMOUNT may actually become a good idea.

Right now, you can avoid crossing filesystems by calling lstat()
_except_ that it doesn't detect a bind mount. Among other things,
this makes it difficult to know for sure when there is only one path
to a file, because n_link==1 doesn't mean that any more. O_NOMOUNT
might be useful as a way to detect when you're crossing a bind mount.

-- Jamie
-
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/