Commit Graph

16 Commits

Author SHA1 Message Date
rofl0r
36c9b93cfe transparent: remove usage of inet_ntoa(), make IPv6 ready
inet_ntoa() uses a static buffer and is therefore not threadsafe.
additionally it has been deprecated by POSIX.

by using inet_ntop() instead the code has been made ipv6 aware.

note that this codepath was only entered in the unlikely event that
no hosts header was being passed to the proxy, i.e. pre-HTTP/1.1.
2020-09-06 16:22:11 +01:00
rofl0r
d98aabf47f transparent: fix invalid memory access
getsockname() requires addrlen to be set to the size of the sockaddr struct
passed as the addr, and a check whether the returned addrlen exceeds the
initially passed size (to determine whether the address returned is truncated).

with a request like "GET /\r\n\r\n" where length is 0 this caused the code
to assume success and use the values of the uninitialized sockaddr struct.
2020-03-18 12:31:15 +00:00
bertliao
81ea4feb2e fix possible memory leak 2018-02-25 14:56:50 +00:00
Michael Adam
b3ac7d2c7b transparent: make transparent support compile after introduction of multi Listen
I seem to have forgotten to compile with transparent support enabled...
This belongs to the fix for bug BB#63.

Signed-off-by: Michael Adam <obnox@samba.org>
2013-11-23 00:18:04 +01:00
Michael Adam
8fd3808ad3 [BB#95] remove two comments that have become wrong by the fix. 2010-12-01 22:25:44 +01:00
Daniel Egger
62443a6391 [BB#95] Fix FilterURLs with transparent proxy support.
Pass a pointer to a char pointer to do_transparent_proxy so the reassembled URL
will actually end up back in the caller where it is needed for filtering
decisions. This fixes the problem that a tinyproxy configured with the
transparent proxy functionality and "FilterURLs Yes" would filter on everything
but the domain.

Signed-off-by: daniel.egger@sphairon.com
Signed-off-by: Michael Adam <obnox@samba.org>
2010-12-01 22:25:44 +01:00
Michael Adam
5bba62bcde Fix the build with --enable-transaparent after conf changes.
Michael
2009-12-07 23:42:55 +01:00
Mukund Sivaraman
eab4ae000b url variable modified in do_transparent_proxy() is not the url variable in the caller 2009-10-02 15:27:43 +05:30
Mukund Sivaraman
931b038b27 Use safer string functions 2009-10-02 15:21:42 +05:30
Mukund Sivaraman
38c20cd867 Add explicit casts for c++ mode in transparent-proxy.c 2009-09-27 08:09:23 +05:30
Mukund Sivaraman
7b9234f394 Indent code to Tinyproxy coding style
The modified files were indented with GNU indent using the
following command:

indent -npro -kr -i8 -ts8 -sob -l80 -ss -cs -cp1 -bs -nlps -nprs -pcs \
    -saf -sai -saw -sc -cdw -ce -nut -il0

No other changes of any sort were made.
2009-09-15 01:11:25 +05:30
Mukund Sivaraman
a21cd7e3ed Rename tinyproxy.[ch] to main.[ch] 2009-08-07 03:42:53 +05:30
Mukund Sivaraman
024b317de0 Convert tabs to spaces 2008-12-08 13:39:44 +00:00
Mukund Sivaraman
4c1ede779e Break at 80 columns 2008-12-08 12:26:08 +00:00
Mukund Sivaraman
a257703e59 Reformat code to GNU coding style
This is a commit which simply ran all C source code files
through GNU indent. No other modifications were made.
2008-12-01 15:01:11 +00:00
Robert James Kaes
5ea289d82e Moved transparent proxy code into its own file
Extracted the transparent proxy logic from reqs.c and placed it into a
separate file.

Signed-off-by: Robert James Kaes <rjk@wormbytes.ca>
2008-06-09 10:01:14 +05:30