LD_LIBRARY_PATH default

David Alban extasia at extasia.org
Tue Aug 8 19:53:44 BST 2006


cow-orker:  If you are going so far as to explicitly define PATH in a
script, you might want to consider explicitly declaring
LD_LIBRARY_PATH as well.

me:  I tend not to unless it's required by something in the program.
Would you suggest otherwise?

cow-orker:  Given that many utilities are dynamically linked, if you
are worried about sanitizing input, making sure that they don't link
in a library that someone has maliciously set with, say, open()
remapped to unlink().

me:  Would there be a fairly uniform default?  For example, a default
path of /usr/sbin:/usr/bin works pretty well on solaris.  How about
for ld_library_path?  Would there be a sane default for each OS?

cow-orker:  I just realized that some users hardcode LD_LIBRARY_PATH
to "". Looks like the linker defines the standard /usr/lib in the
absence of the variable being expanded.  So if you wanted to clobber
it, then /usr/lib is probably the best value.

---------------------------------------------------

Anyone here give $ENV{ LD_LIBRARY_PATH } an explicit default value?
Anyone have an opinion on doing so?

Thanks,
David
-- 
Live in a world of your own, but always welcome visitors.


More information about the london.pm mailing list