Patch to allow trailing dots on managed mounts
Christopher Faylor
cgf-no-personal-reply-please@cygwin.com
Mon Dec 20 15:16:00 GMT 2004
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.
>> 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?
else if (src[2] && !isslash (src[2]))
{
if (src[2] == '.')
{
/* Is this a run of dots? That would be an invalid
filename. A bunch of leading dots would be ok,
though. */
int n = strspn (src, ".");
if (!src[n] || isslash (src[n])) /* just dots... */
return ENOENT;
}
break;
cgf
More information about the Cygwin-patches
mailing list