4 ms·
I have another that I sometimes use: overriding getenv(3). (I typically just printf() the variable name and return NULL). Most of the time you can spot environ
by zwp 7y ago
I have another that I sometimes use: overriding getenv(3). (I typically just printf() the variable name and return NULL).
Most of the time you can spot environment variable usage in binaries using strings(1) (folks still like to use upper case env vars in non-system applications even though this goes against POSIX).
But by using LD_PRELOAD you can easily see if the program is actually hitting the codepath reads that variable without debuggers or grovelling about in the assembly.