Subject: X lib troubles...solved
To: NetBSD Mac68k <port-mac68k@netbsd.org>
From: Colin Wood <ender@is.rice.edu>
List: port-mac68k
Date: 04/11/1997 02:22:12
Whilst updating the FAQ tonight, I finally discovered what was wrong with
my answer to the question of what causes the:

xinit: libXext.so.6.1 not found

error.  The problem is caused by the fact that the dynamic linkage editor
doesn't know where to look for the X shared libraries since they are
normally not in /usr/lib.

My solution to this problem in the FAQ included 2 different methods for
solving the problem:

1) adding a 'ldconfig -m /usr/X11R6/lib' line to /etc/rc.local,
2) or simply doing a 'setenv LD_LIBRARY_PATH /usr/X11R6/lib' on the
   command line.

Many users tried #2, probably because it was simpler and doesn't really
require a reboot or a shutdown to work.  However, many of them reported
that it didn't work, even when they added it to their .login (which I
thought would cure the problem for sure ;-)

So, after digging around tonight, I saw the following in the ldconfig(8)
man page (it's amazing what a wealth of information there is in the manual
pages ;-):

Security

Special care must be taken when loading shared libraries into the address
space of set-user-Id programs. Whenever such a program is run, ld.so will
only load shared libraries from the ld.so.hints file. In particular, the
LD_LIBRARY_PATH is not used to search for libraries. Thus, the role of
ldconfig is dual. In addition to building a set of hints for quick
lookup, it also serves to specify the trusted collection of directories
from which shared objects can be safely loaded. It is presumed that the
set of directories specified to ldconfig are under control of the system's
administrator.  ld.so further assists set-user-Id programs by erasing the
LD_LIBRARY_PATH from the environment. 

So, this pretty much explains why setting LD_LIBRARY PATH wasn't working.
I've made the necessary changes to the FAQ, and a slightly updated version
is currently available at:

http://mycroft-holmes.brown.rice.edu/~ender/tmp/faq/faq.html

I'll push it over to puma as soon as I'm finished with the current round
of updates.

As usual, comments, fixes, suggestions, more answers ;-), etc. are
welcome.

Later.

-- 
Colin Wood                                      ender@is.rice.edu
Consultant                                        Rice University
Information Technology Services                       Houston, TX