delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/11/04/17:11:10

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 17:11:10 -0800 :
Message-ID: <3640F5C5.8FF1F3FC.cygnus.cygwin32.developers@cityweb.de>
References: <19981102194431 DOT B25468 AT cygnus DOT com>
Mime-Version: 1.0
To: Christopher Faylor <cgf AT cygnus DOT com>,
"Parker, Ron" <rdparker AT butlermfg DOT org>, cygwin32-developers AT cygnus DOT com

Hello
Chris,
hello Ron,

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019