Mark Valence wrote: > > >Mark Valence wrote: > >> > >> My program loads a shared lib (.so) that then calls pam_start, etc. > >> pam_start succeeds, but when I call pam_authenticate it fails with > >> error "Module is unknown". > >> > >> Same exact code works when linked into the main program (i.e., not in > >> the .so). Is there anything special about using pam from within a > >> .so? > > > >http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pam/Linux-PAM/dynamic/ > >pam.c?rev=1.1&content-type=text/vnd.viewcvs-markup > > > >Feedback appreciated. > > Looks like that would solve the problem, although isn't the crucial > part simply the use of RTLD_GLOBAL|RTLD_NOW as the mode in dlopen? It should work. (My impression is that within certain environments it is not always possible to supply this flag because the dlopen call is hardcoded already to not use it, hence this .so object.) Cheers Andrew