Commit Graph

58 Commits

Author SHA1 Message Date
wzy
d5cc80ae16
Fix zsh install location (#532)
Reported: https://github.com/NixOS/nixpkgs/pull/222667#issuecomment-1713238866
2023-12-02 21:28:35 +00:00
Wu Zhenyu
42d2d95160 Remove unused code in zsh completion
Move completions/_proxychains4 to completions/zsh/_proxychains4 to avoid confusion
2023-04-26 21:11:29 +01:00
rofl0r
060801d8c8 fat-binary-m1: use arm64e for dylib, but not for executable
according to research done by @malash, the proxychains4 binary
itself isn't allowed to use system-internal arm64e mode; but
it's possible to add it as a 3rd architecture to the shared
library (.dylib), and then even inject it into system binaries
like /usr/bin/curl, which didn't work since the introduction
of SIP.

therefore, we now create the dylib with all 3 archs, but the
launcher only with arm64 and x86_64.

closes #453
2022-07-21 23:04:03 +00:00
rofl0r
916d2d7da1 fix --fat-binary-m1 option
even though the preload library was built correctly, the LDFLAGS set
weren't passed to the main proxychains4 binary, resulting in link
errors against the fat object files.

closes #452
2022-05-31 23:53:23 +00:00
Zenithal
9b42da71f4 Fix zsh completion file to proxychains4 2022-05-15 09:36:35 +01:00
Freed-Wu
04023d3811 Add zsh completion file 2022-04-13 00:55:19 +01:00
rofl0r
4a963b2feb only use -ldl if available (netbsd compilation fix)
fixes #416
2021-12-17 13:37:58 +00:00
rofl0r
063ac681da remove 10 year old workaround for wrong glibc getnameinfo signature
in ce655fdac8 the getnameinfo function
was factored into a separate TU to prevent its POSIX signature from
colliding with GLIBC's wrong prototype. since this has been fixed
in GLIBC 10 years ago, it should be safe by now.
undoing the workaround has the advantage that all hooked functions
are now available in the same place, which is a prerequisite for
a change i'm about to commit.

if it turns out there's still systems in use that use the old GLIBC
version with the wrong prototype, we can add a configure check
dealing with it.
2021-12-12 17:51:25 +00:00
rofl0r
6af2686a52 configure: check for -pthread vs -lpthread (#379) 2021-04-30 16:15:30 +01:00
rofl0r
7fe8139496 experimental new feature: proxy_dns_daemon
since many users complain about issues with modern, ultracomplex
clusterfuck software such as chromium, nodejs, etc, i've reconsidered
one of my original ideas how to implement remote dns lookup support.
instead of having a background thread serving requests via a pipe,
the user manually starts a background daemon process before running
proxychains, and the two processes then communicate via UDP.
this requires much less hacks (like hooking of close() to prevent
pipes from getting closed) and doesn't need to call any async-signal
unsafe code like malloc(). this means it should be much more compatible
than the previous method, however it's not as practical and slightly
slower.

it's recommended that the proxychains4-daemon runs on localhost, and
if you use proxychains-ng a lot you might want to set ip up as a service
that starts on boot. a single proxychains4-daemon should theoretically
be able to serve many parallel proxychains4 instances, but this has not
yet been tested so far. it's also possible to run the daemon on other
computers, even over internet, but currently there is no error-checking/
timeout code at all; that means the UDP connection needs to be very
stable.

the library code used for the daemon sources are from my projects
libulz[0] and htab[1], and the server code is loosely based on
microsocks[2]. their licenses are all compatible with the GPL.
if not otherwise mentioned, they're released for this purpose under
the standard proxychains-ng license (see COPYING).

[0]: https://github.com/rofl0r/libulz
[1]: https://github.com/rofl0r/htab
[2]: https://github.com/rofl0r/microsocks
2020-09-23 22:14:39 +01:00
rofl0r
1e00b9ac1e get rid of ip_type.c 2020-09-23 17:00:16 +01:00
Solar Flare
b8fa2a7405 get own_dir by using dladdr() instead of argv[0] 2019-11-27 00:32:08 +08:00
WHR
35a674bdbc configure: Solaris detection, ld 'soname' option auto detection; other Solaris related fixes 2018-01-11 00:45:40 +08:00
rofl0r
cd4ced1d52 Revert "Makefile: suppress pedantic warnings in user CFLAGS"
This reverts commit 6ae959e051.

It appears as if -pedantic is special in that there is no option
to disable it.
2016-12-24 12:49:14 +00:00
rofl0r
6ae959e051 Makefile: suppress pedantic warnings in user CFLAGS 2016-12-13 20:42:50 +00:00
Carlos Maddela
635ded3393 Fix build failure with -pie in user LDFLAGS
When hardening flags are set by Debian's auto build system,
the project fails to build due to usage of -pie, which tells the linker
to build a PIE binary, and since the user LDFLAGS are deliberately put
later in the command line to override things, this overrides -shared.
work around by putting it directly in the last position of the linker
command line.

closes #124
Commit message authored by commiter.
2016-06-09 21:07:33 +01:00
rofl0r
2182eff358 fix segfault in DNS mapping lookup code
the allocatorthread got pointers to RAM which were reallocated
behind the back, and if realloc() couldn't grow in-place, lead
to segfaults in applications that do a lot of DNS-lookups such
as webbrowsers.

closes #66
closes #31

thanks to @ravomavain for tracking down the issue.
2015-06-06 11:43:53 +01:00
rofl0r
53c6c2ca9b configure: respect user LDFLAGS without breaking link order 2015-06-04 21:11:08 +01:00
rofl0r
c9c51d6705 Revert "Fix LDFLAGS"
This reverts commit e79e05a228.

This commit broke link order for a number of people.
2015-06-04 21:04:30 +01:00
rofl0r
fda4ba37ec Revert "fix makefile link order"
This reverts commit 377b474b40.

There still are problems with the link order.
Revert to the known-good version.
2015-06-04 21:03:25 +01:00
jackyzy823
377b474b40 fix makefile link order 2015-04-03 22:37:26 +08:00
Till Maas
e79e05a228 Fix LDFLAGS
- Use user-supplied LDFLAGS
- Use LDFLAGS for linking proxychains4
2015-03-15 11:46:31 +01:00
rofl0r
4fb7eb0532 replace problematic hostentdb with hostsreader
the hostentdb introduced between 4.2 and 4.3
(via af5c6f0c6a )
had several issues:
- it caused breakage on FreeBSD and was commented out there
- prevented usage of the hostdb when proxy_dns was turned off
  (issue #42)
- required dynamic memory allocation which was accessed from several
  threads
- wouldnt reflect changes to the hosts file made during program run

the only sensible solution is to remove the hostentdb and replace it
with a home-grown hosts parser (we can't use gethostent() since
that would mess up the gethostent()-state from different threads).

the new parser used here is deliberately held simple and only meant
to provide the user with means to reference hardcoded ipv4 addresses
via his hosts file.

fixes #42
2014-11-14 12:33:58 +01:00
rofl0r
d8a08707e7 fix regression in install-config Makefile target
closes #34
2014-07-22 17:21:14 +02:00
rofl0r
6143266edd use musl's install.sh rather than doing workarounds for BSD install 2014-07-22 14:32:27 +02:00
rofl0r
cd4aee1997 print proxychains version on DLL init
framework to print version stolen from musl
2014-07-22 14:10:11 +02:00
rofl0r
69abe128ca Makefile: respect CPPFLAGS 2014-02-02 09:49:21 +01:00
rofl0r
3dd2fa7782 Makefile: add proper dependency info for install targets 2014-02-02 09:46:57 +01:00
crass
5c4c166802 Add DUMP_PROXY_CHAIN for debug builds and debug.c. 2013-06-25 12:56:41 +02:00
rofl0r
73ff65ed76 Makefile: prevent from using 2 slashes (cosmetic change) 2013-02-10 12:38:05 +01:00
rofl0r
5d7715551d Makefile: add install-data to .PHONY 2013-01-06 19:33:34 +01:00
rofl0r
4f7363efbc Makefile: put include config later so the program name can be overridden 2013-01-06 19:26:01 +01:00
rofl0r
5526afb56d FreeBSD support 2012-12-25 19:08:05 +01:00
rofl0r
ab4fb353b6 fix for mac build error
closes #6
2012-12-18 09:42:17 +01:00
rofl0r
ce655fdac8 fix the never-ending issues with the wrong glibc prototype of getnameinfo
this bug was fixed shortly before 2.14 release, so we checked for that.
however some distros decided to backport this fix to earlier versions,
breaking our compiletime check.

http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=e4ecafe004b3d4270b3a9dace8f970047400ed38

the portable solution is to stick the function into a separate comilation
unit that does not see the glibc prototype.

closes #7
2012-12-17 22:17:04 +01:00
rofl0r
af5c6f0c6a replace hostent lookup with better performing in-memory copy.
the central dns resolver function proxy_gethostbyname() used
to iterate over the gethostent() db (/etc/hosts) on each dns
request.
since this is not threadsafe, we synchronized access to it
previously using mutexes. the parsing of this file is slow,
and blocking all threads to do it even moreso.
since gethostent_r() is only available on a few platforms,
i decided to read the hostent db once and then use a quick
in-memory lookup on further usage.

+ some further refactoring.
2012-11-08 01:18:19 +01:00
rofl0r
03ee84060e remove THREAD_SAFE ifdefs. from now on, pthreads are required.
additionally we have some explicit init and deinit routines for
core.c now, so that we dont need to share variables with
libproxychains.c.
2012-11-07 21:31:19 +01:00
rofl0r
d0abc93c74 preliminary first fork-safe version
instead of allocating memory in the child, we now use the allocator
thread to do all the necessary allocations himself.
additionally we provide a clean API to query the ip <-> dns mapping.
these functions connect via a pipe to the allocator thread, and
exchange messages.

further cleanup is needed, but it seems to work so far.
thread-safety is not yet guaranteed.

closes #1
2012-11-07 21:31:11 +01:00
rofl0r
25afe98b20 failed attempt to use shared memory for the ip <-> dns mapping
this is in order to get irssi, which forks for DNS lookups,
and similar programs, to work as intended.

in a previous attempt i learned that shared memory created in a
child process is not visible to the parent;
in this attempt i spin off a thread from the parent which listens
on a pipe and manages the shared memory allocation from the parent
address-space. however this doesnt work as expected:
memory allocated in the parent after the child forked is not visi-
ble to the child as well.

so what happens is: irssi starts a child process, the thread allocs
memory and hands it to the child, the child attempts to write and
segfaults. however irssi doesnt crash. since now the memory is
already allocated, doing the dns lookup again will succeed.

i.e. the dns lookup works now in irssi by luck.
all but the first dns lookups will suceed.

however this is not good enough for me to be satisfied, i commit
this only for documentation purposes.
2012-11-07 16:49:14 +01:00
rofl0r
6f35888528 fix issues with pthread and dlsym symbols on ubuntu 12.04
for some reason, the linker needs --no-as-needed for both
libdl and libpthread.

closes #4

thanks to @tomsawyer for discovering this.

the proposed -pthread change was not needed though,
and this is a good thing since it seems not portable.
2012-11-04 01:21:29 +01:00
rofl0r
a4f3dd0538 Makefile: put config into new install-config target 2012-07-16 02:36:35 +02:00
rofl0r
fba5f5694c use config file lookup routine from a common place 2012-07-08 23:32:50 +02:00
rofl0r
1000366f88 Makefile: create destination dirs in case they do not exist 2012-03-07 18:05:04 +01:00
rofl0r
598a41a671 Makefile: add support for DESTDIR 2012-03-07 18:02:37 +01:00
rofl0r
e99dd76941 complete sysconfdir support 2012-01-30 18:29:35 +01:00
rofl0r
0ee539f31c added support for --sysconfdir 2012-01-30 18:26:38 +01:00
rofl0r
c36db11ebc complete mac support 2012-01-27 20:48:24 +01:00
rofl0r
6d25f5d89e allow dll suffix to be passed from ./configure 2012-01-27 20:30:44 +01:00
rofl0r
526fb8b410 pass dll_name to proxychains app, makes it easier to port to MAC 2012-01-27 19:31:01 +01:00
rofl0r
2acdcd9707 pass install prefix to proxychains app, to find /etc 2012-01-27 19:28:00 +01:00