proxychains-ng/src
rofl0r 8870140ff0 don't call INIT() from close hook
it was observed that it is a bad idea to initialize the entire
infrastructure used by proxychains from the close hook,
because the following scenario will lead to a deadlock:

- it is possible that the dynlinker executes the initializer code of
  other shared libs first
- if that code directly or indirectly calls malloc()
- which calls close() if it decided to use an mmap based allocation
- will now call our close(), which does
- call pthread_once which requires a lock
- creates a thread which calls malloc()
- which in turn calls our close() another time
- and our close is still in locked state.

so it seems the only save thing to do is to just get the address
of the original close function, and call that when we're in a
pre-init state.
this may hold for other functions that do lazy initialization as well,
however for those just calling the original function is probably
undesired since that could result in unproxified connections.
it will be needed to analyze on a per-function basis what the best
thing to do is, and finally rely only on the execution of the init
function from the gcc initializer.

should fix #119
2016-05-26 10:48:32 +01:00
..
allocator_thread.c preliminary ipv6 support 2015-08-10 17:00:26 +01:00
allocator_thread.h preliminary ipv6 support 2015-08-10 17:00:26 +01:00
common.c common.c: fix trailing whitespace 2014-07-02 10:10:53 +02:00
common.h Add DUMP_PROXY_CHAIN for debug builds and debug.c. 2013-06-25 12:56:41 +02:00
core.c preliminary ipv6 support 2015-08-10 17:00:26 +01:00
core.h add sendto hook to handle MSG_FASTOPEN flag 2015-01-23 17:14:37 +01:00
debug.c debug.c: fix for ipv6 changes 2015-12-01 20:37:27 +00:00
debug.h clean up some debug ifdefs 2015-06-14 10:53:33 +01:00
hash.c replace hostent lookup with better performing in-memory copy. 2012-11-08 01:18:19 +01:00
hash.h replace hostent lookup with better performing in-memory copy. 2012-11-08 01:18:19 +01:00
hostsreader.c improve hostsreader test code 2016-02-04 09:38:16 +00:00
ip_type.c preliminary ipv6 support 2015-08-10 17:00:26 +01:00
ip_type.h preliminary ipv6 support 2015-08-10 17:00:26 +01:00
libproxychains.c don't call INIT() from close hook 2016-05-26 10:48:32 +01:00
main.c fixup for 9ab7dbe 2015-05-21 14:04:10 +01:00
mutex.h preliminary first fork-safe version 2012-11-07 21:31:11 +01:00
nameinfo.c fix the never-ending issues with the wrong glibc prototype of getnameinfo 2012-12-17 22:17:04 +01:00
proxychains.conf Add round_robin to example config. 2013-06-26 12:22:12 +02:00
proxyresolv better regex for obsolete proxyresolv script (thx yhzarcali) 2013-01-29 18:43:21 +01:00
version.c print proxychains version on DLL init 2014-07-22 14:10:11 +02:00