[2424] in Kerberos_V5_Development
Re: Kerberos V4 Re-entrancy Question and a Solaris threaded server.
daemon@ATHENA.MIT.EDU (Marc Horowitz)
Wed Jul 9 22:30:09 1997
To: jdj@busstop.jpl.nasa.gov (Jeffery D. Jacobson)
Cc: epeisach@MIT.EDU, krbdev@MIT.EDU, tytso@MIT.EDU
From: Marc Horowitz <marc@cygnus.com>
Date: 09 Jul 1997 22:29:49 -0400
In-Reply-To: jdj@busstop.jpl.nasa.gov's message of Wed, 9 Jul 1997 19:21:58 -0700
jdj@busstop.jpl.nasa.gov (Jeffery D. Jacobson) writes:
>> Thanks for you're quick reply. The code is calling rd_req, getting
>> the service key from the default srvtab! krb_set_key will work for
>> me. I'll make that change. There is no reason to go to srvtab each
>> time. That'll take care of the service-key MT unsafe problem. But, I
>> notice int the rd_req () code:
>>
>> static int swap_bytes; /* Need to swap bytes? */
>> static int mutual; /* Mutual authentication requested? */
>> static unsigned char s_kvno;/* Version number of the server's key
>>
>> .
>> .
>> .
>> /* byte order */
>> swap_bytes = 0;
>> if ((*ptr & 1) != HOST_BYTE_ORDER)
>> swap_bytes++;
>>
>> /* check msg type */
>> mutual = 0;
>> switch (*ptr++ & ~1)
What version of krb4 are you using? The version I'm looking at (CNS)
has those three variables as automatic within krb_rd_req, not as
static variables. The code itself looks the same as what I have.
Given that the first thing done with each variable is to assign to it,
there doesn't seem to be any reason to make them static. Rather than
mutexing the function, simply making these variables automatic in your
sources is probably sufficient.
Marc