[Date Prev][Date Next] [Chronological] [Thread] [Top]

Binary vs. Shared Objects


My question is regarding the two api calls listed above. I have made two items, one is a regular search program designed to filter out everything except fields I need. and the other is a shared object, or pam module.

The application called from ./search works fine, initializes, binds, searches and retrives values. I attempt the same thing in a shared object compiled with the -lpam option and the ldap_simple_bind() & ldap_simple_bind_s() api calls fail everytime.

For a ldap_simple_bind() calls I do the following:

if( ldap_simple_bind( ld, "username", "password" ) != 0 ) {
_log_err( LOG_WARN, "Bind successful" );

For a ldap_simple_bind_s() call I do the following:

if( ldap_simple_bind_s( ld, "username", "password" ) == LDAP_SUCCESS ) {
_log_err( LOG_WARN, "Bind successful" );

In both cases if I compile it as a shared object with the following compile commands it fails:

gcc -fPIC -o pam_ldap.o -c pam_ldap.c
ld -x --shared -o pam_ldap.so -lpam -lldap

Any help, pointers etc. is appreciated as I have scoured the ldap man pages and found nothing on this, as well as the SDK pages from netscape.

Jason Gerfen
Student Computing Group
Marriott Library
University of Utah
(801) 585-9810

"...Sometimes I just yell at myself. And it
makes me sad, sometimes I make myself cry..."
			~ My nephew Dawsyn