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

Russ Allbery rra@stanford.edu
Thu, 11 Aug 2005 01:24:21 -0700


I had some time today to work some more on fixing the way the OpenAFS PAM
modules are built for Debian, to try to localize the changes more and
minimize the Debian diff.  That effort was mostly successful, but I ran
into a few oddities.

First, the libafsrpc and libafsauthent shared libraries weren't being
built with -fPIC on most Linux architectures.  Bug #20781 has a patch that
I'll commit if it looks good to someone else as well.

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.

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