[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: dlopen() failing in pam_start (HELP!)



mpg4@paradise.duluoz.net wrote:
> 
>     Sorry if this comes through twice, I had a mailer problem...
> 
>     I'm writing a program, randpass, that creates a random password for
>  an account, and then sets the password using PAM. I have no
>  compilation problems, but at runtime I either get a segfault

I've seen this segfault too. However, every attempt I have made to
narrow it down leads to the problem disappearing. My experience is that
it segfaults _after_ I enter the current password, but _before_ I enter
a new one. Is this consistent with your experience?

>  (dynamically linked libs) or an error 28 "Module is unknown" (static
>  libs) from somewhere inside pam_chauthtok.

>     I've discovered that the dlopen() call in _pam_add_handler is
>  failing with this error "/usr/lib/security/pam_pwdb.so: undefined
>  symbol: pam_get_item".

This is generally the problem when libpam has been linked statically,
and so the functions in libpam are not available to the dynamic linker
when a module that uses them loads it. I think the fix is to link your
application with '-r' and cross your fingers. In general, you really
should try to avoid linking statically.

Hope that helps. I also hope someone can work out what is causing this
segfault!

Cheers

Andrew



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []