[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AANLkTilxrhVzQcHGY1fsUenOSjjh3CkIeqoN_PnSbnBa@mail.gmail.com>
Date: Thu, 8 Jul 2010 13:37:40 +0200
From: Robert Święcki <robert@...ecki.net>
To: full-disclosure@...ts.grok.org.uk
Subject: Re: Windows XP bug
> But, there is difference with evaluation/calculation in windows and linux.
> Here is how...
It rather depends on where the path evaluation takes place - kernel vs
userland. It might also depend on whether 'cd' checks explicitly for
existence of path elements (bash's cd does)
> one@...ntubox:~$ cd thisdoesntexist/
> -bash: cd: thisdoesntexist: No such file or directory
> one@...ntubox:~$ cd thisdoesntexist/../
> -bash: cd: thisdoesntexist/../: No such file or directory
> one@...ntubox:~$
$ pwd
/tmp
$ ln -s /usr/share a
$ cd a/..
$ pwd
/tmp
$ cd -P a/..
$ pwd
/usr
syscall trace for the case 1.
chdir("/tmp") (path is being resolved in userland)
for the case 2.
chdir("a/..") (path is being resolved in kernel)
PS. While we are at this subject: if you ever dreamt of
non-shell-built-in 'cd' command, I recommend checking out this one -
http://www.swiecki.net/red/progs/extcd.c
--
Robert Święcki
_______________________________________________
Full-Disclosure - We believe in it.
Charter: http://lists.grok.org.uk/full-disclosure-charter.html
Hosted and sponsored by Secunia - http://secunia.com/
Powered by blists - more mailing lists