[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: socksified libc



if LD_PRELOAD_LIBRARY environement variable is set to a library,
then this library is loaded, before other libraries are loaded.
this way e.g. a "connect" function in the preload library will be
called, and not the "connect" function from libc.

ld.so should have the documentation.
maybe you want to look at fakeroot, it uses this function, too.

oh, this does not work for setuid binaries
(would be a security hole - you could preload a library with getuid() or
such stuff).

> How do you build a library for this?

yust build a shared library, as usual.
in order to replace a function, write a new one withe the same name,
and the same parameteres (for binary compatibility).

oh, i don't know if there is a way to call the orginal function.
but i think there should be one.  maybe you can archive this by static
linking or so ?
you better read the docs, or ask joost witteveen (fakeroot author) or
david engel (ld.so author).

andreas


--
E-mail the word "unsubscribe" to debian-firewall-request@lists.debian.org
TO UNSUBSCRIBE FROM THIS MAILING LIST. Trouble?  E-mail to listmaster@debian.org .


Reply to: