Mail Archives: cygwin-developers/1998/11/04/19:10:19
Hello Chris, hello Ron,
sorry for the fantastic line wrapping :-(
Christopher Faylor wrote:
>
> Corinna, do you agree with this change?
>
> cgf
>
> ----- Forwarded message from "Parker, Ron" <rdparker AT butlermfg DOT org>
> [...]
> + if (pathbuf[mount[i].pathlen] != '/' &&
> + strncmp (mount[i].device, "\\\\.\\", 4) == 0 &&
> + strchr(mount[i].device[mount[i].devicelen-1] + 4, '\\'))
> [...]
The above patch is incorrect, the strchr crashes:
mount[i].device[foo] is last char in ...device
.... + 4 is the same char + 4 (e.g. 'E' instead of 'A')
--> 1st parameter to strchr is illegal ptr value.
I think, the following is ment:
+ if (pathbuf[mount[i].pathlen] != '/' &&
+ !(strncmp (mount[i].device, "\\\\.\\", 4) == 0 &&
+ strchr (mount[i].device + 4, '\\') == NULL))
Checks, if the device path has an additional `\' in it.
Another theme is: Do such UNC paths exist???
As I know, only the following device paths exist:
\\.\X:
\\.\physicaldriveX
\\.\tapeX
\\.\mailslot\foo\bar...
\\.\pipe\pipename
Ordinary UNC paths are never beginning with \\.\, but with \\foo\...
with the exception of wide character syntax in WinNT. Then, paths are
beginning with \\?\X:\ on standard paths with drive letter and \\?\UNC\
on UNC paths.
If the above presentation is correct, my original patch is also correct.
If I'm wrong, I would appreciate, if somebody could explain the meaning
of \\.\UNC\
Regards,
Corinna
- Raw text -