From: corinna DOT vinschen AT cityweb DOT de (Corinna Vinschen) Subject: Re: [rdparker AT butlermfg DOT org: RE: B20 patch: UNC device path handling] 4 Nov 1998 19:10:19 -0800 Message-ID: <36410720.1DD9EBE9.cygnus.cygwin32.developers@cityweb.de> References: <19981102194431 DOT B25468 AT cygnus DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Christopher Faylor , "Parker, Ron" , cygwin32-developers AT cygnus DOT com 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" > [...] > + 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