Re: Q: path for dynamic libs hardwired ?
Posted in 1997
>From: Christoph Liebig <chris@dvs1.informatik.th-darmstadt.de>
>Date: Tue, 10 Jun 1997 18:47:01 +0200
>X-Informix-List-Id: <news.38996>
>
>I am wondering if the search path for dynamic link libs (Solaris
>platform) for informix tools, e.g. dbaccess & co are hardwired
>into the binaries or set at installation time.
It depends on which version you are using... If you're using a 7.1x
version, the answer may well be 'Yes'. For some tools, notably the ones
which run SUID root, it is absolutely necessary that the shared libraries
are in /usr/lib because the basic Solaris (SVR4) security mechanisms do not
allow the user to specify where the shared libraries come from -- because
there'd be nothing to stop an unscrupulous user from writing their own
version of the library and putting it in a directory on LD_LIBRARY_PATH
before the official library, thereby getting root priveleges to do what
they will with the system.
For DB-Access in the 7.2x versions, the executables do not use
any Informix shared libraries (they are statically linked):
$ . 722UC2.OnLine
$ ldd `whence dbaccess`
libnsl.so.1 => /usr/lib/libnsl.so.1
libsocket.so.1 => /usr/lib/libsocket.so.1
libaio.so.1 => /usr/lib/libaio.so.1
libm.so.1 => /usr/lib/libm.so.1
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libintl.so.1 => /usr/lib/libintl.so.1
libmp.so.1 => /usr/lib/libmp.so.1
libw.so.1 => /usr/lib/libw.so.1
$
>Currently we need to have some links in /usr/lib to the libs
>in the INFORMIXDIR/lib directory.
>I would rather like to extend LD_LIBRARY_PATH and drop the links
>in /usr/lib.
>
>(How) Is this possible ?
Well, there's the obvious suggestion -- try it.
You can only do that if the programs will never be used by root, and only
if the programs were linked in such a way that the pathname for the
libraries was not specified explicitly in the link line. And beware of the
OnLine utilities...
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>