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

Corinna Vinschen corinna-cygwin@cygwin.com
Wed Aug 11 15:26:00 GMT 2010


On Aug 11 17:17, Corinna Vinschen wrote:
> On Aug 11 16:07, Andy Koppe wrote:
> > On 11 August 2010 15:50, Corinna Vinschen wrote:
> > >> >  3) If SetCurrentDirectory fails, call
> > >> >
> > >> >       SetCurrentDirectory (GetSystemDirectory ())
> > >> >
> > >> >    That's basically what CMD.EXE does if it can't handle the current
> > >> >    CWD at startup.  You can easily test that by setting the CWD to a
> > >> >    network UNC path and start CMD.EXE.
> > >> >
> > >> > I think option 3) is what we should use, but I'm open to other
> > >> > suggestions.
> > >>
> > >> I agree with approach 3, but could we send it somewhere safer? Ideally
> > >> somewhere that isn't writable. I'm concerned about the damage that a
> > >> process that thinks it's elsewhere could do to the system32 directory.
> > >
> > > Where is "somewhere safer"?  I mean, even CMD.EXE uses it as fallback.
> > > What about Cygwin's root dir?
> > 
> > GetTempPath()?
> 
> Good idea!

Erm... hang on.  The GetTempPath function uses what it finds in the
environment.  Since the Win32 environment in a Cygwin application
is crippled, the function will always return "C:\Windows\".

Maybe we should use Cygwin's /tmp, but that requires another path
conversion which I'd rather avoid in chdir...


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat



More information about the Cygwin-developers mailing list