Operating System - HP-UX
1825771 Members
2031 Online
109687 Solutions
New Discussion

Re: PAM Module loading error

 
Stephane Vinsot
Advisor

PAM Module loading error

I've got a problem while building PAM modules. It seems to be due to dependencies of the pam module library:
- I built a first PAM module doing nothing but writting in the syslog. I had no problems.
- Then i add a function needing the use of external shared libraries.
In this case i have the same error "Can't load module...".

I tried to link dynamically the external shared libraries (using shl_load in my module code).
Now the PAM is able to load the module, but i still have the following problems:
- My module library is able to find the external dependencies ONLY if i put the hard-coded full path of this library.
The pam module doesn't use the SHLIB_PATH define and the path given with the +b option while linking it.
- If the dependency library has its own dependencies, it won't be able to find the libraries, even with the SHLIB_PATH defined.

Sometimes, i manage to make it work with SU, but i never made it working with DTLOGIN.

Does Anyone have an idea ?
8 REPLIES 8
CHRIS_ANORUO
Honored Contributor

Re: PAM Module loading error

Install the following 10.20 patches PHCO_20441 an PHSS_20607 and their dependencies.
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
CHRIS_ANORUO
Honored Contributor

Re: PAM Module loading error

Install the following 10.20 patches PHCO_20441 an PHSS_20607 and their dependencies.
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
CHRIS_ANORUO
Honored Contributor

Re: PAM Module loading error

Install the following 10.20 patches PHCO_20441 an PHSS_20607 and their dependencies.
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
Stephane Vinsot
Advisor

Re: PAM Module loading error

Sorry, i forgot to add that it's on HPUX 11, and that i already applied the last PAM patches (PHCO_21833)
Stephane Vinsot
Advisor

Re: PAM Module loading error

The patch number you gave are not PAM patches, but "libc" and "milli" patches.
Are they really the patches to install ?
Stephane Vinsot
Advisor

Re: PAM Module loading error

I installed the milli and libc patches.

The problem is stil there...

Rick Beldin
HPE Pro

Re: PAM Module loading error

If you do a chatr on the shared library that you produce, you should either see the full path of the library in the library list OR the path to the library in the embedded path section. Your pam module needs to be able to find the shared lib outside of your environment so don't depend on SHLIB_PATH.

Are you specifying the +b option in your link? This would allow you set a library search path for use at runtime.

Here's example output from running chatr on 10.20 xclock.

/usr/bin/X11/xclock:
shared executable
shared library dynamic path search:
SHLIB_PATH enabled first
embedded path enabled second /opt/audio/lib:/opt/image/lib:/optb
internal name:
xclock
shared library list:
dynamic /vobs/build_backing/feb96_1010//lib/libXt.1
dynamic /vobs/build_backing/feb96_1010//lib/libXext.1
dynamic /vobs/build_backing/feb96_1010//lib/libX11.1
dynamic /vobs/common/10.10/usr/lib/libc.1
shared library binding:
deferred
static branch prediction disabled
kernel assisted branch predictionenabled
lazy swap allocationdisabled
text segment lockingdisabled
data segment lockingdisabled
data page size: 4K
instruction page size: 4K
Necessary questions: Why? What? How? When?
Stephane Vinsot
Advisor

Re: PAM Module loading error

Yes, i compiled with options +s AND +b, as you can see...

I even tried to manually set SHLIB_PATH in the code (putenv("SHLIB_PATH=")).
I still have the error : can't find module.

here is my module's chatr:
-------------------------------------------
ser-250:/usr/lib/security> chatr libpam_am.1
libpam_am.1:
shared library
shared library dynamic path search:
SHLIB_PATH enabled first
embedded path enabled second /lib:/usr/lib:/opt/ism5/shared_lib
shared library list:
dynamic /usr/lib/libpam.1
shared vtable support disabled
static branch prediction disabled
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation disabled
text segment locking disabled
data segment locking disabled
third quadrant private data space disabled
fourth quadrant private data space disabled
data page size: D (default)
instruction page size: D (default)

-------------------------------------------
you don't see the external needed library in the dependencies since i dynamically load it in the code.

If i link with it, i have the error "can not module" from the libpam in the syslog, straight at the library load.