Re: dlopen not able to open shared object file, even though it is existing

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

 



On Sat, Dec 08, 2012 at 06:01:06AM +0000, mohanamurali.gurunathan@xxxxxxxxx wrote:
> Hello pam-list members,

> We had written a customized PAM authentication module (in C) named
> vauth.so to be used for sshd.  We had changed the sshd file in /etc/pam.d
> to include the following line

> authenticate sufficient vauth.so

> We were able to have ssh session using PuTTY successfully. vauth.so gets
> called and authentication gets completed.

> After this, we wanted to use some java components for our authentication
> through vauth.so.  So, we used some JNI calls from the c code, and created
> vauth.so.

> These were the commands used to create vauth.so (which is finally placed
> in /lib64/security)

> gcc -fPIC -fno-stack-protector -I/usr/java/jdk1.7.0_07/include -I/usr/java/jdk1.7.0_07/include/linux -c vauth.c -L/usr/java/jdk1.7.0_07/jre/lib/amd64/server

> ld -x --shared -o /lib64/security/vauth.so vauth.o /usr/java/jdk1.7.0_07/jre/lib/amd64/server/libjvm.so

> We had also copied "libjvm.so" to /lib64/security.

> Now, when we do an authentication using PuTTY, we see the following error.

> Dec  6 11:23:10 localhost sshd[8605]: PAM unable to dlopen(/lib64/security/vauth.so): libjvm.so: cannot open shared object file: No such file or directory
> Dec  6 11:23:10 localhost sshd[8605]: PAM adding faulty module: /lib64/security/vauth.so

> We are not sure, why this problem occurs as libjvm.so in present in
> /lib64/security.

Run 'ldd -d -r /lib64/security/vauth.so' to see what's wrong.

But as a general rule, /lib64/security is not going to be on the library
search path; so either you need libjvm.so to be installed to a system path,
or you need to use an rpath setting on your module to tell the runtime
linker where to find libjvm.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek@xxxxxxxxxx                                     vorlon@xxxxxxxxxx

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Pam-list mailing list
Pam-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/pam-list

[Index of Archives]     [Fedora Users]     [Kernel]     [Red Hat Install]     [Linux for the blind]     [Gimp]

  Powered by Linux