>>>>> "CP" == CyberPsychotic <[EMAIL PROTECTED]> writes:
CP> Hello people,
CP> I am trying to write a library, which shall be loaded via LD_PRELOAD and
CP> replace several original libc functions. (for example, I want to have my
CP> fopen function, which would make some additional checks/logs).
Considering that your name, etc seems to have computer cracker written
all over it I'm not very comfortable giving you advise.
However since I believe the best way to tighten security is to make
all of the places public knowledge, and that this is a good question
here goes.
CP> Now the problem is how would I call the original routine within my
CP> library?
CP> the only thing I have figured out, is something like:
orig_fopen = dlsym(RTLD_NEXT, "fopen");
Is a much better construction because with a little care
multiple redirectors of the same function can nest.
Don't forget to watch out for the aliases _fopen etc.
That the libc designers seems to through in just to make life fun.
Eric