sshd on FBSD 8.0-RC2/3

Peter Beckman beckman at angryox.com
Sun Dec 6 04:41:41 UTC 2009


On Sun, 6 Dec 2009, Dmitry Pryanishnikov wrote:

> 2009/12/3 Peter Beckman <beckman at angryox.com>:
>> On Thu, 3 Dec 2009, Dmitry Pryanishnikov wrote:
>>
>>>  Well, ldd's output _itself_ depends on the current environment and
>>> thus can't insure that correct libraries will be used by the
>>> application. Compare:
>>
>>  Well that's just confusing!  So what's the default?  If I have no
>>  LD_LIBRARY_PATH set, lighttpd uses /usr/local/lib as I would
>>  expect/hope/desire, but I have no understanding as to why.  If I set
>>  LD_LIBRARY_PATH to /usr/lib, it uses everything right EXCEPT
>>  /usr/lib/libssl.so.6.  What's the logic?  How does one do it right?
>
>  I haven't found definitive answer using RTFM. But luckily it's
> opensource, so RTFS gives the following search order for rtld-elf (as
> of RELENG_7):
>
> /usr/src/libexec/rtld-elf/rtld.c:
>
> /*
> * Find the library with the given name, and return its full pathname.
> * The returned string is dynamically allocated.  Generates an error
> * message and returns NULL if the library cannot be found.
> *
> * If the second argument is non-NULL, then it refers to an already-
> * loaded shared object, whose library search path will be searched.
> *
> * The search order is:
> *   LD_LIBRARY_PATH
> *   rpath in the referencing file
> *   ldconfig hints
> *   /lib:/usr/lib
> */
>
> Looks like 'libssl.so.6 => /usr/local/lib/libssl.so.6' is set via
> rpath - it overrides standard hints path
> '/lib:/usr/lib:/usr/lib/compat:/usr/local/lib...' but still can be
> overridden by LD_LIBRARY_PATH.

  You. Are. The. Man.  I really appreciate you taking the time to dig that
  up.  I hope it will help someone else in the future also getting confused
  with why one library is being used over another.  Thanks!!!

Beckman
---------------------------------------------------------------------------
Peter Beckman                                                  Internet Guy
beckman at angryox.com                                 http://www.angryox.com/
---------------------------------------------------------------------------


More information about the freebsd-ports mailing list