This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch to allow trailing dots on managed mounts


Christopher Faylor wrote:
> 
> On Mon, Dec 20, 2004 at 11:23:29AM +0100, Corinna Vinschen wrote:
> >On Dec 19 21:57, Pierre A. Humblet wrote:
> >> At 09:44 PM 12/18/2004 -0500, Christopher Faylor wrote:
> >> >
> >> >For now, I'm disallowing all use of '.\' and ' \' in a path.  It seems
> >> >more consistent to disallow everything than to allow some stuff.  I
> >> >didn't change the symlink code to disallow "ln -s foo bar..."  If someone
> >> >actually complains about this, maybe I will.
> >> >
> >> >So, "ls /bin........." works, "ls /bin./pwd.exe" doesn't work and "ls
> >> >/cygwin/c/cygwin/bin./pwd.exe" doesn't work either.  Nor does
> >> >"ls c:\cygwin\bin.\pwd.exe".  I don't know if we'll hear complaints about
> >> >this one or not.
> >
> >I guess we will.  The trailing dots are not removed from the POSIX path
> >in case of chdir, but the chdir itself succeeds.  That leads to an
> >unexpected result:
> >
> >$ cd /bin...
> >$ pwd
> >/bin...                <- This was printed as /bin before
> >$ ls sh.exe
> >ls: sh.exe: No such file or directory
> >
> >In terms of consistancy it should be impossible to chdir already,
> >shouldn't it?
> 
> If we're allowing trailing dots then I guess we should strip them from the
> posix path as well as the windows path.

chdir should be the only case where this matters.
We can either disallow it, or strip the tail.
I prefer the latter.

Stripping from the Posix path can't be done during normalize_
because it would apply to all paths (not only disk).

It's easy to fix posix_cwd at the end of cwdstuff::set, 
only in the case where "doit" is true.
We should also strip win32_cwd there because it will be used
to build an absolute path in normalize_win32_path.

> >> Do you intent to remove the dot checking code in normalize_xxx_path?
> >> It now seems to be useless and even counterproductive.
> >
> >AFAICS, this code could go.
> 
> We're talking about this code, right?

Right.

Pierre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]