mirror of
https://github.com/rofl0r/proxychains-ng
synced 2025-01-24 10:12:55 +08:00
main.c: remove code duplication around LD_PRELOAD
This commit is contained in:
parent
f669139c9e
commit
84d9a97a08
12
src/main.c
12
src/main.c
@ -122,14 +122,14 @@ int main(int argc, char *argv[]) {
|
|||||||
if(!quiet)
|
if(!quiet)
|
||||||
fprintf(stderr, LOG_PREFIX "preloading %s/%s\n", prefix, dll_name);
|
fprintf(stderr, LOG_PREFIX "preloading %s/%s\n", prefix, dll_name);
|
||||||
|
|
||||||
#ifndef IS_MAC
|
#ifdef IS_MAC
|
||||||
snprintf(buf, sizeof(buf), "LD_PRELOAD=%s/%s", prefix, dll_name);
|
|
||||||
putenv(buf);
|
|
||||||
#else
|
|
||||||
snprintf(buf, sizeof(buf), "DYLD_INSERT_LIBRARIES=%s/%s", prefix, dll_name);
|
|
||||||
putenv(buf);
|
|
||||||
putenv("DYLD_FORCE_FLAT_NAMESPACE=1");
|
putenv("DYLD_FORCE_FLAT_NAMESPACE=1");
|
||||||
|
#define LD_PRELOAD_ENV "DYLD_INSERT_LIBRARIES"
|
||||||
|
#else
|
||||||
|
#define LD_PRELOAD_ENV "LD_PRELOAD"
|
||||||
#endif
|
#endif
|
||||||
|
snprintf(buf, sizeof(buf), LD_PRELOAD_ENV "=%s/%s", prefix, dll_name);
|
||||||
|
putenv(buf);
|
||||||
execvp(argv[start_argv], &argv[start_argv]);
|
execvp(argv[start_argv], &argv[start_argv]);
|
||||||
perror("proxychains can't load process....");
|
perror("proxychains can't load process....");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user