[OpenAFS-devel] More on the PAM modules, pthreads, and other joys

Russ Allbery rra@stanford.edu
Mon, 15 Aug 2005 08:43:16 -0700


Jeffrey Altman <jaltman@columbia.edu> writes:
> Russ Allbery wrote:

>> Second, the PAM modules wouldn't work properly with the pthread
>> libraries (assertion error in rxkad/rxkad_common.c) because the rxkad
>> thread-specific data was being retrieved before it was initialized.  I
>> tracked this down to ka_UserAuthenticateGeneral and friends never
>> calling rx_Init.
>> 
>> I'm not sure what the best solution to this is.  I have a patch to the
>> PAM modules to make them call rx_Init directly, which I can provide if
>> that's the right approach, but I wasn't sure if perhaps the relevant
>> ka_* functions should handle this somehow under the hood.  Also, I
>> wasn't sure if the patch was of interest, since right now the PAM
>> modules aren't built against the shared pthread-based libraries and
>> therefore don't have this problem in a stock build.

> Modules or applications that make use of rx must call rx_Init().
> Adding rx_Init() to the PAM module is the appropriate thing to do.

Well, the annoying part is that the PAM modules don't *obviously* use rx;
they only call functions that end up calling ka_StringToKey, which calls
the DES libraries, which uses rx thread-specific storage.

But it sounds like it's still the right thing to do, so I can submit the
patch for that change.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>