This is the mail archive of the cygwin 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: Preremove/postinstall scripts fail with snapshot installed

On Feb 12 19:12, Corinna Vinschen wrote:
> On Feb 12 17:44, Corinna Vinschen wrote:
> > On Feb 12 10:31, Ken Brown wrote:
> > > I just did a system restore to undo the last round of Windows
> > > updates, and the problem went away.  I'm not sure where to go from
> > > here.
> > 
> > You're right, I can reproduce it on W7 32 and 64 bit.
> > [...]
> > By installing the security updates again, one by one, I figure out
> > that it is the security update connected to KB 2393802 which triggers
> > the problem.
> > [...]
> Just FYI, I have a working workaround.  It's not exactly how I would
> like to handle this stuff, but at least we know there *is* a solution
> which still maintains the desired ability to delete an in-use directory.

Ok, I think I have a solution now.

A few hours of debugging turned up that the KB 2393802 patch introduces
a change to the layout of the (undocumented) structure in which Windows
stores the CWD starting with Vista.  That's the structure we called
FAST_CWD in Cygwin.  The new layout is sufficiently different that
Cygwin scrambled the contents of the structure from the Win32

Above all, the new structure layout is 4 bytes bigger, because
RtlSetCurrentDirectory_U now also stores some filesystem flags which
RtlGetCurrentDirectory_U uses to find out if the CWD is on a removable
device, and if that device is still available.

If Cygwin scrambled the content effectivly enough, Win32 calls like
CreateProcess could become so confused that they potentially crash with

I just checked in a patch to Cygwin which uses the new structure layout
on systems which already have the KB 2393802 patch installed and the old
structure layout otherwise.

I also uploaded a new Cygwin snapshot to
Please give the today's snapsot a try.  I tested it on Windows 2008 32
bit as well as on W7 32 and 64 bit, with and without KB 2393802
installed.  "It works for me."(TM)

I sure hope that Microsoft does not change the structure layout again
any time soon...


(*) As a side note, what strikes me as weird is the fact that nothing
    at all in the information about KB 2393802(**) points to a
    vulnerability related to the CWD and removable devices.  Somehow
    this change seems to be entirely unrelated to what the MS11-011
    security bulletin is about.  I also inspected all other security
    bulletins from this month, but to no avail.


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

Problem reports:
Unsubscribe info:

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