src/winsup/cygwin ChangeLog autolo ...

egor duda
Thu May 3 04:30:00 GMT 2001


Thursday, 03 May, 2001 Corinna Vinschen wrote:

CV> On Thu, May 03, 2001 at 01:06:08PM +0200, Corinna Vinschen wrote:
>> On Thu, May 03, 2001 at 02:00:17PM +0400, egor duda wrote:
>> > cscc>         * (wsock_init): Add guard variable handling. Take care
>> > cscc>         to call WSAStartup only once. Load WSAStartup without using
>> > cscc>         autoload wrapper to eliminate recursion.  Eliminate FIONBIO
>> > cscc>         and srandom stuff.
>> > 
>> > actually, srandom stuff was calles purposively in wsock_init. it's
>> > supposed to make secret cookies for AF_UNIX sockets random. i know
>> > that calling srandom() isn't the best way to assure this, but it's
>> > better than nothing. I'll probably replace newlib's random to calls to
>> > windows crypto-api, but until then, i think, srandom should be called
>> > during init.
>> Calling srandom isn't correct since the random number generator
>> has to be initialized with a seed of 1 by default. Calling
>> srandom inside of Cygwin destroys that behaviour, unfortunately.

you're right. i've missed this.

CV> Couldn't you use an instance of fhandler_dev_random?

i can. the only thing that worries me i that CryptGenRandom() may block
for unpredictable and random amount of time.

Egor.   ICQ 5165414 FidoNet 2:5020/496.19

More information about the Cygwin-patches mailing list