lkml.org 
[lkml]   [2000]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: bug: mount on an open directory succeeds


On Mon, 6 Mar 2000, Werner Almesberger wrote:

> Alexander Viro wrote:
> > However, it operates on object, not on the name. So valid description is
> > "if result of lookup is a mountpoint you must go upwards", not "if the
> > name of component is the name mountpoint you should go to the root of
> > mounted tree instead of doing lookup".
>
> Ah, I see where the problem is. Don't forget that, according to POSIX,
> "foo" and "./foo" are _identical_.
>
> (Which is interesting - I can imagine that some implementations actually
> read the inode of ".", so if the permissions have changed since the
> chdir, they'd be non-compliant. POSIX normally carefully avoids making
> such strong assertions in similar cases ;-)

Oh? Please, try to do the following:
mkdir /tmp/foo
cd /tmp/foo
chmod a-x .
strace ls . 2>&1|more
and watch for lstat(".") - you will be surprised. Now do
cd /tmp
ls foo
to prove that problem is _not_ in the object - it's lookup complaining
about access permissions. And here we agree with damn next to everything.
I'm too lazy to dig out the Lions Book or build Supnik's emulator and
boot the thing, but I seriously suspect that v6 gave the same behaviour.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.057 / U:1.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site