Commit Graph

60 Commits

Author SHA1 Message Date
Matthew Dempsky
b5089fecc7 fix error message formatting
Signed-off-by: Michael Adam <obnox@samba.org>
2009-08-06 07:33:20 +02:00
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
Mukund Sivaraman
448c19077c Don't disable the creation of core files
Creation of core files can be disabled in the OS environment such
as by using the ulimit program.
2008-12-01 14:40:26 +00:00
Mukund Sivaraman
fce253253a Set umask before mkstemp() for some versions of glibc 2008-08-24 11:27:38 +05:30
Mukund Sivaraman
aa95c34004 Allow numeric uid/gids in User and Group directives
This change allows numeric uid/gids to be specified in the User and
Group directives in tinyproxy.conf. Formerly, only username and group
names were accepted. This fixes bug #15, which was created after
looking at a case on the OpenWrt wiki.

X-Banu-Bugzilla-Ids: 15
2008-07-14 17:40:20 +05:30
Mukund Sivaraman
249d4b7f33 Updated copyright, license notices in source code
The notices have been changed to a more GNU look. Documentation
comments have been separated from the copyright header. I've tried to
keep all copyright notices intact. Some author contact details have
been updated.
2008-05-24 13:35:49 +05:30
Robert James Kaes
c0299e1868 * [Indent] Ran Source Through indent
I re-indented the source code using indent with the following options:

indent -kr -bad -bap -nut -i8 -l80 -psl -sob -ss -ncs

There are now _no_ tabs in the source files, and all indentation is
eight spaces.  Lines are 80 characters long, and the procedure type is
on it's own line.  Read the indent manual for more information about
what each option means.
2005-08-15 03:54:31 +00:00
Robert James Kaes
a59117c7ca * Updated Copyright Email Addresses
Updated the copyright email addresses for Robert James Kaes.  The
users.sourceforge.net address should always exist.
2005-07-12 17:39:44 +00:00
Robert James Kaes
019b91c3f9 (takesig): Fixed the return type to use the autoconf defined
RETSIGTYPE.  This is portable, while simply using "void" is not.
2004-08-24 16:36:22 +00:00
Robert James Kaes
93fbb5ff49 Changed the calls to the config_compile() and config_parse()
functions.  Also, if the "logfile" directive is used, it will now
override use of the syslog system.  Added an error message if neither
is defined.
2004-08-14 03:21:28 +00:00
Robert James Kaes
1d2e4fc2c3 Change the code to use the new config_parse() method rather than the
flex/bison based configuration system.
2004-08-13 21:03:11 +00:00
Robert James Kaes
0a8e4e4d8d Added reverse proxy support from Kim Holviala. His comments regarding
this addition follow:

  The patch implements a simple reverse proxy (with one funky extra
  feature). It has all the regular features: mapping remote servers to local
  namespace (ReversePath), disabling forward proxying (ReverseOnly) and HTTP
  redirect rewriting (ReverseBaseURL).

  The funky feature is this: You map Google to /google/ and the Google front
  page opens up fine. Type in stuff and click "Google Search" and you'll get
  an error from tinyproxy. Reason for this is that Google's form submits to
  "/search" which unfortunately bypasses our /google/ mapping (if they'd
  submit to "search" without the slash it would have worked ok). Turn on
  ReverseMagic and it starts working....

  ReverseMagic "hijacks" one cookie which it sends to the client browser.
  This cookie contains the current reverse proxy path mapping (in the above
  case /google/) so that even if the site uses absolute links the reverse
  proxy still knows where to map the request.

  And yes, it works. No, I've never seen this done before - I couldn't find
  _any_ working OSS reverse proxies, and the commercial ones I've seen try
  to parse the page and fix all links (in the above case changing "/search"
  to "/google/search"). The problem with modifying the html is that it might
  not be parsable (very common) or it might be encoded so that the proxy
  can't read it (mod_gzip or likes).

  Hope you like that patch. One caveat - I haven't coded with C in like
  three years so my code might be a bit messy.... There shouldn't be any
  security problems thou, but you never know. I did all the stuff out of my
  memory without reading any RFC's, but I tested everything with Moz, Konq,
  IE6, Links and Lynx and they all worked fine.
