Messages in this thread | | | Subject | Re: As 2.0 looms | Date | Sat, 27 Apr 1996 20:49:43 -0400 (EDT) | From | "Lex Spoon" <> |
| |
Marek Michalkiewicz wrote: > > Alain KNAFF: > > >You decide > > >which one you want to use at link time (default is to ignore LD_xxx - > > >it's not necessary except for testing new shared libraries). I think > > > > LD_xxx is also needed for programs such as zlibc, which work by > > redefining certain library calls. Ignoring LD_xxx by default would > > make any such program impractical. > > OK, thanks for pointing this out. But you can still make the binaries > use LD_xxx if you want. > > There should be a secure LD_PRELOAD equivalent - use a system-wide config > file instead of environment variables. I think David Engel is working on > it (specifying libraries to preload in /etc/ld.so.preload). Is it OK > for zlibc, or does every user really have to be able to redefine library > calls on their own? (/etc/ld.so.preload would be useful for other things > as well, like replacing crypt() with something better.) > > Marek >
There are a lot of things we don't have to have, but which are still convenient. The average end user probably has little use for LD_PRELOAD, but programmers do.
Personally, I like being able to use LD_PRELOAD to load malloc() and friends replacements that have better error checking (I'm thinking of libdmalloc by gray.watson@letters.com). Granted I don't use it a *lot*, but it is really nice when I do.
Overall, as scary as the LD_PRELOAD thing was at first, Linux's ld.so seems to handle it in a safe way: only allow it if the programmer could have relinked the program himself and done it anyway.
The telnet security hole should just be a reminder that environment variables are just like command line arguments, and it is dangerous to allow aribitrary users to give arbitrary arguments to a program executed by root.
Finally, using a system-wide config file would largely ruin the main point of LD_PRELOAD as I understand it; I thought the point was to invoke a program with different libraries than it would get by default?
My vote is to leave the LD_xxx system as it is, and keep an eye out for:
a) places the system really lets users gain a privilage they wouldn't have before.
b) places where unprivilaged users can specify an arbitrary environment variable for a program that root will execute.
lex
| |