mirror of
https://github.com/rofl0r/proxychains-ng.git
synced 2024-12-22 04:08:47 +00:00
OpenBSD: use ':' as LD_PRELOAD separator (#538)
LD_PRELOAD documentation added in 1998 talks about colon as separator, and apparently space no longer works.
This commit is contained in:
parent
d5cc80ae16
commit
0279dda939
14
src/main.c
14
src/main.c
@ -135,16 +135,20 @@ 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);
|
||||||
|
|
||||||
|
#if defined(IS_MAC) || defined(IS_OPENBSD)
|
||||||
|
#define LD_PRELOAD_SEP ":"
|
||||||
|
#else
|
||||||
|
/* Dynlinkers for Linux and most BSDs seem to support space
|
||||||
|
as LD_PRELOAD separator, with colon added only recently.
|
||||||
|
We use the old syntax for maximum compat */
|
||||||
|
#define LD_PRELOAD_SEP " "
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef IS_MAC
|
#ifdef IS_MAC
|
||||||
putenv("DYLD_FORCE_FLAT_NAMESPACE=1");
|
putenv("DYLD_FORCE_FLAT_NAMESPACE=1");
|
||||||
#define LD_PRELOAD_ENV "DYLD_INSERT_LIBRARIES"
|
#define LD_PRELOAD_ENV "DYLD_INSERT_LIBRARIES"
|
||||||
#define LD_PRELOAD_SEP ":"
|
|
||||||
#else
|
#else
|
||||||
#define LD_PRELOAD_ENV "LD_PRELOAD"
|
#define LD_PRELOAD_ENV "LD_PRELOAD"
|
||||||
/* all historic implementations of BSD and linux dynlinkers seem to support
|
|
||||||
space as LD_PRELOAD separator, with colon added only recently.
|
|
||||||
we use the old syntax for maximum compat */
|
|
||||||
#define LD_PRELOAD_SEP " "
|
|
||||||
#endif
|
#endif
|
||||||
char *old_val = getenv(LD_PRELOAD_ENV);
|
char *old_val = getenv(LD_PRELOAD_ENV);
|
||||||
snprintf(buf, sizeof(buf), LD_PRELOAD_ENV "=%s/%s%s%s",
|
snprintf(buf, sizeof(buf), LD_PRELOAD_ENV "=%s/%s%s%s",
|
||||||
|
Loading…
Reference in New Issue
Block a user