Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using Linux PAM with static library like pthread

7 views
Skip to first unread message

Mathieu Marty

unread,
May 26, 2003, 12:59:26 PM5/26/03
to
I want to create a new PAM module for Linux RedHat 9(that use external
devices) and I have some troubles when I want to load libraries in
static or dynamic mode. (For example pthread).
I'm connected root. I try to make the following command:
su - <username>

If the pam library is not linked with -lpthread option, the command
succeeds. If it is linked with, the su command makes nothing and I
need to make a <CTRL>+C to unlock the XTerm.

I obtain the same think if I make a dynamic load of a library. You can
find enclosed my makefile. Any suggestion about this would be greatly
appreciated.
Thanks

Mathieu

#
# Makefile pour pam_test.so
#

pam_test.so: pam_test.o support.o
gcc -shared -Xlinker -x pam_test.o support.o -ldl -lpthread -lpam -o
pam_test.so

pam_test.o: pam_test.c
gcc -fPIC -I/usr/include -I/usr/include/pkcs11 -DLINUX -Wall -c
pam_test.c

support.o: support.c
gcc -c -I/usr/include -I/usr/include/pkcs11 -DLINUX -Wall support.c

install:
cp -f pam_test.so /lib/security

clean:
rm *.o *.so

0 new messages