2004-01-26 19:11:52 +00:00
Robert James Kaes
63a7914830 # Moved the location of the "initializing" log message to below the
processing of the command line options.
2003-03-17 04:24:19 +00:00
Robert James Kaes
badd237fe6 # Added variables to config structure to keep track of the files to be
displayed for various HTTP errors and the stats page. [Steven Young]
2003-03-13 21:32:33 +00:00
Robert James Kaes
20d3008c38 (main): Removed duplicate code calling the filter_destroy() function.
Once is enough.  [Detected by John M Wright]
2003-02-26 22:37:38 +00:00
Robert James Kaes
abbf826445 (display_usage): Removed the output line mentioning that regular
expression support was included.  It will be there always.
2003-01-27 18:44:43 +00:00
Robert James Kaes
0a20bdd5b4 Removed the "bool_t" type since it conflicts with the newer C standards.
The type was just replaced by "unsigned int" types.
2002-12-04 17:06:14 +00:00
Robert James Kaes
22df8c29e4 (main): Check to see if the PID file was created successfully, and if
not report this to the user and close the program.
2002-11-21 21:52:59 +00:00
Robert James Kaes
3b2be8ae88 Removed all the code supporting the TCP tunnelling feature of
tinyproxy.  There is really no need for this code, since there are
perfectly good programs out there (like rinetd) which are designed for
TCP tunnelling.  tinyproxy should be a good HTTP proxy, nothing more,
and nothing less; therefore, the tunnelling code is gone.
2002-11-03 17:10:33 +00:00
Robert James Kaes
1d39f204ca Fixed up the storing and sending of the internal tinyproxy logs prior
to when the log file is created.  Also, the log file is created with
the proper owner permissions.
2002-10-03 20:53:11 +00:00
Robert James Kaes
f8b5fe53e7 (main): Fixed up a bug reported by Oswald Buddenha where the log file was being initially created with the initial user's permissions, which is obviously a problem if tinyproxy is not running as the initial user. This is now fixed by delaying the creation of the log file until _after_ tinyproxy has been switched to the user it will run as. Confused yet? 2002-07-12 17:02:02 +00:00
Robert James Kaes
ac5d67c11a Renamed the "log_rotation_request" boolean to "received_sighup".
(main): Removed the log file creation code because it has been moved into the log.c file.  Also, removed the explicit fclose() for the log file since it will be close when the program has exited.
2002-06-15 17:35:03 +00:00
Robert James Kaes
06d38ce529 (display_usage): Added a message indicating whether transparent proxy support has been compiled in. 2002-06-06 20:28:02 +00:00
Robert James Kaes
e340b3371b The log file is now opened in "append" mode so that you can restart tinyproxy without losing the log file. 2002-05-31 18:24:36 +00:00
Robert James Kaes
d64dfc5d77 Some spelling fixes. 2002-05-27 01:58:41 +00:00
Robert James Kaes
514182a05f (display_license): Updated the copyright dates
(main): Moved the signals around so that the appropriate signal is assigned to either the children or just the parrent process.
Updated the copyright on the file.
2002-05-27 00:46:24 +00:00
Robert James Kaes
a67fb30bdf Removed all the code relating to the DNS API (dnsclient.h) as it's no
longer needed with the new pre-forked model.
2002-05-26 18:52:23 +00:00
Robert James Kaes
391a408eee Fixed a tonne of spelling mistakes. 2002-05-24 04:45:32 +00:00
Robert James Kaes
16386fbb70 Added a new signal handler to handle SIGCHLD signals because of the new
dnsserver child process.

Changed the set signal calls to use our new set_signal_handler() function.

Added code to start the "dnsserver" child process.
2002-05-23 18:27:01 +00:00
Robert James Kaes
89ada2df28 Moved bind_address inside the config structure. 2002-04-24 16:45:45 +00:00
Robert James Kaes
2ec7a4dd72 The log_message() function now stores the messages if the configuration
file has not been read yet.  The reason for this is that we don't know
where to log the messgaes until _after_ the config file has been
processed.
2002-04-22 19:34:20 +00:00
Robert James Kaes
9a8d732a13 Changed all calls to strdup to safestrdup. This should provide better
memory usage tracking.
2002-04-18 17:59:21 +00:00
Robert James Kaes
43860d2469 Moved the filter_destroy() logic from inside the signal handler. It's now
been moved to inside the main() function.
2002-04-18 17:04:04 +00:00
Robert James Kaes
5822ec3d44 Moved the log rotation code out of the signal handler and into it's own
function.  The signal handler now simply sets a flag which is monitored
inside the thread_main_loop() function.  The log rotation code has also
been tightened to handle any error conditions better.  Credit to Petr
Lampa for suggesting that system functions inside of a signal handler is
bad magic.
2002-04-18 16:57:06 +00:00
Robert James Kaes
0d66719c5a Just moved the looping code from main() into thread_main_loop(). 2002-04-08 21:35:10 +00:00
Robert James Kaes
1d52d9d510 Updated the copyright notice. 2002-04-07 21:36:39 +00:00
Robert James Kaes
1819c0f818 Added code to check for "errors" from the accept call in thread_main() and
also a new thread_kill_threads() function which should cancel all threads
when the main thread is being closed.
2002-01-25 00:01:45 +00:00
Robert James Kaes
831b00dc7a Made the error message regarding the Idle timeout more verbose, and
changed the level to WARNING.
2001-12-23 22:00:36 +00:00
Robert James Kaes
75ab2c8de3 Removed the include "dnscache.h" header file. 2001-12-15 06:02:16 +00:00
Robert James Kaes
787ece6c01 Reformated text. 2001-11-22 00:31:10 +00:00
Robert James Kaes
4ac03908fc Header reorganization. Basically all system headers are now included in
tinyproxy.h and all the other files include the tinyproxy.h header. This
moves all the dependancy issues into one file.
2001-10-25 17:27:39 +00:00
Robert James Kaes
490754594e Added a check to make sure the Upstream and Tunnel directives are not both
set in the configuration file.
2001-09-16 20:11:54 +00:00
Robert James Kaes
4619035cd2 Fixed a problem where log messages could be missed during a rotate. 2001-09-16 05:38:27 +00:00
Robert James Kaes
d3213f193c Changed to rotating the log file instead of truncating it. Also using the
create_file_safely() function to eliminate potential security problems.
2001-09-15 21:29:22 +00:00
Robert James Kaes
1a9dc4e7e8 Error message cleanup. 2001-09-07 04:21:07 +00:00
Robert James Kaes
d06ddc50ab Removed the new_dnscache() call. 2001-08-29 04:01:05 +00:00
Robert James Kaes
5530451545 Renamed versiondisp() to display_version() and added the PACKAGE, VERSION,
and TARGET_SYSTEM into the version list. Also moved the license into a
separate function. Renamed usagedisp() to display_usage(). Fixed a problem
where the anonymous search tree was being created _after_ it was being
accessed.
2001-08-26 21:17:30 +00:00
Robert James Kaes
f43404aeef Removed the DEFAULT_LOG, DEFAULT_PORT, and DEFAULT_USER directives since
these MUST be set in the configuration file.
2001-06-04 23:30:34 +00:00