1.7.5: Occasional failure of CreatePipe or signal handing due to thread-unsafe code in cwdstuff::set

Christopher Faylor cgf-use-the-mailinglist-please@cygwin.com
Thu Aug 12 16:14:00 GMT 2010

On Thu, Aug 12, 2010 at 06:07:27PM +0200, Corinna Vinschen wrote:
>On Aug 12 11:51, Christopher Faylor wrote:
>> On Thu, Aug 12, 2010 at 04:48:48PM +0200, Corinna Vinschen wrote:
>> >On Aug 12 16:38, Corinna Vinschen wrote:
>> >> On Aug 12 10:12, Christopher Faylor wrote:
>> >> > I've done some googling but I can't find an answer to this: Is it
>> >> > possible to create a directory which can't be written to - even by a
>> >> > privileged user?
>> >> 
>> >> No.  I never came across a directory which is not writable under
>> >> SE_BACKUP_NAME conditions.
>> >
>> >What if we create a subdirectory like C:/cygwin/.for_win32_only
>> >for exactly this one single purpose, to redirect any relative
>> >Win32 calls there?
>> I guess that would be an acceptable compromise if the below doesn't past
>> muster:
>> On XP, at least, we could set the current directory to '//?/PIPE'.
>> That causes CreateFile to fail.  I used the program below to test
>> that.
>>   sh-3.2$ ./setdir '//?/PIPE'
>>   SetCurrentDirectory succeeded
>>   CreateFile failed, 123
>> I'll try that on other systems to see if it still behaves predictably.
>Works fine on W7 if you specify \\?\PIPE\, with the trailing backslash.
>Without trailing backslash it fails:
> $ ./setdir '\\?\PIPE'
> SetCurrentDirectory faile, 123
> $ ./setdir '\\?\PIPE\'
> CreateFile failed, 2
>That sounds like a neat solution.  I would never have expected that
>SetCurrentDirectory works for the pipe FS.

Thanks for testing.  As is always the case, I've just found that my
virtual machines have all stopped working so I couldn't quickly test
this myself.  I'm rebuilding my kernel now.  Then I'll find that a bunch
of other stuff has broken.  Then I'll rebuild that.  So, sometime
mid-next-week I'll be able to actually try this myself.

Btw, I found this by stepping through the //?/Global??/ namespace
as shown by the sysinternals Winobj utility.


More information about the Cygwin-developers mailing list