Re: Do we need to symbolically linking /lib/security/pam_pwdb.so toc reate library for use with JNI, Java?

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

 



On Mon, 4 Dec 2000, Tran, Canh wrote:

>
> On command line, if I create binary with command
> >> cc pam_code.c -lpam -lpam_misc -ldl
>
> Then, a.out is created and I can run it by ./a.out with no errors reported.
>
> However, if I try to build a library by having following line in makefile:
>
> Makefile
> ..................
> ld -G -dy -o   libauthentication.so  pam_code.o  -lpam -lpam_misc -ldl
> ..................
>
> and then, having this library loaded into Java code as:
>
> javacode.java
> ......................................
> System.LoadLibrary("authentication");
> ......................................
>
> Then, at runtime, I get an error 28 "Module is unknown" (static
> libs) from somewhere inside pam_pwdb.so
>
> I've discovered that the dlopen() call in pam_pwdb.so is
> failing with this error "/lib/security/pam_pwdb.so: undefined
> symbol: pam_get_item".
>

This problem usually appears when you try to use pam program as a
dynamic library from another host application (in this case java).
When the java's System.LoadLibrary function loads your library with
the dlopen(3) function then it should use the flag RTLD_GLOBAL.
Otherwise the sybols from the loaded library (in this case the
"pam_get_item" symbol from libauthentication.so) will not be visble
to a third library (in this case pam_pwdb) loaded from your library.

So, if you have an access to the sources of the java I would suggest that
you go and check the implementation of the System.LoadLibrary function
and more specifically what flags it passes to the dlopen(3) function.
If RTLD_GLOBAL is not among them then indeed this is the problem.
If it is then I'm probably wrong.

Regads,
Nikolay

-- 
                                   "GNU/Linux - A Free OS for Free People"





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

  Powered by Linux