proxychains-ng/src
Tom Li 11988579f5 allocator_thread.c: set O_CLOEXEC/FD_CLOEXEC for pipes, fix #273.
In proxychains, we create pipes and use them internally.
If exec() is called by the program we run, the pipes opened
previously are never closed, causing a file descriptor leak
may eventually crash the program.

This commit calls fcntl() to set FD_CLOEXEC flags on pipes.
AFAIK there's no race condition on pipe creation, but we still
prefer to call the newer pipe2() with O_CLOEXEC if it's supported
by the system, due to its advantage of atomic operation, which
prevents potential race conditions in the future.

Signed-off-by: Tom Li <tomli@tomli.me>
2018-12-25 18:03:39 +00:00
..
allocator_thread.c allocator_thread.c: set O_CLOEXEC/FD_CLOEXEC for pipes, fix #273. 2018-12-25 18:03:39 +00: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 replace getservbyname_r ifdef hacks with configure check 2018-12-02 13:48:43 +00:00
core.h add sendto hook to handle MSG_FASTOPEN flag 2015-01-23 17:14:37 +01:00
debug.c Prevent empty translation units to satisfy ISO C compilers. 2016-12-13 20:27:15 +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 Fix trivial compilation warning 2016-06-09 12:09:51 +01:00
ip_type.h preliminary ipv6 support 2015-08-10 17:00:26 +01:00
libproxychains.c debug mode: display whether proxy_dns is on or off 2018-12-02 13:46:55 +00:00
main.c print usage info on --help too 2018-02-11 14:58:26 +00: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