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

Re: LD_PRELOAD inconsitency



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, Mar 10, 2017 at 11:58:56AM +0300, Reco wrote:
> 	Hello, list.
> 
> It got my attention today (current jessie, amd64):
> 
> $ LD_PRELOAD=libproxychains.so.3 mutt
> 
> ERROR: ld.so: object 'libproxychains.so.3' from LD_PRELOAD cannot be
> preloaded (cannot open shared object file): ignored.
> 
> but,
> 
> $ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libproxychains.so.3 mutt
> 
> <works as intended>
> 
> and
> 
> $ LD_PRELOAD=libproxychains.so.3 ls
> 
> <works as intended>
> 
> So, the question is: what makes mutt so special?

No idea, but ld.so's man page mentions a couple of possibilities
right there at the top, under "DESCRIPTION":

  If a library dependency does not contain a slash, then it is
  searched for in the following order:

  o  (ELF only) Using the directories specified in the DT_RPATH
     dynamic section attribute of the binary if present and
     DT_RUNPATH attribute does not exist.  Use of DT_RPATH is deprecated.

  o  Using the environment variable LD_LIBRARY_PATH.  Except if the executable
     is a set-user-ID/set-group-ID binary, in which case it is ignored.

  o  (ELF only) Using the directories specified in the DT_RUNPATH dynamic section
     attribute of the binary if present.

  o  From the cache file /etc/ld.so.cache, which contains a compiled list of
     candidate libraries previously found in the augmented library path.
     If, however, the binary  was  linked  with  the  -z  nodeflib  linker
     option, libraries in the default library paths are skipped.  Libraries
     installed in hardware capability directories (see below) are preferred to
     other libraries.

  o  In the default path /lib, and then /usr/lib.  If the binary was linked with
     the -z nodeflib linker option, this step is skipped.

So plenty for you to investigate :-)

(I'd love to do that now, but my customer'd kill me :-(

regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAljCctYACgkQBcgs9XrR2kbtjgCePFeO1pDToTWZB38S5utj3xR1
LmsAn0l6pdYef455nWEwPn8Zc+8xNXSo
=rEri
-----END PGP SIGNATURE-----


Reply to: