HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- problem with shl_load and pam
Operating System - HP-UX
1830050
Members
14815
Online
109998
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2002 12:26 PM
08-20-2002 12:26 PM
Hello!
I try to port a self-written PAM module from Linux to HP-UX 11.00. The problem is, that i have to use some LDAP-functions from an third-party library (IBM SecureWay for HP-UX). Building a standalone-program with them works fine, but when compiled and linked as a shared library it gives the well-known error: Can't shl_load() a library containing Thread Local Storage: /usr/lib/libpthread.1
I've read a lot of stuff about that error and i've tried almost everything that was ever suggested...
I read, that libpthread must be loaded before that library to avoid the problem. So i've tried to link against "-lpthread" too, but no effect. I also tried a lot of combinations, including -ldld, -lc and so on. Nothing. I don't know any further now.
I would use the LD_PRELOAD feature too, but where to set an environment variable for the PAM-environment?
Here the output from "odump -sllibloadlist" for that module, if it helps:
0 libpam_test.1
1 ^ /usr/lib/libibmldap.sl
2 ^ ^ /usr/lib/libc.2
3 ^ ^ ^ /usr/lib/libdld.2
4 ^ ^ /usr/lib/libpthread.1
Is it right, that the load direction ist bottom up? So if libpam_test.1 should be loaded it would be: libpthread, libdld, libc, libibmldap?
Anyone able to help?
Many thanks in advance!!
Bjoern
I try to port a self-written PAM module from Linux to HP-UX 11.00. The problem is, that i have to use some LDAP-functions from an third-party library (IBM SecureWay for HP-UX). Building a standalone-program with them works fine, but when compiled and linked as a shared library it gives the well-known error: Can't shl_load() a library containing Thread Local Storage: /usr/lib/libpthread.1
I've read a lot of stuff about that error and i've tried almost everything that was ever suggested...
I read, that libpthread must be loaded before that library to avoid the problem. So i've tried to link against "-lpthread" too, but no effect. I also tried a lot of combinations, including -ldld, -lc and so on. Nothing. I don't know any further now.
I would use the LD_PRELOAD feature too, but where to set an environment variable for the PAM-environment?
Here the output from "odump -sllibloadlist" for that module, if it helps:
0 libpam_test.1
1 ^ /usr/lib/libibmldap.sl
2 ^ ^ /usr/lib/libc.2
3 ^ ^ ^ /usr/lib/libdld.2
4 ^ ^ /usr/lib/libpthread.1
Is it right, that the load direction ist bottom up? So if libpam_test.1 should be loaded it would be: libpthread, libdld, libc, libibmldap?
Anyone able to help?
Many thanks in advance!!
Bjoern
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 07:06 AM
08-21-2002 07:06 AM
Solution
The only way to make libpthread.1 work in your shared library would be to have it linked into all a.outs that use your shared library. That is not practical with a PAM module.
(It is also really dangerous to think about introducing threading into a bunch of code that was not written or compiled as thread-safe.)
The simplest fix for your problem is to create a small a.out that your shared library communicates with to access the libibmldap.sl functions. You could either fork/exec that a.out for every startup of your shared library, or leave a daemon process that your library can connect to as needed. The best fit will depend on the performance and security requirements of your design.
(It is also really dangerous to think about introducing threading into a bunch of code that was not written or compiled as thread-safe.)
The simplest fix for your problem is to create a small a.out that your shared library communicates with to access the libibmldap.sl functions. You could either fork/exec that a.out for every startup of your shared library, or leave a daemon process that your library can connect to as needed. The best fit will depend on the performance and security requirements of your design.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 01:37 AM
08-22-2002 01:37 AM
Re: problem with shl_load and pam
That would be a solution. I think i will try it that way.
Thanks,
Bjoern
Thanks,
Bjoern
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP