<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic problem with shl_load and pam in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-shl-load-and-pam/m-p/2790195#M720462</link>
    <description>Hello!&lt;BR /&gt;&lt;BR /&gt;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&lt;BR /&gt;&lt;BR /&gt;I've read a lot of stuff about that error and i've tried almost everything that was ever suggested... &lt;BR /&gt;&lt;BR /&gt;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. &lt;BR /&gt;&lt;BR /&gt;I would use the LD_PRELOAD feature too, but where to set an environment variable for the PAM-environment?&lt;BR /&gt;&lt;BR /&gt;Here the output from "odump -sllibloadlist" for that module, if it helps:&lt;BR /&gt;&lt;BR /&gt;0  libpam_test.1&lt;BR /&gt;1  ^ /usr/lib/libibmldap.sl&lt;BR /&gt;2  ^ ^ /usr/lib/libc.2&lt;BR /&gt;3  ^ ^ ^ /usr/lib/libdld.2&lt;BR /&gt;4  ^ ^ /usr/lib/libpthread.1&lt;BR /&gt;&lt;BR /&gt;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?&lt;BR /&gt;&lt;BR /&gt;Anyone able to help?&lt;BR /&gt;&lt;BR /&gt;Many thanks in advance!!&lt;BR /&gt;&lt;BR /&gt;Bjoern&lt;BR /&gt;</description>
    <pubDate>Tue, 20 Aug 2002 19:26:09 GMT</pubDate>
    <dc:creator>Bj_5</dc:creator>
    <dc:date>2002-08-20T19:26:09Z</dc:date>
    <item>
      <title>problem with shl_load and pam</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-shl-load-and-pam/m-p/2790195#M720462</link>
      <description>Hello!&lt;BR /&gt;&lt;BR /&gt;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&lt;BR /&gt;&lt;BR /&gt;I've read a lot of stuff about that error and i've tried almost everything that was ever suggested... &lt;BR /&gt;&lt;BR /&gt;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. &lt;BR /&gt;&lt;BR /&gt;I would use the LD_PRELOAD feature too, but where to set an environment variable for the PAM-environment?&lt;BR /&gt;&lt;BR /&gt;Here the output from "odump -sllibloadlist" for that module, if it helps:&lt;BR /&gt;&lt;BR /&gt;0  libpam_test.1&lt;BR /&gt;1  ^ /usr/lib/libibmldap.sl&lt;BR /&gt;2  ^ ^ /usr/lib/libc.2&lt;BR /&gt;3  ^ ^ ^ /usr/lib/libdld.2&lt;BR /&gt;4  ^ ^ /usr/lib/libpthread.1&lt;BR /&gt;&lt;BR /&gt;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?&lt;BR /&gt;&lt;BR /&gt;Anyone able to help?&lt;BR /&gt;&lt;BR /&gt;Many thanks in advance!!&lt;BR /&gt;&lt;BR /&gt;Bjoern&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Aug 2002 19:26:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-shl-load-and-pam/m-p/2790195#M720462</guid>
      <dc:creator>Bj_5</dc:creator>
      <dc:date>2002-08-20T19:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: problem with shl_load and pam</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-shl-load-and-pam/m-p/2790196#M720463</link>
      <description>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.&lt;BR /&gt;(It is also really dangerous to think about introducing threading into a bunch of code that was not written or compiled as thread-safe.)&lt;BR /&gt;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.</description>
      <pubDate>Wed, 21 Aug 2002 14:06:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-shl-load-and-pam/m-p/2790196#M720463</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2002-08-21T14:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: problem with shl_load and pam</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-shl-load-and-pam/m-p/2790197#M720464</link>
      <description>That would be a solution. I think i will try it that way.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Bjoern</description>
      <pubDate>Thu, 22 Aug 2002 08:37:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-shl-load-and-pam/m-p/2790197#M720464</guid>
      <dc:creator>Bj_5</dc:creator>
      <dc:date>2002-08-22T08:37:38Z</dc:date>
    </item>
  </channel>
</rss>

