Help Using LD_PRELOAD
3 answers
- As far as I know, in the first place the program could not change the evitive uid or gid (the so called suid or guid of the program).
- It should only be used for specific purposes like debugging. As far as I remember, you can shadow functions in C (in elf?). However, both
LD_PRELOAD
shading and shading methods must deal with careful care. I rememberg_malloc
running into a shadowing error in gpgme (or other gpg-related code) where GLib's internal objects changed.
The simple answer is don't do it. The harder it is - do it if and only if you need to - and usually you don't (unless you are writing some kind of debugging software).
+2
source to share