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]: mkdir -p and network drives


At 06:19 PM 5/9/2005 +0000, Eric Blake wrote:

>Second, the sequence chdir("//"), mkdir("machine") creates machine in the 
>current directory.

Old bug. 
chdir("/proc"), mkdir("machine") produces the same result.
And mkdir("/proc"), mkdir("/proc/machine") creates c:\proc\machine

The fix sets errno to EROFS, which is what rmdir is already doing.
Is that OK for coreutils?

Pierre
   
2005-05-10  Pierre Humblet <pierre.humblet@ieee.org>

	* dir.cc (isrofs): New function.
	(mkdir): Use isrofs.
	(rmdir): Ditto.


Index: dir.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/dir.cc,v
retrieving revision 1.84
diff -r1.84 dir.cc
218a219,225
> inline bool 
> isrofs(DWORD devn) 
> {
>   return devn == FH_PROC || devn == FH_REGISTRY 
>     || devn == FH_PROCESS || devn == FH_NETDRIVE;
> }
> 
233a241,245
>   else if (isrofs (real_dir.get_devn ()))
>     {
>       set_errno (EROFS);
>       goto done;
>     }
266d277
<   DWORD devn;
272,273c283
<   else if ((devn = real_dir.get_devn ()) == FH_PROC || devn == FH_REGISTRY
<          || devn == FH_PROCESS)
---
>   else if (isrofs (real_dir.get_devn ()))


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