Subject: Re: setgid dt eats LD_LIBRARY_PATH
To: Johnny Chi-Lung Lam <jlbg+@andrew.cmu.edu>
From: Bill Studenmund <wrstuden@loki.stanford.edu>
List: port-mac68k
Date: 11/05/1997 09:09:03
> 
> The default installation of dt is setgid utmp.  If I export the
> variable LD_LIBRARY_PATH before starting dt, the shells spawned by dt
> don't have LD_LIBRARY_PATH in their environment.  If I remove the
> setgid bit on dt, then the subshells DO see LD_LIBRARY_PATH.  One last
> thing --- this only happens to LD_LIBRARY_PATH, not to any other
> environment variable that I set.

It's a security feature. If LD_LIBRARY_PATH were not cleared, you could
make a fake libc (for instance) with "extra" features inside of normal
system calls. You could then run dt with this libc, and have your
"addidions" run setgid utmp. setgid utmp isn't so bad, but setuid
root, well, you could make a libc that did just about anything,
like spawn a new shell for you every time the "open" routine was called.
:-)

If you have libraries you need even w/ dt, you probably should add them
to the system-wide /etc/ld.so.hints (you probably should create that
file w/ all the defaults if you add stuff here), or add an
ldconfig -m /your/lib/dir    to rc.local.

Take care,

Bill