diff -Nru privoxy-3.0.17/acconfig.h privoxy-3.0.19/acconfig.h
--- privoxy-3.0.17/acconfig.h 2009-12-16 08:35:13.000000000 +0000
+++ privoxy-3.0.19/acconfig.h 2011-09-04 11:10:32.000000000 +0000
@@ -5,7 +5,7 @@
* File : $Source: /cvsroot/ijbswa/current/acconfig.h,v $
*
* Purpose : This file should be the first thing included in every
- * .c file. (Before even system headers). It contains
+ * .c file. (Before even system headers). It contains
* #define statements for various features. It was
* introduced because the compile command line started
* getting ludicrously long with feature defines.
@@ -14,10 +14,10 @@
* Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
- * by and Copyright (C) 1997 Anonymous Coders and
+ * by and Copyright (C) 1997 Anonymous Coders and
* Junkbusters Corporation. http://www.junkbusters.com
*
- * This program is free software; you can redistribute it
+ * This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
* Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at
@@ -64,7 +64,7 @@
*/
#undef CODE_STATUS
-/*
+/*
* Should pcre be statically built in instead of linkling with libpcre?
* (This is determined by configure depending on the availiability of
* libpcre and user preferences). The name is ugly, but pcre needs it.
@@ -72,7 +72,7 @@
*/
#undef STATIC_PCRE
-/*
+/*
* Should pcrs be statically built in instead of linkling with libpcrs?
* (This is determined by configure depending on the availiability of
* libpcrs and user preferences).
@@ -136,14 +136,14 @@
* User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
* Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, * / *
*
- * And no, I haven't got that backwards - IE is being wierd.
+ * And no, I haven't got that backwards - IE is being weird.
*
- * Known limitations:
+ * Known limitations:
* 1) If you press shift-reload on a blocked HTML page, you get
* the image "blocked" page, not the HTML "blocked" page.
- * 2) Once an image "blocked" page has been sent, viewing it
+ * 2) Once an image "blocked" page has been sent, viewing it
* in it's own browser window *should* bring up the HTML
- * "blocked" page, but it doesn't. You need to clear the
+ * "blocked" page, but it doesn't. You need to clear the
* browser cache to get the HTML version again.
*
* These limitations are due to IE making inconsistent choices
@@ -237,7 +237,7 @@
#undef HAVE_GMTIME_R
#undef HAVE_LOCALTIME_R
-/* Define to 'int' if doesn't have it.
+/* Define to 'int' if doesn't have it.
*/
#undef socklen_t
@@ -287,7 +287,7 @@
/*
* It's too easy to accidentally use a Cygwin or MinGW32 version of config.h
- * under VC++, and it usually gives many wierd error messages. Let's make
+ * under VC++, and it usually gives many weird error messages. Let's make
* the error messages understandable, by bailing out now.
*/
#ifdef _MSC_VER
diff -Nru privoxy-3.0.17/actionlist.h privoxy-3.0.19/actionlist.h
--- privoxy-3.0.17/actionlist.h 2009-06-21 19:21:10.000000000 +0000
+++ privoxy-3.0.19/actionlist.h 2011-11-06 11:38:51.000000000 +0000
@@ -12,14 +12,14 @@
* DEFINE_ACTION_BOOL()
* DEFINE_ACTION_ALIAS
*
- * Copyright : Written by and Copyright (C) 2001-2008 the SourceForge
+ * Copyright : Written by and Copyright (C) 2001-2008 the
* Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
- * by and Copyright (C) 1997 Anonymous Coders and
+ * by and Copyright (C) 1997 Anonymous Coders and
* Junkbusters Corporation. http://www.junkbusters.com
*
- * This program is free software; you can redistribute it
+ * This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
* Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at
@@ -71,9 +71,11 @@
DEFINE_CGI_PARAM_RADIO ("deanimate-gifs", ACTION_DEANIMATE, ACTION_STRING_DEANIMATE, "first", 0)
DEFINE_CGI_PARAM_RADIO ("deanimate-gifs", ACTION_DEANIMATE, ACTION_STRING_DEANIMATE, "last", 1)
DEFINE_ACTION_BOOL ("downgrade-http-version", ACTION_DOWNGRADE)
+#ifdef FEATURE_FAST_REDIRECTS
DEFINE_ACTION_STRING ("fast-redirects", ACTION_FAST_REDIRECTS, ACTION_STRING_FAST_REDIRECTS)
DEFINE_CGI_PARAM_RADIO ("fast-redirects", ACTION_FAST_REDIRECTS, ACTION_STRING_FAST_REDIRECTS, "simple-check", 0)
DEFINE_CGI_PARAM_RADIO ("fast-redirects", ACTION_FAST_REDIRECTS, ACTION_STRING_FAST_REDIRECTS, "check-decoded-url", 1)
+#endif /* def FEATURE_FAST_REDIRECTS */
DEFINE_ACTION_MULTI ("filter", ACTION_MULTI_FILTER)
DEFINE_ACTION_BOOL ("force-text-mode", ACTION_FORCE_TEXT_MODE)
DEFINE_ACTION_STRING ("forward-override", ACTION_FORWARD_OVERRIDE, ACTION_STRING_FORWARD_OVERRIDE)
@@ -119,19 +121,19 @@
#if DEFINE_ACTION_ALIAS
-/*
+/*
* Alternative spellings
*/
DEFINE_ACTION_STRING ("hide-referer", ACTION_HIDE_REFERER, ACTION_STRING_REFERER)
DEFINE_ACTION_BOOL ("prevent-keeping-cookies", ACTION_NO_COOKIE_KEEP)
-/*
+/*
* Pre-3.0.7 (pseudo) compatibility
*/
DEFINE_ACTION_MULTI ("filter-client-headers", ACTION_MULTI_CLIENT_HEADER_FILTER)
DEFINE_ACTION_MULTI ("filter-server-headers", ACTION_MULTI_SERVER_HEADER_FILTER)
-/*
+/*
* Pre-3.0 compatibility
*/
DEFINE_ACTION_BOOL ("no-cookie-read", ACTION_NO_COOKIE_READ)
diff -Nru privoxy-3.0.17/actions.c privoxy-3.0.19/actions.c
--- privoxy-3.0.17/actions.c 2010-05-30 12:02:59.000000000 +0000
+++ privoxy-3.0.19/actions.c 2011-09-18 14:43:07.000000000 +0000
@@ -1,4 +1,4 @@
-const char actions_rcs[] = "$Id: actions.c,v 1.59 2010/05/26 23:01:47 ler762 Exp $";
+const char actions_rcs[] = "$Id: actions.c,v 1.73 2011/09/18 14:43:07 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/actions.c,v $
@@ -6,7 +6,7 @@
* Purpose : Declares functions to work with actions files
* Functions declared include: FIXME
*
- * Copyright : Written by and Copyright (C) 2001-2008 the SourceForge
+ * Copyright : Written by and Copyright (C) 2001-2011 the
* Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
@@ -434,7 +434,7 @@
*********************************************************************/
static int action_used_to_be_valid(const char *action)
{
- static const char *formerly_valid_actions[] = {
+ static const char * const formerly_valid_actions[] = {
"inspect-jpegs",
"kill-popups",
"send-vanilla-wafer",
@@ -522,7 +522,7 @@
if ((value == NULL) || (*value == '\0'))
{
- if (0 != strcmpic(action->name, "block"))
+ if (0 == strcmpic(action->name, "+block"))
{
/*
* XXX: Temporary backwards compatibility hack.
@@ -1033,6 +1033,108 @@
return 0;
}
+
+/*********************************************************************
+ *
+ * Function : referenced_filters_are_missing
+ *
+ * Description : Checks if any filters of a certain type referenced
+ * in an action spec are missing.
+ *
+ * Parameters :
+ * 1 : csp = Current client state (buffers, headers, etc...)
+ * 2 : cur_action = The action spec to check.
+ * 3 : multi_index = The index where to look for the filter.
+ * 4 : filter_type = The filter type the caller is interested in.
+ *
+ * Returns : 0 => All referenced filters exists, everything else is an error.
+ *
+ *********************************************************************/
+static int referenced_filters_are_missing(const struct client_state *csp,
+ const struct action_spec *cur_action, int multi_index, enum filter_type filter_type)
+{
+ int i;
+ struct file_list *fl;
+ struct re_filterfile_spec *b;
+ struct list_entry *filtername;
+
+ for (filtername = cur_action->multi_add[multi_index]->first;
+ filtername; filtername = filtername->next)
+ {
+ int filter_found = 0;
+ for (i = 0; i < MAX_AF_FILES; i++)
+ {
+ fl = csp->rlist[i];
+ if ((NULL == fl) || (NULL == fl->f))
+ {
+ continue;
+ }
+
+ for (b = fl->f; b; b = b->next)
+ {
+ if (b->type != filter_type)
+ {
+ continue;
+ }
+ if (strcmp(b->name, filtername->str) == 0)
+ {
+ filter_found = 1;
+ }
+ }
+ }
+ if (!filter_found)
+ {
+ log_error(LOG_LEVEL_ERROR, "Missing filter '%s'", filtername->str);
+ return 1;
+ }
+ }
+
+ return 0;
+
+}
+
+
+/*********************************************************************
+ *
+ * Function : action_spec_is_valid
+ *
+ * Description : Should eventually figure out if an action spec
+ * is valid, but currently only checks that the
+ * referenced filters are accounted for.
+ *
+ * Parameters :
+ * 1 : csp = Current client state (buffers, headers, etc...)
+ * 2 : cur_action = The action spec to check.
+ *
+ * Returns : 0 => No problems detected, everything else is an error.
+ *
+ *********************************************************************/
+static int action_spec_is_valid(struct client_state *csp, const struct action_spec *cur_action)
+{
+ struct {
+ int multi_index;
+ enum filter_type filter_type;
+ } filter_map[] = {
+ {ACTION_MULTI_FILTER, FT_CONTENT_FILTER},
+ {ACTION_MULTI_CLIENT_HEADER_FILTER, FT_CLIENT_HEADER_FILTER},
+ {ACTION_MULTI_SERVER_HEADER_FILTER, FT_SERVER_HEADER_FILTER},
+ {ACTION_MULTI_CLIENT_HEADER_TAGGER, FT_CLIENT_HEADER_TAGGER},
+ {ACTION_MULTI_SERVER_HEADER_TAGGER, FT_SERVER_HEADER_TAGGER}
+ };
+ int errors = 0;
+ int i;
+
+ for (i = 0; i < SZ(filter_map); i++)
+ {
+ errors += referenced_filters_are_missing(csp, cur_action,
+ filter_map[i].multi_index, filter_map[i].filter_type);
+ }
+
+ return errors;
+
+}
+
+
/*********************************************************************
*
* Function : load_one_actions_file
@@ -1055,23 +1157,24 @@
* Note: Keep these in the order they occur in the file, they are
* sometimes tested with <=
*/
-#define MODE_START_OF_FILE 1
-#define MODE_SETTINGS 2
-#define MODE_DESCRIPTION 3
-#define MODE_ALIAS 4
-#define MODE_ACTIONS 5
-
- int mode = MODE_START_OF_FILE;
+ enum {
+ MODE_START_OF_FILE = 1,
+ MODE_SETTINGS = 2,
+ MODE_DESCRIPTION = 3,
+ MODE_ALIAS = 4,
+ MODE_ACTIONS = 5
+ } mode;
FILE *fp;
struct url_actions *last_perm;
struct url_actions *perm;
- char buf[BUFFER_SIZE];
+ char *buf;
struct file_list *fs;
struct action_spec * cur_action = NULL;
int cur_action_used = 0;
struct action_alias * alias_list = NULL;
unsigned long linenum = 0;
+ mode = MODE_START_OF_FILE;
if (!check_file_changed(current_actions_file[fileid], csp->config->actions_file[fileid], &fs))
{
@@ -1104,7 +1207,7 @@
log_error(LOG_LEVEL_INFO, "Loading actions file: %s", csp->config->actions_file[fileid]);
- while (read_config_line(buf, sizeof(buf), fp, &linenum) != NULL)
+ while (read_config_line(fp, &linenum, &buf) != NULL)
{
if (*buf == '{')
{
@@ -1120,7 +1223,7 @@
/* too short */
fclose(fp);
log_error(LOG_LEVEL_FATAL,
- "can't load actions file '%s': invalid line (%lu): %s",
+ "can't load actions file '%s': invalid line (%lu): %s",
csp->config->actions_file[fileid], linenum, buf);
return 1; /* never get here */
}
@@ -1221,11 +1324,11 @@
{
/* It's an actions block */
- char actions_buf[BUFFER_SIZE];
+ char *actions_buf;
char * end;
/* set mode */
- mode = MODE_ACTIONS;
+ mode = MODE_ACTIONS;
/* free old action */
if (cur_action)
@@ -1248,8 +1351,23 @@
}
init_action(cur_action);
- /* trim { */
- strlcpy(actions_buf, buf + 1, sizeof(actions_buf));
+ /*
+ * Copy the buffer before messing with it as we may need the
+ * unmodified version in for the fatal error messages. Given
+ * that this is not a common event, we could instead simply
+ * read the line again.
+ *
+ * buf + 1 to skip the leading '{'
+ */
+ actions_buf = strdup(buf + 1);
+ if (actions_buf == NULL)
+ {
+ fclose(fp);
+ log_error(LOG_LEVEL_FATAL,
+ "can't load actions file '%s': out of memory",
+ csp->config->actions_file[fileid]);
+ return 1; /* never get here */
+ }
/* check we have a trailing } and then trim it */
end = actions_buf + strlen(actions_buf) - 1;
@@ -1257,8 +1375,9 @@
{
/* No closing } */
fclose(fp);
- log_error(LOG_LEVEL_FATAL,
- "can't load actions file '%s': invalid line (%lu): %s",
+ freez(actions_buf);
+ log_error(LOG_LEVEL_FATAL, "can't load actions file '%s': "
+ "Missing trailing '}' in action section starting at line (%lu): %s",
csp->config->actions_file[fileid], linenum, buf);
return 1; /* never get here */
}
@@ -1271,11 +1390,21 @@
{
/* error */
fclose(fp);
- log_error(LOG_LEVEL_FATAL,
- "can't load actions file '%s': invalid line (%lu): %s",
+ freez(actions_buf);
+ log_error(LOG_LEVEL_FATAL, "can't load actions file '%s': "
+ "can't completely parse the action section starting at line (%lu): %s",
csp->config->actions_file[fileid], linenum, buf);
return 1; /* never get here */
}
+
+ if (action_spec_is_valid(csp, cur_action))
+ {
+ log_error(LOG_LEVEL_ERROR, "Invalid action section in file '%s', "
+ "starting at line %lu: %s",
+ csp->config->actions_file[fileid], linenum, buf);
+ }
+
+ freez(actions_buf);
}
}
else if (mode == MODE_SETTINGS)
@@ -1299,8 +1428,8 @@
csp->config->actions_file[fileid]);
return 1; /* never get here */
}
-
- num_fields = ssplit(version_string, ".", fields, 3, TRUE, FALSE);
+
+ num_fields = ssplit(version_string, ".", fields, SZ(fields), TRUE, FALSE);
if (num_fields < 1 || atoi(fields[0]) == 0)
{
@@ -1409,7 +1538,7 @@
}
else if (mode == MODE_ACTIONS)
{
- /* it's a URL pattern */
+ /* it's an URL pattern */
/* allocate a new node */
if ((perm = zalloc(sizeof(*perm))) == NULL)
@@ -1429,7 +1558,7 @@
{
fclose(fp);
log_error(LOG_LEVEL_FATAL,
- "can't load actions file '%s': line %lu: cannot create URL pattern from: %s",
+ "can't load actions file '%s': line %lu: cannot create URL or TAG pattern from: %s",
csp->config->actions_file[fileid], linenum, buf);
return 1; /* never get here */
}
@@ -1443,7 +1572,7 @@
/* oops - please have a {} line as 1st line in file. */
fclose(fp);
log_error(LOG_LEVEL_FATAL,
- "can't load actions file '%s': first needed line (%lu) is invalid: %s",
+ "can't load actions file '%s': line %lu should begin with a '{': %s",
csp->config->actions_file[fileid], linenum, buf);
return 1; /* never get here */
}
@@ -1456,6 +1585,7 @@
csp->config->actions_file[fileid], mode);
return 1; /* never get here */
}
+ freez(buf);
}
fclose(fp);
@@ -1489,7 +1619,7 @@
*
* Description : Converts a actionsfile entry from the internal
* structure into a text line. The output is split
- * into one line for each action with line continuation.
+ * into one line for each action with line continuation.
*
* Parameters :
* 1 : action = The action to format.
@@ -1574,7 +1704,7 @@
* Function : actions_to_html
*
* Description : Converts a actionsfile entry from numeric form
- * ("mask" and "add") to a -seperated HTML string
+ * ("mask" and "add") to a -separated HTML string
* in which each action is linked to its chapter in
* the user manual.
*
@@ -1680,12 +1810,12 @@
*
* Function : current_actions_to_html
*
- * Description : Converts a curren action spec to a seperated HTML
+ * Description : Converts a curren action spec to a separated HTML
* text in which each action is linked to its chapter in
* the user manual.
*
* Parameters :
- * 1 : csp = Client state (for config)
+ * 1 : csp = Client state (for config)
* 2 : action = Current action spec to be converted
*
* Returns : A string. Caller must free it.
diff -Nru privoxy-3.0.17/actions.h privoxy-3.0.19/actions.h
--- privoxy-3.0.17/actions.h 2009-06-21 19:21:10.000000000 +0000
+++ privoxy-3.0.19/actions.h 2011-09-04 11:10:56.000000000 +0000
@@ -1,6 +1,6 @@
#ifndef ACTIONS_H_INCLUDED
#define ACTIONS_H_INCLUDED
-#define ACTIONS_H_VERSION "$Id: actions.h,v 1.19 2009/05/16 13:27:20 fabiankeil Exp $"
+#define ACTIONS_H_VERSION "$Id: actions.h,v 1.20 2011/09/04 11:10:56 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/actions.h,v $
@@ -12,10 +12,10 @@
* Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
- * by and Copyright (C) 1997 Anonymous Coders and
+ * by and Copyright (C) 1997 Anonymous Coders and
* Junkbusters Corporation. http://www.junkbusters.com
*
- * This program is free software; you can redistribute it
+ * This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
* Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at
@@ -56,27 +56,27 @@
};
-extern jb_err get_actions (char *line,
+extern jb_err get_actions (char *line,
struct action_alias * alias_list,
struct action_spec *cur_action);
extern void free_alias_list(struct action_alias *alias_list);
extern void init_action(struct action_spec *dest);
extern void free_action(struct action_spec *src);
-extern jb_err merge_actions (struct action_spec *dest,
+extern jb_err merge_actions (struct action_spec *dest,
const struct action_spec *src);
#if 0
extern int update_action_bits_for_all_tags(struct client_state *csp);
#endif
extern int update_action_bits_for_tag(struct client_state *csp, const char *tag);
-extern jb_err copy_action (struct action_spec *dest,
+extern jb_err copy_action (struct action_spec *dest,
const struct action_spec *src);
extern char * actions_to_text (const struct action_spec *action);
extern char * actions_to_html (const struct client_state *csp,
const struct action_spec *action);
extern void init_current_action (struct current_action_spec *dest);
extern void free_current_action (struct current_action_spec *src);
-extern jb_err merge_current_action (struct current_action_spec *dest,
+extern jb_err merge_current_action (struct current_action_spec *dest,
const struct action_spec *src);
extern char * current_action_to_html(const struct client_state *csp,
const struct current_action_spec *action);
diff -Nru privoxy-3.0.17/amiga.c privoxy-3.0.19/amiga.c
--- privoxy-3.0.17/amiga.c 2009-06-21 19:21:10.000000000 +0000
+++ privoxy-3.0.19/amiga.c 2011-09-04 11:10:56.000000000 +0000
@@ -1,4 +1,4 @@
-const char amiga_rcs[] = "$Id: amiga.c,v 1.13 2009/05/16 13:27:20 fabiankeil Exp $";
+const char amiga_rcs[] = "$Id: amiga.c,v 1.14 2011/09/04 11:10:56 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/amiga.c,v $
@@ -8,7 +8,7 @@
* Copyright : Written by and Copyright (C) 2001 the SourceForge
* Privoxy team. http://www.privoxy.org/
*
- * This program is free software; you can redistribute it
+ * This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
* Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at
diff -Nru privoxy-3.0.17/amiga.h privoxy-3.0.19/amiga.h
--- privoxy-3.0.17/amiga.h 2009-06-21 19:21:10.000000000 +0000
+++ privoxy-3.0.19/amiga.h 2011-09-04 11:10:56.000000000 +0000
@@ -1,7 +1,7 @@
#ifdef AMIGA
#ifndef AMIGA_H_INCLUDED
#define AMIGA_H_INCLUDED
-#define AMIGA_H_VERSION "$Id: amiga.h,v 1.13 2009/05/16 13:27:20 fabiankeil Exp $"
+#define AMIGA_H_VERSION "$Id: amiga.h,v 1.14 2011/09/04 11:10:56 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/amiga.h,v $
@@ -11,7 +11,7 @@
* Copyright : Written by and Copyright (C) 2001 the SourceForge
* Privoxy team. http://www.privoxy.org/
*
- * This program is free software; you can redistribute it
+ * This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
* Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at
diff -Nru privoxy-3.0.17/AUTHORS privoxy-3.0.19/AUTHORS
--- privoxy-3.0.17/AUTHORS 2010-02-15 15:48:12.000000000 +0000
+++ privoxy-3.0.19/AUTHORS 2011-12-26 18:42:00.000000000 +0000
@@ -7,8 +7,6 @@
David Schmidt, developer
Hal Burgiss
- Mark Miller
- Gerry Murphy
Lee Rian
Roland Rosenfeld
@@ -27,6 +25,8 @@
Adam Lock
Guy Laroche
Justin McMurtry
+ Mark Miller
+ Gerry Murphy
Andreas Oesterhelt
Haroon Rafique
Georg Sauthoff
@@ -51,6 +51,7 @@
Clifford Caoile
Wan-Teh Chang
Frédéric Crozat
+ Billy Crook
Michael T. Davis
Mattes Dolak
Matthias Drochner
@@ -75,9 +76,11 @@
Bert van Leeuwen
Don Libes
Paul Lieverse
+ Han Liu
Toby Lyward
Wil Mahan
Jindrich Makovicka
+ Raphael Marichez
Francois Marier
David Mediavilla
Raphael Moll
@@ -91,6 +94,7 @@
Chung-chieh Shan
Spinor S.
Bart Schelstraete
+ Dan Stahlke
Oliver Stoeneberg
Peter Thoenen
Martin Thomas
diff -Nru privoxy-3.0.17/cgi.c privoxy-3.0.19/cgi.c
--- privoxy-3.0.17/cgi.c 2010-05-24 11:38:22.000000000 +0000
+++ privoxy-3.0.19/cgi.c 2011-10-08 17:31:05.000000000 +0000
@@ -1,4 +1,4 @@
-const char cgi_rcs[] = "$Id: cgi.c,v 1.129 2010/05/24 11:38:22 fabiankeil Exp $";
+const char cgi_rcs[] = "$Id: cgi.c,v 1.145 2011/10/08 17:31:05 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgi.c,v $
@@ -7,18 +7,18 @@
* html or gif answers, and to compose HTTP resonses.
* This only contains the framework functions, the
* actual handler functions are declared elsewhere.
- *
+ *
* Functions declared include:
- *
+ *
*
* Copyright : Written by and Copyright (C) 2001-2004, 2006-2008
* the SourceForge Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
- * by and Copyright (C) 1997 Anonymous Coders and
+ * by and Copyright (C) 1997 Anonymous Coders and
* Junkbusters Corporation. http://www.junkbusters.com
*
- * This program is free software; you can redistribute it
+ * This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
* Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at
@@ -49,6 +49,10 @@
#include
#include
+#ifdef FEATURE_COMPRESSION
+#include
+#endif
+
#include "project.h"
#include "cgi.h"
#include "list.h"
@@ -81,126 +85,126 @@
"Privoxy main page",
TRUE },
#ifdef FEATURE_GRACEFUL_TERMINATION
- { "die",
- cgi_die,
+ { "die",
+ cgi_die,
"Shut down - Do not deploy this build in a production environment, "
"this is a one click Denial Of Service attack!!!",
- FALSE },
+ FALSE },
#endif
- { "show-status",
- cgi_show_status,
+ { "show-status",
+ cgi_show_status,
#ifdef FEATURE_CGI_EDIT_ACTIONS
"View & change the current configuration",
#else
"View the current configuration",
#endif
- TRUE },
- { "show-version",
- cgi_show_version,
+ TRUE },
+ { "show-version",
+ cgi_show_version,
"View the source code version numbers",
- TRUE },
- { "show-request",
- cgi_show_request,
+ TRUE },
+ { "show-request",
+ cgi_show_request,
"View the request headers",
- TRUE },
+ TRUE },
{ "show-url-info",
- cgi_show_url_info,
+ cgi_show_url_info,
"Look up which actions apply to a URL and why",
TRUE },
#ifdef FEATURE_TOGGLE
{ "toggle",
- cgi_toggle,
+ cgi_toggle,
"Toggle Privoxy on or off",
FALSE },
#endif /* def FEATURE_TOGGLE */
#ifdef FEATURE_CGI_EDIT_ACTIONS
{ "edit-actions", /* Edit the actions list */
- cgi_edit_actions,
+ cgi_edit_actions,
NULL, FALSE },
{ "eaa", /* Shortcut for edit-actions-add-url-form */
- cgi_edit_actions_add_url_form,
+ cgi_edit_actions_add_url_form,
NULL, FALSE },
{ "eau", /* Shortcut for edit-actions-url-form */
- cgi_edit_actions_url_form,
+ cgi_edit_actions_url_form,
NULL, FALSE },
{ "ear", /* Shortcut for edit-actions-remove-url-form */
- cgi_edit_actions_remove_url_form,
+ cgi_edit_actions_remove_url_form,
NULL, FALSE },
{ "eal", /* Shortcut for edit-actions-list */
- cgi_edit_actions_list,
+ cgi_edit_actions_list,
NULL, FALSE },
{ "eafu", /* Shortcut for edit-actions-for-url */
- cgi_edit_actions_for_url,
+ cgi_edit_actions_for_url,
NULL, FALSE },
{ "eas", /* Shortcut for edit-actions-submit */
- cgi_edit_actions_submit,
+ cgi_edit_actions_submit,
NULL, FALSE },
{ "easa", /* Shortcut for edit-actions-section-add */
- cgi_edit_actions_section_add,
+ cgi_edit_actions_section_add,
NULL, FALSE },
{ "easr", /* Shortcut for edit-actions-section-remove */
- cgi_edit_actions_section_remove,
+ cgi_edit_actions_section_remove,
NULL, FALSE },
{ "eass", /* Shortcut for edit-actions-section-swap */
- cgi_edit_actions_section_swap,
+ cgi_edit_actions_section_swap,
NULL, FALSE },
{ "edit-actions-for-url",
- cgi_edit_actions_for_url,
+ cgi_edit_actions_for_url,
NULL, FALSE /* Edit the actions for (a) specified URL(s) */ },
{ "edit-actions-list",
- cgi_edit_actions_list,
+ cgi_edit_actions_list,
NULL, TRUE /* Edit the actions list */ },
{ "edit-actions-submit",
- cgi_edit_actions_submit,
+ cgi_edit_actions_submit,
NULL, FALSE /* Change the actions for (a) specified URL(s) */ },
{ "edit-actions-url",
- cgi_edit_actions_url,
+ cgi_edit_actions_url,
NULL, FALSE /* Change a URL pattern in the actionsfile */ },
{ "edit-actions-url-form",
- cgi_edit_actions_url_form,
+ cgi_edit_actions_url_form,
NULL, FALSE /* Form to change a URL pattern in the actionsfile */ },
{ "edit-actions-add-url",
- cgi_edit_actions_add_url,
+ cgi_edit_actions_add_url,
NULL, FALSE /* Add a URL pattern to the actionsfile */ },
{ "edit-actions-add-url-form",
- cgi_edit_actions_add_url_form,
+ cgi_edit_actions_add_url_form,
NULL, FALSE /* Form to add a URL pattern to the actionsfile */ },
{ "edit-actions-remove-url",
- cgi_edit_actions_remove_url,
+ cgi_edit_actions_remove_url,
NULL, FALSE /* Remove a URL pattern from the actionsfile */ },
{ "edit-actions-remove-url-form",
- cgi_edit_actions_remove_url_form,
+ cgi_edit_actions_remove_url_form,
NULL, FALSE /* Form to remove a URL pattern from the actionsfile */ },
{ "edit-actions-section-add",
- cgi_edit_actions_section_add,
+ cgi_edit_actions_section_add,
NULL, FALSE /* Remove a section from the actionsfile */ },
{ "edit-actions-section-remove",
- cgi_edit_actions_section_remove,
+ cgi_edit_actions_section_remove,
NULL, FALSE /* Remove a section from the actionsfile */ },
{ "edit-actions-section-swap",
- cgi_edit_actions_section_swap,
+ cgi_edit_actions_section_swap,
NULL, FALSE /* Swap two sections in the actionsfile */ },
#endif /* def FEATURE_CGI_EDIT_ACTIONS */
- { "error-favicon.ico",
- cgi_send_error_favicon,
+ { "error-favicon.ico",
+ cgi_send_error_favicon,
NULL, TRUE /* Sends the favicon image for error pages. */ },
- { "favicon.ico",
- cgi_send_default_favicon,
+ { "favicon.ico",
+ cgi_send_default_favicon,
NULL, TRUE /* Sends the default favicon image. */ },
- { "robots.txt",
- cgi_robots_txt,
- NULL, TRUE /* Sends a robots.txt file to tell robots to go away. */ },
+ { "robots.txt",
+ cgi_robots_txt,
+ NULL, TRUE /* Sends a robots.txt file to tell robots to go away. */ },
{ "send-banner",
- cgi_send_banner,
+ cgi_send_banner,
NULL, TRUE /* Send a built-in image */ },
{ "send-stylesheet",
- cgi_send_stylesheet,
+ cgi_send_stylesheet,
NULL, FALSE /* Send templates/cgi-style.css */ },
{ "t",
- cgi_transparent_image,
+ cgi_transparent_image,
NULL, TRUE /* Send a transparent image (short name) */ },
{ "url-info-osd.xml",
- cgi_send_url_info_osd,
+ cgi_send_url_info_osd,
NULL, TRUE /* Send templates/url-info-osd.xml */ },
{ "user-manual",
cgi_send_user_manual,
@@ -267,6 +271,13 @@
const size_t image_pattern_length = sizeof(image_pattern_data) - 1;
const size_t image_blank_length = sizeof(image_blank_data) - 1;
+#ifdef FEATURE_COMPRESSION
+/*
+ * Minimum length which a buffer has to reach before
+ * we bother to (re-)compress it. Completely arbitrary.
+ */
+const size_t LOWER_LENGTH_LIMIT_FOR_COMPRESSION = 1024U;
+#endif
static struct http_response cgi_error_memory_response[1];
@@ -276,7 +287,7 @@
/*********************************************************************
- *
+ *
* Function : dispatch_cgi
*
* Description : Checks if a request URL has either the magical
@@ -338,7 +349,7 @@
return NULL;
}
- /*
+ /*
* This is a CGI call.
*/
@@ -383,7 +394,7 @@
/*********************************************************************
- *
+ *
* Function : referrer_is_safe
*
* Description : Decides whether we trust the Referer for
@@ -431,7 +442,7 @@
}
/*********************************************************************
- *
+ *
* Function : dispatch_known_cgi
*
* Description : Processes a CGI once dispatch_cgi has determined that
@@ -469,7 +480,7 @@
{
query_args_start++;
}
- if (*query_args_start == '/')
+ if (*query_args_start == '/')
{
*query_args_start++ = '\0';
if ((param_list = new_map()))
@@ -504,7 +515,7 @@
return cgi_error_memory();
}
- /*
+ /*
* Find and start the right CGI function
*/
d = cgi_dispatchers;
@@ -547,7 +558,9 @@
if (err && (err != JB_ERR_MEMORY))
{
/* Unexpected error! Shouldn't get here */
- log_error(LOG_LEVEL_ERROR, "Unexpected CGI error %d in top-level handler. Please file a bug report!", err);
+ log_error(LOG_LEVEL_ERROR,
+ "Unexpected CGI error %d in top-level handler. "
+ "Please file a bug report!", err);
err = cgi_error_unknown(csp, rsp, err);
}
if (!err)
@@ -566,8 +579,8 @@
d++;
}
}
-
-
+
+
/*********************************************************************
*
* Function : parse_cgi_parameters
@@ -593,7 +606,7 @@
return NULL;
}
- /*
+ /*
* IE 5 does, of course, violate RFC 2316 Sect 4.1 and sends
* the fragment identifier along with the request, so we must
* cut it off here, so it won't pollute the CGI params:
@@ -762,7 +775,7 @@
assert(name);
assert(pvalue);
- *pvalue = 0;
+ *pvalue = 0;
param = lookup(parameters, name);
if (!*param)
@@ -854,7 +867,7 @@
if (!err) err = map(exports, "host", 1, html_encode(csp->http->host), 0);
if (!err) err = map(exports, "hostport", 1, html_encode(csp->http->hostport), 0);
if (!err) err = map(exports, "path", 1, html_encode_and_free_original(path), 0);
- if (!err) err = map(exports, "protocol", 1, csp->http->ssl ? "https://" : "http://", 1);
+ if (!err) err = map(exports, "protocol", 1, csp->http->ssl ? "https://" : "http://", 1);
if (!err)
{
err = map(exports, "host-ip", 1, html_encode(csp->http->host_ip_addr_str), 0);
@@ -1037,17 +1050,17 @@
"Content-Type: text/html\r\n"
"\r\n";
cgi_error_memory_response->body =
- "\r\n"
- "\r\n"
- " 500 Internal Privoxy Error\r\n"
+ "\n"
+ "\n"
+ " 500 Internal Privoxy Error\n"
" "
- "\r\n"
- "\r\n"
- "
500 Internal Privoxy Error
\r\n"
- "
Privoxy ran out of memory while processing your request.
\r\n"
- "
Please contact your proxy administrator, or try again later
\r\n"
- "\r\n"
- "\r\n";
+ "\n"
+ "\n"
+ "
500 Internal Privoxy Error
\n"
+ "
Privoxy ran out of memory while processing your request.
\n"
+ "
Please contact your proxy administrator, or try again later
\n"
+ "\n"
+ "\n";
cgi_error_memory_response->head_length =
strlen(cgi_error_memory_response->head);
@@ -1085,7 +1098,7 @@
*
* Description : Almost-CGI function that is called if a template
* cannot be loaded. Note this is not a true CGI,
- * it takes a template name rather than a map of
+ * it takes a template name rather than a map of
* parameters.
*
* Parameters :
@@ -1095,7 +1108,7 @@
* be loaded.
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err cgi_error_no_template(const struct client_state *csp,
@@ -1105,18 +1118,18 @@
static const char status[] =
"500 Internal Privoxy Error";
static const char body_prefix[] =
- "\r\n"
- "\r\n"
- " 500 Internal Privoxy Error\r\n"
+ "\n"
+ "\n"
+ " 500 Internal Privoxy Error\n"
" "
- "\r\n"
- "\r\n"
- "
500 Internal Privoxy Error
\r\n"
- "
Privoxy encountered an error while processing your request:
\r\n"
+ "\n"
+ "\n"
+ "
500 Internal Privoxy Error
\n"
+ "
Privoxy encountered an error while processing your request:
\n"
"
Could not load template file ";
static const char body_suffix[] =
- " or one of its included components.
\r\n"
- "
Please contact your proxy administrator.
\r\n"
+ " or one of its included components.
\n"
+ "
Please contact your proxy administrator.
\n"
"
If you are the proxy administrator, please put the required file(s)"
"in the (confdir)/templates directory. The "
"location of the (confdir) directory "
@@ -1125,9 +1138,9 @@
#ifndef _WIN32
", or /etc/privoxy/"
#endif /* ndef _WIN32 */
- ").
\r\n"
- "\r\n"
- "\r\n";
- char errnumbuf[30];
- /*
- * Due to sizeof(errnumbuf), body_size will be slightly
- * bigger than necessary but it doesn't really matter.
- */
- const size_t body_size = strlen(body_prefix) + sizeof(errnumbuf) + strlen(body_suffix) + 1;
+ "file a bug report.\n"
+ "\n"
+ "\n";
+ /* Includes room for larger error numbers in the future. */
+ const size_t body_size = sizeof(body_prefix) + sizeof(body_suffix) + 5;
assert(csp);
assert(rsp);
@@ -1226,16 +1235,13 @@
rsp->is_static = 0;
rsp->crunch_reason = INTERNAL_ERROR;
- snprintf(errnumbuf, sizeof(errnumbuf), "%d", error_to_report);
-
rsp->body = malloc(body_size);
if (rsp->body == NULL)
{
return JB_ERR_MEMORY;
}
- strlcpy(rsp->body, body_prefix, body_size);
- strlcat(rsp->body, errnumbuf, body_size);
- strlcat(rsp->body, body_suffix, body_size);
+
+ snprintf(rsp->body, body_size, "%s%d%s", body_prefix, error_to_report, body_suffix);
rsp->status = strdup(status);
if (rsp->status == NULL)
@@ -1253,7 +1259,7 @@
*
* Description : CGI function that is called if the parameters
* (query string) for a CGI were wrong.
- *
+ *
* Parameters :
* 1 : csp = Current client state (buffers, headers, etc...)
* 2 : rsp = http_response data structure for output
@@ -1261,7 +1267,7 @@
* CGI Parameters : none
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err cgi_error_bad_param(const struct client_state *csp,
@@ -1283,7 +1289,7 @@
/*********************************************************************
*
- * Function : cgi_redirect
+ * Function : cgi_redirect
*
* Description : CGI support function to generate a HTTP redirect
* message
@@ -1295,7 +1301,7 @@
* CGI Parameters : None
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err cgi_redirect (struct http_response * rsp, const char *target)
@@ -1330,8 +1336,8 @@
* FIXME: I currently only work for actions, and would
* like to be generalized for other topics.
*
- * Parameters :
- * 1 : item = item (will NOT be free()d.)
+ * Parameters :
+ * 1 : item = item (will NOT be free()d.)
* It is assumed to be HTML-safe.
* 2 : config = The current configuration.
*
@@ -1376,7 +1382,7 @@
* HTTP header - e.g.:
* "Sun, 06 Nov 1994 08:49:37 GMT"
*
- * Parameters :
+ * Parameters :
* 1 : time_offset = Time returned will be current time
* plus this number of seconds.
* 2 : buf = Destination for result.
@@ -1389,12 +1395,6 @@
*********************************************************************/
void get_http_time(int time_offset, char *buf, size_t buffer_size)
{
- static const char day_names[7][4] =
- { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
- static const char month_names[12][4] =
- { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
-
struct tm *t;
time_t current_time;
#if defined(HAVE_GMTIME_R)
@@ -1419,17 +1419,7 @@
t = gmtime(¤t_time);
#endif
- /* Format: "Sun, 06 Nov 1994 08:49:37 GMT" */
- snprintf(buf, buffer_size,
- "%s, %02d %s %4d %02d:%02d:%02d GMT",
- day_names[t->tm_wday],
- t->tm_mday,
- month_names[t->tm_mon],
- t->tm_year + 1900,
- t->tm_hour,
- t->tm_min,
- t->tm_sec
- );
+ strftime(buf, buffer_size, "%a, %d %b %Y %H:%M:%S GMT", t);
}
@@ -1479,6 +1469,63 @@
}
+
+#ifdef FEATURE_COMPRESSION
+/*********************************************************************
+ *
+ * Function : compress_buffer
+ *
+ * Description : Compresses the content of a buffer with zlib's deflate
+ * Allocates a new buffer for the result, free'ing it is
+ * up to the caller.
+ *
+ * Parameters :
+ * 1 : buffer = buffer whose content should be compressed
+ * 2 : buffer_length = length of the buffer
+ * 3 : compression_level = compression level for compress2()
+ *
+ * Returns : NULL on error, otherwise a pointer to the compressed
+ * content of the input buffer.
+ *
+ *********************************************************************/
+char *compress_buffer(char *buffer, size_t *buffer_length, int compression_level)
+{
+ char *compressed_buffer;
+ uLongf new_length;
+ assert(-1 <= compression_level && compression_level <= 9);
+
+ /* Let zlib figure out the maximum length of the compressed data */
+ new_length = compressBound((uLongf)*buffer_length);
+
+ compressed_buffer = malloc(new_length);
+ if (NULL == compressed_buffer)
+ {
+ log_error(LOG_LEVEL_FATAL,
+ "Out of memory allocation compression buffer.");
+ }
+
+ if (Z_OK != compress2((Bytef *)compressed_buffer, &new_length,
+ (Bytef *)buffer, *buffer_length, compression_level))
+ {
+ log_error(LOG_LEVEL_ERROR,
+ "compress2() failed. Buffer size: %d, compression level: %d.",
+ new_length, compression_level);
+ freez(compressed_buffer);
+ return NULL;
+ }
+
+ log_error(LOG_LEVEL_RE_FILTER,
+ "Compressed content from %d to %d bytes. Compression level: %d",
+ *buffer_length, new_length, compression_level);
+
+ *buffer_length = (size_t)new_length;
+
+ return compressed_buffer;
+
+}
+#endif
+
+
/*********************************************************************
*
* Function : finish_http_response
@@ -1508,7 +1555,7 @@
return rsp;
}
- /*
+ /*
* Fill in the HTTP Status, using HTTP/1.1
* unless the client asked for HTTP/1.0.
*/
@@ -1517,13 +1564,31 @@
rsp->status ? rsp->status : "200 OK");
err = enlist_first(rsp->headers, buf);
- /*
+ /*
* Set the Content-Length
*/
if (rsp->content_length == 0)
{
rsp->content_length = rsp->body ? strlen(rsp->body) : 0;
}
+
+#ifdef FEATURE_COMPRESSION
+ if (!err && (csp->flags & CSP_FLAG_CLIENT_SUPPORTS_DEFLATE)
+ && (rsp->content_length > LOWER_LENGTH_LIMIT_FOR_COMPRESSION))
+ {
+ char *compressed_content;
+
+ compressed_content = compress_buffer(rsp->body, &rsp->content_length,
+ csp->config->compression_level);
+ if (NULL != compressed_content)
+ {
+ freez(rsp->body);
+ rsp->body = compressed_content;
+ err = enlist_unique_header(rsp->headers, "Content-Encoding", "deflate");
+ }
+ }
+#endif
+
if (!err)
{
snprintf(buf, sizeof(buf), "Content-Length: %d", (int)rsp->content_length);
@@ -1565,7 +1630,7 @@
* Last-Modified: set to date/time the page was last changed.
* Expires: set to date/time page next needs reloading.
* Cache-Control: set to "no-cache" if applicable.
- *
+ *
* See http://www.w3.org/Protocols/rfc2068/rfc2068
*/
if (rsp->is_static)
@@ -1641,7 +1706,7 @@
err = enlist_unique_header(rsp->headers, "Connection", "close");
}
- /*
+ /*
* Write the head
*/
if (err || (NULL == (rsp->head = list_to_text(rsp->headers))))
@@ -1721,11 +1786,11 @@
* following an #include statament
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
* JB_ERR_FILE if the template file cannot be read
*
*********************************************************************/
-jb_err template_load(const struct client_state *csp, char **template_ptr,
+jb_err template_load(const struct client_state *csp, char **template_ptr,
const char *templatename, int recursive)
{
jb_err err;
@@ -1807,7 +1872,7 @@
}
free(full_path);
- /*
+ /*
* Read the file, ignoring comments, and honoring #include
* statements, unless we're already called recursively.
*
@@ -1862,7 +1927,7 @@
* HTML template by replacing @name@ with value using
* pcrs, for each item in the output map.
*
- * Note that a leading '$' charachter in the export map's
+ * Note that a leading '$' character in the export map's
* values will be stripped and toggle on backreference
* interpretation.
*
@@ -1895,7 +1960,7 @@
file_buffer = *template_ptr;
size = strlen(file_buffer) + 1;
- /*
+ /*
* Assemble pcrs joblist from exports map
*/
for (m = exports->first; m != NULL; m = m->next)
@@ -1913,7 +1978,7 @@
else
{
/*
- * Treat the "replace with" text as a literal string -
+ * Treat the "replace with" text as a literal string -
* no quoting needed, no backreferences allowed.
* ("Trivial" ['T'] flag).
*/
@@ -1927,7 +1992,7 @@
/* Make and run job. */
job = pcrs_compile(buf, m->value, flags, &error);
- if (job == NULL)
+ if (job == NULL)
{
if (error == PCRS_ERR_NOMEM)
{
@@ -1954,10 +2019,10 @@
if (error < 0)
{
- /*
+ /*
* Substitution failed, keep the original buffer,
* log the problem and ignore it.
- *
+ *
* The user might see some unresolved @CGI_VARIABLES@,
* but returning a special CGI error page seems unreasonable
* and could mask more important error messages.
@@ -2009,7 +2074,7 @@
struct http_response *rsp)
{
jb_err err;
-
+
assert(csp);
assert(templatename);
assert(exports);
@@ -2054,6 +2119,7 @@
struct map * exports;
int local_help_exists = 0;
char *ip_address = NULL;
+ char *port = NULL;
char *hostname = NULL;
assert(csp);
@@ -2066,12 +2132,12 @@
if (csp->config->hostname)
{
- get_host_information(csp->cfd, &ip_address, NULL);
+ get_host_information(csp->cfd, &ip_address, &port, NULL);
hostname = strdup(csp->config->hostname);
}
else
{
- get_host_information(csp->cfd, &ip_address, &hostname);
+ get_host_information(csp->cfd, &ip_address, &port, &hostname);
}
err = map(exports, "version", 1, html_encode(VERSION), 0);
@@ -2079,6 +2145,8 @@
if (!err) err = map(exports, "time", 1, html_encode(buf), 0);
if (!err) err = map(exports, "my-ip-address", 1, html_encode(ip_address ? ip_address : "unknown"), 0);
freez(ip_address);
+ if (!err) err = map(exports, "my-port", 1, html_encode(port ? port : "unkown"), 0);
+ freez(port);
if (!err) err = map(exports, "my-hostname", 1, html_encode(hostname ? hostname : "unknown"), 0);
freez(hostname);
if (!err) err = map(exports, "homepage", 1, html_encode(HOME_PAGE_URL), 0);
@@ -2103,9 +2171,6 @@
if (!err) err = map_block_killer(exports, "can-toggle");
#endif
- snprintf(buf, sizeof(buf), "%d", csp->config->hport);
- if (!err) err = map(exports, "my-port", 1, buf, 1);
-
if(!strcmp(CODE_STATUS, "stable"))
{
if (!err) err = map_block_killer(exports, "unstable");
@@ -2156,12 +2221,12 @@
* "if--start.*if--end" to the given
* export list.
*
- * Parameters :
+ * Parameters :
* 1 : exports = map to extend
* 2 : name = name of conditional block
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err map_block_killer(struct map *exports, const char *name)
@@ -2185,12 +2250,12 @@
* by map-block-killer, to save a few bytes.
* i.e. removes "@if--start@" and "@if--end@"
*
- * Parameters :
+ * Parameters :
* 1 : exports = map to extend
* 2 : name = name of conditional block
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err map_block_keep(struct map *exports, const char *name)
@@ -2231,13 +2296,13 @@
* The control structure and one of the alternatives
* will be hidden.
*
- * Parameters :
+ * Parameters :
* 1 : exports = map to extend
* 2 : name = name of conditional block
* 3 : choose_first = nonzero for first, zero for second.
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err map_conditional(struct map *exports, const char *name, int choose_first)
@@ -2269,7 +2334,7 @@
*
* Function : make_menu
*
- * Description : Returns an HTML-formatted menu of the available
+ * Description : Returns an HTML-formatted menu of the available
* unhidden CGIs, excluding the one given in
* and the toggle CGI if toggling is disabled.
*
@@ -2277,7 +2342,7 @@
* 1 : self = name of CGI to leave out, can be NULL for
* complete listing.
* 2 : feature_flags = feature bitmap from csp->config
- *
+ *
*
* Returns : menu string, or NULL on out-of-memory error.
*
@@ -2318,7 +2383,7 @@
html_encoded_prefix = html_encode(CGI_PREFIX);
if (html_encoded_prefix == NULL)
{
- return NULL;
+ return NULL;
}
else
{
diff -Nru privoxy-3.0.17/cgiedit.c privoxy-3.0.19/cgiedit.c
--- privoxy-3.0.17/cgiedit.c 2009-06-21 19:21:11.000000000 +0000
+++ privoxy-3.0.19/cgiedit.c 2011-11-18 16:47:08.000000000 +0000
@@ -1,4 +1,4 @@
-const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.67 2009/05/19 17:46:24 fabiankeil Exp $";
+const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.71 2011/11/18 16:47:08 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgiedit.c,v $
@@ -85,10 +85,10 @@
{
/** Next entry in the linked list */
struct file_line * next;
-
+
/** The raw data, to write out if this line is unmodified. */
char * raw;
-
+
/** Comments and/or whitespace to put before this line if it's modified
and then written out. */
char * prefix;
@@ -97,7 +97,7 @@
are performed on the data read from file before it's stored here, so
it will be a single line of data. */
char * unprocessed;
-
+
/** The type of data on this line. One of the FILE_LINE_xxx constants. */
int type;
@@ -321,15 +321,10 @@
static jb_err map_copy_parameter_html(struct map *out,
const struct map *in,
const char *name);
-#if 0 /* unused function */
-static jb_err map_copy_parameter_url(struct map *out,
- const struct map *in,
- const char *name);
-#endif /* unused function */
-
-static jb_err get_file_name_param(struct client_state *csp,
- const struct map *parameters,
- const char *param_name,
+
+static jb_err get_file_name_param(struct client_state *csp,
+ const struct map *parameters,
+ const char *param_name,
const char **pfilename);
/* Internal convenience functions */
@@ -433,56 +428,6 @@
}
-#if 0 /* unused function */
-/*********************************************************************
- *
- * Function : map_copy_parameter_url
- *
- * Description : Copy a CGI parameter from one map to another, URL
- * encoding it.
- *
- * Parameters :
- * 1 : out = target map
- * 2 : in = source map
- * 3 : name = name of cgi parameter to copy
- *
- * Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory
- * JB_ERR_CGI_PARAMS if the parameter doesn't exist
- * in the source map
- *
- *********************************************************************/
-static jb_err map_copy_parameter_url(struct map *out,
- const struct map *in,
- const char *name)
-{
- const char * value;
- jb_err err;
-
- assert(out);
- assert(in);
- assert(name);
-
- value = lookup(in, name);
- err = map(out, name, 1, url_encode(value), 0);
-
- if (err)
- {
- /* Out of memory */
- return err;
- }
- else if (*value == '\0')
- {
- return JB_ERR_CGI_PARAMS;
- }
- else
- {
- return JB_ERR_OK;
- }
-}
-#endif /* 0 - unused function */
-
-
/*********************************************************************
*
* Function : cgi_edit_actions_url_form
@@ -707,7 +652,7 @@
if (cur_line->type == FILE_LINE_ACTION)
{
section_start_line_number = line_number;
- }
+ }
cur_line = cur_line->next;
}
@@ -1483,7 +1428,7 @@
if (rval)
{
/* Out of memory or empty file. */
- /* Note that empty file is not an error we propogate up */
+ /* Note that empty file is not an error we propagate up */
free(cur_line);
return ((rval == JB_ERR_FILE) ? JB_ERR_OK : rval);
}
@@ -1734,7 +1679,7 @@
{
log_error(LOG_LEVEL_INFO,
"Timestamp mismatch limit reached, turning CGI editor off. "
- "Reload the configuration file to reenable it.");
+ "Reload the configuration file to re-enable it.");
csp->config->feature_flags &= ~RUNTIME_FEATURE_CGI_EDIT_ACTIONS;
}
}
@@ -2873,7 +2818,7 @@
if (!err) err = actions_to_radio(exports, cur_line->data.action);
/*
- * XXX: Some browsers (at least IE6 and IE7) have an artifical URL
+ * XXX: Some browsers (at least IE6 and IE7) have an artificial URL
* length limitation and ignore clicks on the Submit buttons if
* the resulting GET URL would be longer than their limit.
*
@@ -2882,7 +2827,7 @@
* browsers (BR #1570678).
*
* The config option split-large-forms works around this browser
- * bug (HTTP has no URL lenght limitation) by deviding the action
+ * bug (HTTP has no URL length limitation) by deviding the action
* list form into multiple smaller ones. It means the URLs are shorter
* and work in broken browsers as well, but the user can no longer change
* all actions with one submit.
@@ -3415,7 +3360,7 @@
if (cur_line->type == FILE_LINE_ACTION)
{
section_start_line_number = line_number;
- }
+ }
cur_line = cur_line->next;
line_number++;
}
@@ -4183,7 +4128,7 @@
*
* Description : Converts a string into a form JavaScript will like.
*
- * Netscape 4's JavaScript sucks - it doesn't use
+ * Netscape 4's JavaScript sucks - it doesn't use
* "id" parameters, so you have to set the "name"
* used to submit a form element to something JavaScript
* will like. (Or access the elements by index in an
diff -Nru privoxy-3.0.17/cgiedit.h privoxy-3.0.19/cgiedit.h
--- privoxy-3.0.17/cgiedit.h 2009-06-21 19:21:11.000000000 +0000
+++ privoxy-3.0.19/cgiedit.h 2011-09-04 11:10:56.000000000 +0000
@@ -1,23 +1,23 @@
#ifndef CGIEDIT_H_INCLUDED
#define CGIEDIT_H_INCLUDED
-#define CGIEDIT_H_VERSION "$Id: cgiedit.h,v 1.11 2009/05/16 13:27:20 fabiankeil Exp $"
+#define CGIEDIT_H_VERSION "$Id: cgiedit.h,v 1.12 2011/09/04 11:10:56 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgiedit.h,v $
*
* Purpose : CGI-based actionsfile editor.
- *
+ *
* Functions declared include:
- *
+ *
*
* Copyright : Written by and Copyright (C) 2001 the SourceForge
* Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
- * by and Copyright (C) 1997 Anonymous Coders and
+ * by and Copyright (C) 1997 Anonymous Coders and
* Junkbusters Corporation. http://www.junkbusters.com
*
- * This program is free software; you can redistribute it
+ * This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
* Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at
diff -Nru privoxy-3.0.17/cgi.h privoxy-3.0.19/cgi.h
--- privoxy-3.0.17/cgi.h 2009-06-21 19:21:10.000000000 +0000
+++ privoxy-3.0.19/cgi.h 2011-09-04 11:10:56.000000000 +0000
@@ -1,24 +1,24 @@
#ifndef CGI_H_INCLUDED
#define CGI_H_INCLUDED
-#define CGI_H_VERSION "$Id: cgi.h,v 1.37 2009/06/11 11:44:25 fabiankeil Exp $"
+#define CGI_H_VERSION "$Id: cgi.h,v 1.41 2011/09/04 11:10:56 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgi.h,v $
*
* Purpose : Declares functions to intercept request, generate
* html or gif answers, and to compose HTTP resonses.
- *
+ *
* Functions declared include:
- *
+ *
*
* Copyright : Written by and Copyright (C) 2001-2009 the
* Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
- * by and Copyright (C) 1997 Anonymous Coders and
+ * by and Copyright (C) 1997 Anonymous Coders and
* Junkbusters Corporation. http://www.junkbusters.com
*
- * This program is free software; you can redistribute it
+ * This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
* Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at
@@ -69,7 +69,7 @@
extern jb_err map_block_keep (struct map *exports, const char *name);
extern jb_err map_conditional (struct map *exports, const char *name, int choose_first);
-extern jb_err template_load(const struct client_state *csp, char ** template_ptr,
+extern jb_err template_load(const struct client_state *csp, char ** template_ptr,
const char *templatename, int recursive);
extern jb_err template_fill(char ** template_ptr, const struct map *exports);
extern jb_err template_fill_for_cgi(const struct client_state *csp,
@@ -101,6 +101,14 @@
const char **pparam);
extern char get_char_param(const struct map *parameters,
const char *param_name);
+#ifdef FEATURE_COMPRESSION
+/*
+ * Minimum length which a buffer has to reach before
+ * we bother to (re-)compress it. Completely arbitrary.
+ */
+extern const size_t LOWER_LENGTH_LIMIT_FOR_COMPRESSION;
+extern char *compress_buffer(char *buffer, size_t *buffer_length, int compression_level);
+#endif
/*
* Text generators
diff -Nru privoxy-3.0.17/cgisimple.c privoxy-3.0.19/cgisimple.c
--- privoxy-3.0.17/cgisimple.c 2010-03-28 18:02:22.000000000 +0000
+++ privoxy-3.0.19/cgisimple.c 2011-09-04 11:10:56.000000000 +0000
@@ -1,22 +1,22 @@
-const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.99 2010/03/28 18:02:22 fabiankeil Exp $";
+const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.111 2011/09/04 11:10:56 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $
*
* Purpose : Simple CGIs to get information about Privoxy's
* status.
- *
+ *
* Functions declared include:
- *
*
- * Copyright : Written by and Copyright (C) 2001-2010 the
+ *
+ * Copyright : Written by and Copyright (C) 2001-2011 the
* Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
- * by and Copyright (C) 1997 Anonymous Coders and
+ * by and Copyright (C) 1997 Anonymous Coders and
* Junkbusters Corporation. http://www.junkbusters.com
*
- * This program is free software; you can redistribute it
+ * This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
* Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at
@@ -80,7 +80,7 @@
* Description : CGI function that is called for the CGI_SITE_1_HOST
* and CGI_SITE_2_HOST/CGI_SITE_2_PATH base URLs.
* Boring - only exports the default exports.
- *
+ *
* Parameters :
* 1 : csp = Current client state (buffers, headers, etc...)
* 2 : rsp = http_response data structure for output
@@ -118,7 +118,7 @@
*
* Description : CGI function that is called if an unknown action was
* given.
- *
+ *
* Parameters :
* 1 : csp = Current client state (buffers, headers, etc...)
* 2 : rsp = http_response data structure for output
@@ -127,7 +127,7 @@
* CGI Parameters : none
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err cgi_error_404(struct client_state *csp,
@@ -165,7 +165,7 @@
* NOTE: Turning this on in a production build
* would be a BAD idea. An EXTREMELY BAD idea.
* In short, don't do it.
- *
+ *
* Parameters :
* 1 : csp = Current client state (buffers, headers, etc...)
* 2 : rsp = http_response data structure for output
@@ -174,13 +174,27 @@
* CGI Parameters : none
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err cgi_die (struct client_state *csp,
struct http_response *rsp,
const struct map *parameters)
{
+ static const char status[] = "200 OK Privoxy shutdown request received";
+ static const char body[] =
+ "\n"
+ "\n"
+ " Privoxy shutdown request received\n"
+ " \n"
+ " \n"
+ "\n"
+ "\n"
+ "
Privoxy shutdown request received
\n"
+ "
Privoxy is going to shut down after the next request.
\n"
+ "\n"
+ "\n";
+
assert(csp);
assert(rsp);
assert(parameters);
@@ -188,12 +202,21 @@
/* quit */
g_terminate = 1;
- /*
- * I don't really care what gets sent back to the browser.
- * Take the easy option - "out of memory" page.
- */
+ csp->flags &= ~CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE;
- return JB_ERR_MEMORY;
+ rsp->content_length = 0;
+ rsp->head_length = 0;
+ rsp->is_static = 0;
+
+ rsp->body = strdup(body);
+ rsp->status = strdup(status);
+
+ if ((rsp->body == NULL) || (rsp->status == NULL))
+ {
+ return JB_ERR_MEMORY;
+ }
+
+ return JB_ERR_OK;
}
#endif /* def FEATURE_GRACEFUL_TERMINATION */
@@ -204,7 +227,7 @@
*
* Description : Show the client's request and what sed() would have
* made of it.
- *
+ *
* Parameters :
* 1 : csp = Current client state (buffers, headers, etc...)
* 2 : rsp = http_response data structure for output
@@ -213,7 +236,7 @@
* CGI Parameters : none
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err cgi_show_request(struct client_state *csp,
@@ -231,7 +254,7 @@
{
return JB_ERR_MEMORY;
}
-
+
/*
* Repair the damage done to the IOB by get_header()
*/
@@ -266,7 +289,7 @@
*
* Function : cgi_send_banner
*
- * Description : CGI function that returns a banner.
+ * Description : CGI function that returns a banner.
*
* Parameters :
* 1 : csp = Current client state (buffers, headers, etc...)
@@ -281,7 +304,7 @@
* equivalent).
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err cgi_send_banner(struct client_state *csp,
@@ -294,7 +317,7 @@
* If type is auto, then determine the right thing
* to do from the set-image-blocker action
*/
- if (imagetype == 'a')
+ if (imagetype == 'a')
{
/*
* Default to pattern
@@ -345,14 +368,14 @@
}
#endif /* def FEATURE_IMAGE_BLOCKING */
}
-
+
/*
* Now imagetype is either the non-auto type we were called with,
* or it was auto and has since been determined. In any case, we
* can proceed to actually answering the request by sending a redirect
* or an image as appropriate:
*/
- if (imagetype == 'r')
+ if (imagetype == 'r')
{
rsp->status = strdup("302 Local Redirect from Privoxy");
if (rsp->status == NULL)
@@ -367,7 +390,7 @@
}
else
{
- if ((imagetype == 'b') || (imagetype == 't'))
+ if ((imagetype == 'b') || (imagetype == 't'))
{
rsp->body = bindup(image_blank_data, image_blank_length);
rsp->content_length = image_blank_length;
@@ -409,7 +432,7 @@
* CGI Parameters : None
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err cgi_transparent_image(struct client_state *csp,
@@ -453,7 +476,7 @@
* CGI Parameters : None
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err cgi_send_default_favicon(struct client_state *csp,
@@ -514,7 +537,7 @@
* CGI Parameters : None
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err cgi_send_error_favicon(struct client_state *csp,
@@ -576,7 +599,7 @@
* CGI Parameters : None
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err cgi_send_stylesheet(struct client_state *csp,
@@ -584,7 +607,7 @@
const struct map *parameters)
{
jb_err err;
-
+
assert(csp);
assert(rsp);
@@ -630,7 +653,7 @@
* CGI Parameters : None
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err cgi_send_url_info_osd(struct client_state *csp,
@@ -660,6 +683,48 @@
/*********************************************************************
*
+ * Function : get_content_type
+ *
+ * Description : Use the file extension to guess the content type
+ * header we should use to serve the file.
+ *
+ * Parameters :
+ * 1 : filename = Name of the file whose content type
+ * we care about
+ *
+ * Returns : The guessed content type.
+ *
+ *********************************************************************/
+static const char *get_content_type(const char *filename)
+{
+ int i;
+ struct content_type
+ {
+ const char *extension;
+ const char *content_type;
+ };
+ static const struct content_type content_types[] =
+ {
+ {".css", "text/css"},
+ {".jpg", "image/jpeg"},
+ {".jpeg", "image/jpeg"},
+ {".png", "image/png"},
+ };
+
+ for (i = 0; i < SZ(content_types); i++)
+ {
+ if (strstr(filename, content_types[i].extension))
+ {
+ return content_types[i].content_type;
+ }
+ }
+
+ /* No match by extension, default to html */
+ return "text/html";
+}
+
+/*********************************************************************
+ *
* Function : cgi_send_user_manual
*
* Description : CGI function that sends a file in the user
@@ -674,17 +739,17 @@
* (relative to user-manual from config)
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err cgi_send_user_manual(struct client_state *csp,
struct http_response *rsp,
const struct map *parameters)
{
- const char * filename;
+ const char *filename;
char *full_path;
jb_err err = JB_ERR_OK;
- size_t length;
+ const char *content_type;
assert(csp);
assert(rsp);
@@ -704,17 +769,24 @@
}
get_string_param(parameters, "file", &filename);
- /* Check paramter for hack attempts */
- if (filename && strchr(filename, '/'))
+ if (filename == NULL)
{
- return JB_ERR_CGI_PARAMS;
+ /* It's '/' so serve the index.html if there is one. */
+ filename = "index.html";
}
- if (filename && strstr(filename, ".."))
+ else if (NULL != strchr(filename, '/') || NULL != strstr(filename, ".."))
{
+ /*
+ * We currently only support a flat file
+ * hierarchy for the documentation.
+ */
+ log_error(LOG_LEVEL_ERROR,
+ "Rejecting the request to serve '%s' as it contains '/' or '..'",
+ filename);
return JB_ERR_CGI_PARAMS;
}
- full_path = make_path(csp->config->usermanual, filename ? filename : "index.html");
+ full_path = make_path(csp->config->usermanual, filename);
if (full_path == NULL)
{
return JB_ERR_MEMORY;
@@ -733,29 +805,12 @@
}
freez(full_path);
- /* Guess correct Content-Type based on the filename's ending */
- if (filename)
- {
- length = strlen(filename);
- }
- else
- {
- length = 0;
- }
- if((length>=4) && !strcmp(&filename[length-4], ".css"))
- {
- err = enlist(rsp->headers, "Content-Type: text/css");
- }
- else if((length>=4) && !strcmp(&filename[length-4], ".jpg"))
- {
- err = enlist(rsp->headers, "Content-Type: image/jpeg");
- }
- else
- {
- err = enlist(rsp->headers, "Content-Type: text/html");
- }
+ content_type = get_content_type(filename);
+ log_error(LOG_LEVEL_CGI,
+ "Content-Type guessed for %s: %s", filename, content_type);
+
+ return enlist_unique_header(rsp->headers, "Content-Type", content_type);
- return err;
}
@@ -774,7 +829,7 @@
* CGI Parameters : none
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err cgi_show_version(struct client_state *csp,
@@ -823,7 +878,7 @@
* Default is to show menu and other information.
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err cgi_show_status(struct client_state *csp,
@@ -869,7 +924,7 @@
if (!err) err = map(exports, "options", 1, csp->config->proxy_args, 1);
if (!err) err = show_defines(exports);
- if (err)
+ if (err)
{
free_map(exports);
return JB_ERR_MEMORY;
@@ -913,8 +968,8 @@
#else /* ndef FEATURE_STATISTICS */
err = err || map_block_killer(exports, "statistics");
#endif /* ndef FEATURE_STATISTICS */
-
- /*
+
+ /*
* List all action files in use, together with view and edit links,
* except for standard.action, which should only be viewable. (Not
* enforced in the editor itself)
@@ -955,7 +1010,7 @@
if (!err) err = string_append(&s, "\n");
}
}
- if (*s != '\0')
+ if (*s != '\0')
{
if (!err) err = map(exports, "actions-filenames", 1, s, 0);
}
@@ -964,7 +1019,7 @@
if (!err) err = map(exports, "actions-filenames", 1, "
None specified
", 1);
}
- /*
+ /*
* List all re_filterfiles in use, together with view options.
* FIXME: Shouldn't include hardwired HTML here, use line template instead!
*/
@@ -981,7 +1036,7 @@
if (!err) err = string_append(&s, "\n");
}
}
- if (*s != '\0')
+ if (*s != '\0')
{
if (!err) err = map(exports, "re-filter-filenames", 1, s, 0);
}
@@ -1021,7 +1076,7 @@
return template_fill_for_cgi(csp, "show-status", exports, rsp);
}
-
+
/*********************************************************************
*
* Function : cgi_show_url_info
@@ -1042,7 +1097,7 @@
* the template.
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err cgi_show_url_info(struct client_state *csp,
@@ -1160,7 +1215,7 @@
struct http_request url_to_query[1];
struct current_action_spec action[1];
int i;
-
+
if (map(exports, "url", 1, html_encode(url_param), 0))
{
free(url_param);
@@ -1448,7 +1503,7 @@
* CGI Parameters : None
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
jb_err cgi_robots_txt(struct client_state *csp,
@@ -1496,7 +1551,7 @@
* 1 : exports = map to extend
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
static jb_err show_defines(struct map *exports)
@@ -1521,6 +1576,12 @@
if (!err) err = map_conditional(exports, "FEATURE_CGI_EDIT_ACTIONS", 0);
#endif /* ndef FEATURE_CGI_EDIT_ACTIONS */
+#ifdef FEATURE_COMPRESSION
+ if (!err) err = map_conditional(exports, "FEATURE_COMPRESSION", 1);
+#else /* ifndef FEATURE_COMPRESSION */
+ if (!err) err = map_conditional(exports, "FEATURE_COMPRESSION", 0);
+#endif /* ndef FEATURE_COMPRESSION */
+
#ifdef FEATURE_CONNECTION_KEEP_ALIVE
if (!err) err = map_conditional(exports, "FEATURE_CONNECTION_KEEP_ALIVE", 1);
#else /* ifndef FEATURE_CONNECTION_KEEP_ALIVE */
@@ -1740,7 +1801,7 @@
* Default is to show menu and other information.
*
* Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory error.
+ * JB_ERR_MEMORY on out-of-memory error.
*
*********************************************************************/
static jb_err cgi_show_file(struct client_state *csp,
@@ -1834,7 +1895,7 @@
return JB_ERR_CGI_PARAMS;
}
-
+
/*********************************************************************
*
* Function : load_file
@@ -1861,6 +1922,7 @@
fp = fopen(filename, "rb");
if (NULL == fp)
{
+ log_error(LOG_LEVEL_ERROR, "Failed to open %s: %E", filename);
return JB_ERR_FILE;
}
diff -Nru privoxy-3.0.17/cgisimple.h privoxy-3.0.19/cgisimple.h
--- privoxy-3.0.17/cgisimple.h 2009-06-21 19:21:11.000000000 +0000
+++ privoxy-3.0.19/cgisimple.h 2011-09-04 11:10:56.000000000 +0000
@@ -1,24 +1,24 @@
#ifndef CGISIMPLE_H_INCLUDED
#define CGISIMPLE_H_INCLUDED
-#define CGISIMPLE_H_VERSION "$Id: cgisimple.h,v 1.17 2009/05/16 13:27:20 fabiankeil Exp $"
+#define CGISIMPLE_H_VERSION "$Id: cgisimple.h,v 1.18 2011/09/04 11:10:56 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgisimple.h,v $
*
* Purpose : Declares functions to intercept request, generate
* html or gif answers, and to compose HTTP resonses.
- *
+ *
* Functions declared include:
- *
+ *
*
* Copyright : Written by and Copyright (C) 2001-2007 the SourceForge
* Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
- * by and Copyright (C) 1997 Anonymous Coders and
+ * by and Copyright (C) 1997 Anonymous Coders and
* Junkbusters Corporation. http://www.junkbusters.com
*
- * This program is free software; you can redistribute it
+ * This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
* Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at
diff -Nru privoxy-3.0.17/ChangeLog privoxy-3.0.19/ChangeLog
--- privoxy-3.0.17/ChangeLog 2010-11-13 20:16:07.000000000 +0000
+++ privoxy-3.0.19/ChangeLog 2011-12-26 17:03:47.000000000 +0000
@@ -1,10 +1,375 @@
--------------------------------------------------------------------
ChangeLog for Privoxy
--------------------------------------------------------------------
+*** Version 3.0.19 Stable ***
+
+- Bug fixes:
+ - Prevent a segmentation fault when de-chunking buffered content.
+ It could be triggered by malicious web servers if Privoxy was
+ configured to filter the content and running on a platform
+ where SIZE_T_MAX isn't larger than UINT_MAX, which probably
+ includes most 32-bit systems. On those platforms, all Privoxy
+ versions before 3.0.19 appear to be affected.
+ To be on the safe side, this bug should be presumed to allow
+ code execution as proving that it doesn't seems unrealistic.
+ - Do not expect a response from the SOCKS4/4A server until it
+ got something to respond to. This regression was introduced
+ in 3.0.18 and prevented the SOCKS4/4A negotiation from working.
+ Reported by qqqqqw in #3459781.
+
+- General improvements:
+ - Fix an off-by-one in an error message about connect failures.
+ - Use a GNUMakefile variable for the webserver root directory and
+ update the path. Sourceforge changed it which broke various
+ web-related targets.
+ - Update the CODE_STATUS description.
+
+*** Version 3.0.18 Stable ***
+
+- Bug fixes:
+ - If a generated redirect URL contains characters RFC 3986 doesn't
+ permit, they are (re)encoded. Not doing this makes Privoxy versions
+ from 3.0.5 to 3.0.17 susceptible to HTTP response splitting (CWE-113)
+ attacks if the +fast-redirects{check-decoded-url} action is used.
+ - Fix a logic bug that could cause Privoxy to reuse a server
+ socket after it got tainted by a server-header-tagger-induced
+ block that was triggered before the whole server response had
+ been read. If keep-alive was enabled and the request following
+ the blocked one was to the same host and using the same forwarding
+ settings, Privoxy would send it on the tainted server socket.
+ While the server would simply treat it as a pipelined request,
+ Privoxy would later on fail to properly parse the server's
+ response as it would try to parse the unread data from the
+ first response as server headers for the second one.
+ Regression introduced in 3.0.17.
+ - When implying keep-alive in client_connection(), remember that
+ the client didn't. Fixes a regression introduced in 3.0.13 that
+ would cause Privoxy to wait for additional client requests after
+ receiving a HTTP/1.1 request with "Connection: close" set
+ and connection sharing enabled.
+ With clients which terminates the client connection after detecting
+ that the whole body has been received it doesn't really matter,
+ but with clients that don't the connection would be kept open until
+ it timed out.
+ - Fix a subtle race condition between prepare_csp_for_next_request()
+ and sweep(). A thread preparing itself for the next client request
+ could briefly appear to be inactive.
+ If all other threads were already using more recent files,
+ the thread could get its files swept away under its feet.
+ So far this has only been reproduced while stress testing in
+ valgrind while touching action files in a loop. It's unlikely
+ to have caused any actual problems in the real world.
+ - Disable filters if SDCH compression is used unless filtering is forced.
+ If SDCH was combined with a supported compression algorithm, Privoxy
+ previously could try to decompress it and ditch the Content-Encoding
+ header even though the SDCH compression wasn't dealt with.
+ Reported by zebul666 in #3225863.
+ - Make a copy of the --user value and only mess with that when splitting
+ user and group. On some operating systems modifying the value directly
+ is reflected in the output of ps and friends and can be misleading.
+ Reported by zepard in #3292710.
+ - If forwarded-connect-retries is set, only retry if Privoxy is actually
+ forwarding the request. Previously direct connections would be retried
+ as well.
+ - Fixed a small memory leak when retrying connections with IPv6
+ support enabled.
+ - Remove an incorrect assertion in compile_dynamic_pcrs_job_list()
+ It could be triggered by a pcrs job with an invalid pcre
+ pattern (for example one that contains a lone quantifier).
+ - If the --user argument user[.group] contains a dot, always bail out
+ if no group has been specified. Previously the intended, but undocumented
+ (and apparently untested), behaviour was to try interpreting the whole
+ argument as user name, but the detection was flawed and checked for '0'
+ instead of '\0', thus merely preventing group names beginning with a zero.
+ - In html_code_map[], use a numeric character reference instead of '
+ which wasn't standardized before XHTML 1.0.
+ - Fix an invalid free when compiled with FEATURE_GRACEFUL_TERMINATION
+ and shut down through http://config.privoxy.org/die
+ - In get_actions(), fix the "temporary" backwards compatibility hack
+ to accept block actions without reason.
+ It also covered other actions that should be rejected as invalid.
+ Reported by Billy Crook.
+
+- General improvements:
+ - Privoxy can (re)compress buffered content before delivering
+ it to the client. Disabled by default as most users wouldn't
+ benefit from it.
+ - The +fast-redirects{check-decoded-url} action checks URL
+ segments separately. If there are other parameters behind
+ the redirect URL, this makes it unnecessary to cut them off
+ by additionally using a +redirect{} pcrs command.
+ Initial patch submitted by Jamie Zawinski in #3429848.
+ - When loading action sections, verify that the referenced filters
+ exist. Currently missing filters only result in an error message,
+ but eventually the severity will be upgraded to fatal.
+ - Allow to bind to multiple separate addresses.
+ Patch set submitted by Petr Pisar in #3354485.
+ - Set socket_error to errno if connecting fails in rfc2553_connect_to().
+ Previously rejected direct connections could be incorrectly reported
+ as DNS issues if Privoxy was compiled with IPv6 support.
+ - Adjust url_code_map[] so spaces are replaced with %20 instead of '+'
+ While '+' can be used by client's submitting form data, this is not
+ actually what Privoxy is using the lookups for. This is more of a
+ cosmetic issue and doesn't fix any known problems.
+ - When compiled without FEATURE_FAST_REDIRECTS, do not silently
+ ignore +fast-redirect{} directives
+ - Added a workaround for GNU libc's strptime() reporting negative
+ year values when the parsed year is only specified with two digits.
+ On affected systems cookies with such a date would not be turned
+ into session cookies by the +session-cookies-only action.
+ Reported by Vaeinoe in #3403560
+ - Fixed bind failures with certain GNU libc versions if no non-loopback
+ IP address has been configured on the system. This is mainly an issue
+ if the system is using DHCP and Privoxy is started before the network
+ is completely configured.
+ Reported by Raphael Marichez in #3349356.
+ Additional insight from Petr Pisar.
+ - Privoxy log messages now use the ISO 8601 date format %Y-%m-%d.
+ It's only slightly longer than the old format, but contains
+ the full date including the year and allows sorting by date
+ (when grepping in multiple log files) without hassle.
+ - In get_last_url(), do not bother trying to decode URLs that do
+ not contain at least one '%' sign. It reduces the log noise and
+ a number of unnecessary memory allocations.
+ - In case of SOCKS5 failures, dump the socks response in the log message.
+ - Simplify the signal setup in main().
+ - Streamline socks5_connect() slightly.
+ - In socks5_connect(), require a complete socks response from the server.
+ Previously Privoxy didn't care how much data the server response
+ contained as long as the first two bytes contained the expected
+ values. While at it, shrink the buffer size so Privoxy can't read
+ more than a whole socks response.
+ - In chat(), do not bother to generate a client request in case of
+ direct CONNECT requests. It will not be used anyway.
+ - Reduce server_last_modified()'s stack size.
+ - Shorten get_http_time() by using strftime().
+ - Constify the known_http_methods pointers in unknown_method().
+ - Constify the time_formats pointers in parse_header_time().
+ - Constify the formerly_valid_actions pointers in action_used_to_be_valid().
+ - Introduce a GNUMakefile MAN_PAGE variable that defaults to privoxy.1.
+ The Debian package uses section 8 for the man page and this
+ should simplify the patch.
+ - Deduplicate the INADDR_NONE definition for Solaris by moving it to jbsockets.h
+ - In block_url(), ditch the obsolete workaround for ancient Netscape versions
+ that supposedly couldn't properly deal with status code 403.
+ - Remove a useless NULL pointer check in load_trustfile().
+ - Remove two useless NULL pointer checks in load_one_re_filterfile().
+ - Change url_code_map[] from an array of pointers to an array of arrays
+ It removes an unnecessary layer of indirection and on 64bit system reduces
+ the size of the binary a bit.
+ - Fix various typos. Fixes taken from Debian's 29_typos.dpatch by Roland Rosenfeld.
+ - Add a dok-tidy GNUMakefile target to clean up the messy HTML
+ generated by the other dok targets.
+ - GNUisms in the GNUMakefile have been removed.
+ - Change the HTTP version in static responses to 1.1
+ - Synced config.sub and config.guess with upstream
+ 2011-11-11/386c7218162c145f5f9e1ff7f558a3fbb66c37c5.
+ - Add a dedicated function to parse the values of toggles. Reduces duplicated
+ code in load_config() and provides better error handling. Invalid or missing
+ toggle values are now a fatal error instead of being silently ignored.
+ - Terminate HTML lines in static error messages with \n instead of \r\n.
+ - Simplify cgi_error_unknown() a bit.
+ - In LogPutString(), don't bother looking at pszText when not
+ actually logging anything.
+ - Change ssplit()'s fourth parameter from int to size_t.
+ Fixes a clang complaint.
+ - Add a warning that the statistics currently can't be trusted.
+ Mention Privoxy-Log-Parser's --statistics option as
+ an alternative for the time being.
+ - In rfc2553_connect_to(), start setting cgi->error_message on error.
+ - Change the expected status code returned for http://p.p/die depending
+ on whether or not FEATURE_GRACEFUL_TERMINATION is available.
+ - In cgi_die(), mark the client connection for closing.
+ If the client will fetch the style sheet through another connection
+ it gets the main thread out of the accept() state and should thus
+ trigger the actual shutdown.
+ - Add a proper CGI message for cgi_die().
+ - Don't enforce a logical line length limit in read_config_line().
+ - Slightly refactor server_last_modified() to remove useless gmtime*() calls.
+ - In get_content_type(), also recognize '.jpeg' as JPEG extension.
+ - Add '.png' to the list of recognized file extensions in get_content_type().
+ - In block_url(), consistently use the block reason "Request blocked by Privoxy"
+ In two places the reason was "Request for blocked URL" which hides the
+ fact that the request got blocked by Privoxy and isn't necessarily
+ correct as the block may be due to tags.
+ - In listen_loop(), reload the configuration files after accepting
+ a new connection instead of before.
+ Previously the first connection that arrived after a configuration
+ change would still be handled with the old configuration.
+ - In chat()'s receive-data loop, skip a client socket check if
+ the socket will be written to right away anyway. This can
+ increase the transfer speed for unfiltered content on fast
+ network connections.
+ - The socket timeout is used for SOCKS negotiations as well which
+ previously couldn't timeout.
+ - Don't keep the client connection alive if any configuration file
+ changed since the time the connection came in. This is closer to
+ Privoxy's behaviour before keep-alive support for client connection
+ has been added and also less confusing in general.
+ - Treat all Content-Type header values containing the pattern
+ 'script' as a sign of text. Reported by pribog in #3134970.
+
+- Action file improvements:
+ - Moved the site-specific block pattern section below the one for the
+ generic patterns so for requests that are matched in both, the block
+ reason for the domain is shown which is usually more useful than showing
+ the one for the generic pattern.
+ - Remove -prevent-compression from the fragile alias. It's no longer
+ used anywhere by default and isn't known to break stuff anyway.
+ - Add a (disabled) section to block various Facebook tracking URLs.
+ Reported by Dan Stahlke in #3421764.
+ - Add a (disabled) section to rewrite and redirect click-tracking
+ URLs used on news.google.com.
+ Reported by Dan Stahlke in #3421755.
+ - Unblock linuxcounter.net/.
+ Reported by Dan Stahlke in #3422612.
+ - Block 'www91.intel.com/' which is used by Omniture.
+ Reported by Adam Piggott in #3167370.
+ - Disable the handle-as-empty-doc-returns-ok option and mark it as deprecated.
+ Reminded by tceverling in #2790091.
+ - Add ".ivwbox.de/" to the "Cross-site user tracking" section.
+ Reported by Nettozahler in #3172525.
+ - Unblock and fast-redirect ".awin1.com/.*=http://".
+ Reported by Adam Piggott in #3170921.
+ - Block "b.collective-media.net/".
+ - Widen the Debian popcon exception to "qa.debian.org/popcon".
+ Seen in Debian's 05_default_action.dpatch by Roland Rosenfeld.
+ - Block ".gemius.pl/" which only seems to be used for user tracking.
+ Reported by johnd16 in #3002731. Additional input from Lee and movax.
+ - Disable banners-by-size filters for '.thinkgeek.com/'.
+ The filter only seems to catch pictures of the inventory.
+ - Block requests for 'go.idmnet.bbelements.com/please/showit/'.
+ Reported by kacperdominik in #3372959.
+ - Unblock adainitiative.org/.
+ - Add a fast-redirects exception for '.googleusercontent.com/.*=cache'.
+ - Add a fast-redirects exception for webcache.googleusercontent.com/.
+ - Unblock http://adassier.wordpress.com/ and http://adassier.files.wordpress.com/.
+
+- Filter file improvements:
+ - Let the yahoo filter hide '.ads'.
+ - Let the msn filter hide overlay ads for Facebook 'likes' in search
+ results and elements with the id 's_notf_div'. They only seem to be
+ used to advertise site 'enhancements'.
+ - Let the js-events filter additionally disarm setInterval().
+ Suggested by dg1727 in #3423775.
+
+- Documentation improvements:
+ - Clarify the effect of compiling Privoxy with zlib support.
+ Suggested by dg1727 in #3423782.
+ - Point out that the SourceForge messaging system works like a black
+ hole and should thus not be used to contact individual developers.
+ - Mention some of the problems one can experience when not explicitly
+ configuring an IP addresses as listen address.
+ - Explicitly mention that hostnames can be used instead of IP addresses
+ for the listen-address, that only the first address returned will be
+ used and what happens if the address is invalid.
+ Requested by Calestyo in #3302213.
+
+- Log message improvements:
+ - If only the server connection is kept alive, do not pretend to
+ wait for a new client request.
+ - Remove a superfluous log message in forget_connection().
+ - In chat(), properly report missing server responses as such
+ instead of calling them empty.
+ - In forwarded_connect(), fix a log message nobody should ever see.
+ - Fix a log message in socks5_connect(), a failed write operation
+ was logged as failed read operation.
+ - Let load_one_actions_file() properly complain about a missing
+ '{' at the beginning of the file.
+ Simply stating that a line is invalid isn't particularly helpful.
+ - Do not claim to listen on a socket until Privoxy actually does.
+ Patch submitted by Petr Pisar #3354485
+ - Prevent a duplicated LOG_LEVEL_CLF message when sending out
+ the "no-server-data" response.
+ - Also log the client socket when dropping a connection.
+ - Include the destination host in the 'Request ... marked for
+ blocking. limit-connect{...} doesn't allow CONNECT ...' message
+ Patch submitted by Saperski in #3296250.
+ - Prevent a duplicated log message if none of the resolved IP
+ addresses were reachable.
+ - In connect_to(), do not pretend to retry if forwarded-connect-retries
+ is zero or unset.
+ - When a specified user or group can't be found, put the name in
+ single-quotes when logging it.
+ - In rfc2553_connect_to(), explain getnameinfo() errors better.
+ - Remove a useless log message in chat().
+ - When retrying to connect, also log the maximum number of connection
+ attempts.
+ - Rephrase a log message in compile_dynamic_pcrs_job_list().
+ Divide the error code and its meaning with a colon. Call the pcrs
+ job dynamic and not the filter. Filters may contain dynamic and
+ non-dynamic pcrs jobs at the same time. Only mention the name of
+ the filter or tagger, but don't claim it's a filter when it could
+ be a tagger.
+ - In a fatal error message in load_one_actions_file(), cover both
+ URL and TAG patterns.
+ - In pcrs_strerror(), properly report unknown positive error code
+ values as such. Previously they were handled like 0 (no error).
+ - In compile_dynamic_pcrs_job_list(), also log the actual error code as
+ pcrs_strerror() doesn't handle all errors reported by pcre.
+ - Don't bother trying to continue chatting if the client didn't ask for it.
+ Reduces log noise a bit.
+ - Make two fatal error message in load_one_actions_file() more descriptive.
+ - In cgi_send_user_manual(), log when rejecting a file name due to '/' or '..'.
+ - In load_file(), log a message if opening a file failed.
+ The CGI error message alone isn't too helpful.
+ - In connection_destination_matches(), improve two log messages
+ to help understand why the destinations don't match.
+ - Rephrase a log message in serve(). Client request arrival
+ should be differentiated from closed client connections now.
+ - In serve(), log if a client connection isn't reused due to a
+ configuration file change.
+ - Let mark_server_socket_tainted() always mark the server socket tainted,
+ just don't talk about it in cases where it has no effect. It doesn't change
+ Privoxy's behaviour, but makes understanding the log file easier.
+
+- configure:
+ - Added a --disable-ipv6-support switch for platforms where support
+ is detected but doesn't actually work.
+ - Do not check for the existence of strerror() and memmove() twice
+ - Remove a useless test for setpgrp(2). Privoxy doesn't need it and
+ it can cause problems when cross-compiling.
+ - Rename the --disable-acl-files switch to --disable-acl-support.
+ Since about 2001, ACL directives are specified in the standard
+ config file.
+ - Update the URL of the 'Removing outdated PCRE version after the
+ next stable release' posting. The old URL stopped working after
+ one of SF's recent site "optimizations". Reported by Han Liu.
+
+- Privoxy-Regression-Test:
+ - Added --shuffle-tests option to increase the chances of detection race conditions.
+ - Added a --local-test-file option that allows to use Privoxy-Regression-Test without Privoxy.
+ - Added tests for missing socks4 and socks4a forwarders.
+ - The --privoxy-address option now works with IPv6 addresses containing brackets, too.
+ - Perform limited sanity checks for parameters that are supposed to have numerical values.
+ - Added a --sleep-time option to specify a number of seconds to
+ sleep between tests, defaults to 0.
+ - Disable the range-requests tagger for tests that break if it's enabled.
+ - Log messages use the ISO 8601 date format %Y-%m-%d.
+ - Fix spelling in two error messages.
+ - In the --help output, include a list of supported tests and their default levels.
+ - Adjust the tests to properly deal with FEATURE_TOGGLE being disabled.
+
+- Privoxy-Log-Parser:
+ - Perform limited sanity checks for command line parameters that
+ are supposed to have numerical values.
+ - Implement a --unbreak-lines-only option to try to revert MUA breakage.
+ - Accept and highlight: Added header: Content-Encoding: deflate
+ - Accept and highlight: Compressed content from 29258 to 8630 bytes.
+ - Accept and highlight: Client request arrived in time on socket 21.
+ - Highlight: Didn't receive data in time: a.fsdn.com:443
+ - Accept log messages with ISO 8601 time stamps, too.
+
+- uagen:
+ - Bump generated Firefox version to 8.0.
+ - Only randomize the release date if the new --randomize-release-date
+ option is enabled. Firefox versions after 4 use a fixed date string
+ without meaning.
+
*** Version 3.0.17 Stable ***
-- Fixed last-chunk-detection for responses where the content was small
- enough to be read with the body, causing Privoxy to wait for the
+- Fixed last-chunk-detection for responses where the body was small
+ enough to be read with the headers, causing Privoxy to wait for the
end of the content until the server closed the connection or the
request timed out. Reported by "Karsten" in #3028326.
- Responses with status code 204 weren't properly detected as body-less
@@ -145,7 +510,7 @@
- In log_error(), assert that ival and sval have reasonable values.
There's no reason not to abort() if they don't.
- Remove an incorrect cgi_error_unknown() call in a
- cannnot-happen-situation in send_crunch_response().
+ cannot-happen-situation in send_crunch_response().
- Clean up white-space in http_response definition and
move the crunch_reason to the beginning.
- Turn http_response.reason into an enum and rename it
diff -Nru privoxy-3.0.17/config privoxy-3.0.19/config
--- privoxy-3.0.17/config 2010-11-13 12:48:18.000000000 +0000
+++ privoxy-3.0.19/config 2011-12-26 17:04:50.000000000 +0000
@@ -1,8 +1,8 @@
-# Sample Configuration File for Privoxy v3.0.17
+# Sample Configuration File for Privoxy v3.0.19
#
-# $Id: config,v 1.93 2010/11/13 12:48:18 fabiankeil Exp $
+# $Id: config,v 1.98 2011/12/26 17:04:50 fabiankeil Exp $
#
-# Copyright (C) 2001-2010 Privoxy Developers http://www.privoxy.org/
+# Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/
#
####################################################################
# #
@@ -681,13 +681,15 @@
#
# Specifies:
#
-# The IP address and TCP port on which Privoxy will listen for
+# The address and TCP port on which Privoxy will listen for
# client requests.
#
# Type of value:
#
# [IP-Address]:Port
#
+# [Hostname]:Port
+#
# Default value:
#
# 127.0.0.1:8118
@@ -707,17 +709,56 @@
# if you want to serve requests from other machines (e.g. on your
# local network) as well, you will need to override the default.
#
-# IPv6 addresses containing colons have to be quoted by brackets.
+# You can use this statement multiple times to make Privoxy listen
+# on more ports or more IP addresses. Suitable if your operating
+# system does not support sharing IPv6 and IPv4 protocols on the
+# same socket.
+#
+# If a hostname is used instead of an IP address, Privoxy will
+# try to resolve it to an IP address and if there are multiple,
+# use the first one returned.
+#
+# If the address for the hostname isn't already known on the
+# system (for example because it's in /etc/hostname), this may
+# result in DNS traffic.
+#
+# If the specified address isn't available on the system, or if
+# the hostname can't be resolved, Privoxy will fail to start.
+#
+# IPv6 addresses containing colons have to be quoted by
+# brackets. They can only be used if Privoxy has been compiled
+# with IPv6 support. If you aren't sure if your version supports
+# it, have a look at http://config.privoxy.org/ show-status.
+#
+# Some operating systems will prefer IPv6 to IPv4 addresses even if
+# the system has no IPv6 connectivity which is usually not expected
+# by the user. Some even rely on DNS to resolve localhost which
+# mean the "localhost" address used may not actually be local.
+#
+# It is therefore recommended to explicitly configure the intended
+# IP address instead of relying on the operating system, unless
+# there's a strong reason not to.
#
-# If you leave out the IP address, Privoxy will bind to all IPv4
+# If you leave out the address, Privoxy will bind to all IPv4
# interfaces (addresses) on your machine and may become reachable
-# from the Internet. In that case, consider using access control
-# lists (ACL's, see below), and/or a firewall.
+# from the Internet and/ or the local network. Be aware that
+# some GNU/Linux distributions modify that behaviour without
+# updating the documentation. Check for non-standard patches if
+# your Privoxyversion behaves differently.
+#
+# If you configure Privoxyto be reachable from the network,
+# consider using access control lists (ACL's, see below), and/or
+# a firewall.
#
# If you open Privoxy to untrusted users, you will also
# want to make sure that the following actions are disabled:
# enable-edit-actions and enable-remote-toggle
#
+# With the exception noted above, listening on multiple addresses
+# is currently not supported by Privoxy directly. It can be done
+# on most operating systems by letting a packet filter redirect
+# request for certain addresses to Privoxy, though.
+#
# Example:
#
# Suppose you are running Privoxy on a machine which has the
@@ -1167,7 +1208,7 @@
#
# Parent proxy specified by an IPv6 address:
#
-# foward / [2001:DB8::1]:8000
+# forward / [2001:DB8::1]:8000
#
#
# Suppose your parent proxy doesn't support IPv6:
@@ -1712,17 +1753,11 @@
# max-client-connections 256
#
#max-client-connections 256
-#
+
#
# 6.9. handle-as-empty-doc-returns-ok
# ====================================
#
-# Note:
-#
-# This is a work-around for Firefox bug 492459: " Websites are no
-# longer rendered if SSL requests for JavaScripts are blocked by
-# a proxy. " (https:/ /bugzilla.mozilla.org/show_bug.cgi?id=492459)
-#
# Specifies:
#
# The status code Privoxy returns for pages blocked with
@@ -1746,7 +1781,102 @@
# +handle-as-empty-document and a status 403(Forbidden) for all
# other blocked pages.
#
-handle-as-empty-doc-returns-ok 1
+# Notes:
+#
+# This is a work-around for Firefox bug 492459: " Websites are no
+# longer rendered if SSL requests for JavaScripts are blocked by a
+# proxy. " (https:/ /bugzilla.mozilla.org/show_bug.cgi?id=492459)
+# As the bug has been fixed for quite some time this option
+# should no longer be needed and will be removed in a future
+# release. Please speak up if you have a reason why the option
+# should be kept around.
+#
+#handle-as-empty-doc-returns-ok 1
+#
+#
+# 1.6.10. enable-compression
+#
+# Specifies:
+#
+# Whether or not buffered content is compressed before delivery.
+#
+# Type of value:
+#
+# 0 or 1
+#
+# Default value:
+#
+# 0
+#
+# Effect if unset:
+#
+# Privoxy does not compress buffered content.
+#
+# Effect if set:
+#
+# Privoxy compresses buffered content before delivering it to
+# the client, provided the client supports it.
+#
+# Notes:
+#
+# This directive is only supported if Privoxy has been compiled
+# with FEATURE_COMPRESSION, which should not to be confused
+# with FEATURE_ZLIB.
+#
+# Compressing buffered content is mainly useful if Privoxy and the
+# client are running on different systems. If they are running on
+# the same system, enabling compression is likely to slow things
+# down. If you didn't measure otherwise, you should assume that
+# it does and keep this option disabled.
+#
+# Privoxy will not compress buffered content below a certain
+# length.
+#
+#enable-compression 1
+#
+#
+# 1.6.11. compression-level
+#
+# Specifies:
+#
+# The compression level that is passed to the zlib library when
+# compressing buffered content.
+#
+# Type of value:
+#
+# Positive number ranging from 0 to 9.
+#
+# Default value:
+#
+# 1
+#
+# Notes:
+#
+# Compressing the data more takes usually longer than compressing
+# it less or not compressing it at all. Which level is best
+# depends on the connection between Privoxy and the client. If
+# you can't be bothered to benchmark it for yourself, you should
+# stick with the default and keep compression disabled.
+#
+# If compression is disabled, the compression level is irrelevant.
+#
+# Examples:
+#
+# # Best speed (compared to the other levels)
+# compression-level 1
+#
+# # Best compression
+# compression-level 9
+#
+# # No compression. Only useful for testing as the added header
+# # slightly increases the amount of data that has to be sent.
+# # If your benchmark shows that using this compression level
+# # is superior to using no compression at all, the benchmark
+# # is likely to be flawed.
+# compression-level 0
+#
+#
+#compression-level 1
#
#
# 7. WINDOWS GUI OPTIONS
diff -Nru privoxy-3.0.17/config.guess privoxy-3.0.19/config.guess
--- privoxy-3.0.17/config.guess 2009-06-21 19:21:11.000000000 +0000
+++ privoxy-3.0.19/config.guess 2011-11-12 12:54:35.000000000 +0000
@@ -1,10 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-# Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011 Free Software Foundation, Inc.
-timestamp='2008-01-23'
+timestamp='2011-11-11'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -27,16 +27,16 @@
# the same distribution terms that you use for the rest of that program.
-# Originally written by Per Bothner .
-# Please send patches to . Submit a context
-# diff and a properly formatted ChangeLog entry.
+# Originally written by Per Bothner. Please send patches (context
+# diff format) to and include a ChangeLog
+# entry.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -56,8 +56,9 @@
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
+Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -170,7 +171,7 @@
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
+ | grep -q __ELF__
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
@@ -180,7 +181,7 @@
fi
;;
*)
- os=netbsd
+ os=netbsd
;;
esac
# The OS release
@@ -223,7 +224,7 @@
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
@@ -269,7 +270,10 @@
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit ;;
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
+ exit $exitcode ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
@@ -295,7 +299,7 @@
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
- echo powerpc-ibm-os400
+ echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
@@ -324,14 +328,33 @@
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux${UNAME_RELEASE}
+ exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
@@ -375,23 +398,23 @@
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
@@ -461,8 +484,8 @@
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@@ -475,7 +498,7 @@
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
- exit ;;
+ exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
@@ -532,7 +555,7 @@
echo rs6000-ibm-aix3.2
fi
exit ;;
- *:AIX:*:[456])
+ *:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
@@ -575,52 +598,52 @@
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
+ esac ;;
+ esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include
+ #include
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
- #define _HPUX_SOURCE
- #include
- #include
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
@@ -640,7 +663,7 @@
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep __LP64__ >/dev/null
+ grep -q __LP64__
then
HP_ARCH="hppa2.0w"
else
@@ -711,22 +734,22 @@
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
- exit ;;
+ exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit ;;
+ exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
- exit ;;
+ exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
- exit ;;
+ exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
- exit ;;
+ exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
@@ -750,14 +773,14 @@
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
@@ -769,13 +792,12 @@
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
- case ${UNAME_MACHINE} in
- pc98)
- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ case ${UNAME_PROCESSOR} in
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
@@ -784,19 +806,22 @@
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
+ i*:MSYS*:*)
+ echo ${UNAME_MACHINE}-pc-msys
+ exit ;;
i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
- *:Interix*:[3456]*)
- case ${UNAME_MACHINE} in
+ *:Interix*:*)
+ case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
- EM64T | authenticamd)
+ authenticamd | genuineintel | EM64T)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
@@ -806,6 +831,9 @@
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
+ 8664:Windows_NT:*)
+ echo x86_64-pc-mks
+ exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@@ -835,6 +863,20 @@
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
@@ -842,7 +884,13 @@
then
echo ${UNAME_MACHINE}-unknown-linux-gnu
else
- echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+ fi
fi
exit ;;
avr32*:Linux:*:*)
@@ -855,7 +903,21 @@
echo crisv32-axis-linux-gnu
exit ;;
frv:Linux:*:*)
- echo frv-unknown-linux-gnu
+ echo frv-unknown-linux-gnu
+ exit ;;
+ hexagon:Linux:*:*)
+ echo hexagon-unknown-linux-gnu
+ exit ;;
+ i*86:Linux:*:*)
+ LIBC=gnu
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -866,74 +928,33 @@
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
- mips:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips
- #undef mipsel
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mipsel
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips
- #else
- CPU=
- #endif
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
- ;;
- mips64:Linux:*:*)
+ mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
- #undef mips64
- #undef mips64el
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
+ CPU=${UNAME_MACHINE}el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
+ CPU=${UNAME_MACHINE}
#else
CPU=
#endif
#endif
EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
echo or32-unknown-linux-gnu
exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-gnu
exit ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
@@ -943,14 +964,17 @@
*) echo hppa-unknown-linux-gnu ;;
esac
exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -958,6 +982,9 @@
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
+ tile*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
@@ -965,71 +992,8 @@
echo x86_64-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit ;;
- coff-i386)
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^LIBC/{
- s: ::g
- p
- }'`"
- test x"${LIBC}" != x && {
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
- exit
- }
- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
- ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
@@ -1037,11 +1001,11 @@
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
+ # Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;;
i*86:OS/2:*:*)
@@ -1058,7 +1022,7 @@
i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit ;;
i*86:*DOS:*:*)
@@ -1073,7 +1037,7 @@
fi
exit ;;
i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
@@ -1101,10 +1065,13 @@
exit ;;
pc:*:*:*)
# Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
- exit ;;
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configury will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
@@ -1139,8 +1106,18 @@
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit ;;
@@ -1153,7 +1130,7 @@
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit ;;
SM[BE]S:UNIX_SV:*:*)
@@ -1173,10 +1150,10 @@
echo ns32k-sni-sysv
fi
exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says
- echo i586-unisys-sysv4
- exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says
+ echo i586-unisys-sysv4
+ exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes .
# How about differentiating between stratus architectures? -djm
@@ -1202,11 +1179,11 @@
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
+ echo mips-nec-sysv${UNAME_RELEASE}
else
- echo mips-unknown-sysv${UNAME_RELEASE}
+ echo mips-unknown-sysv${UNAME_RELEASE}
fi
- exit ;;
+ exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
@@ -1216,6 +1193,9 @@
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
@@ -1243,6 +1223,16 @@
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in
+ i386)
+ eval $set_cc_for_build
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ UNAME_PROCESSOR="x86_64"
+ fi
+ fi ;;
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
@@ -1258,6 +1248,9 @@
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
+ NEO-?:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk${UNAME_RELEASE}
+ exit ;;
NSE-?:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
@@ -1303,13 +1296,13 @@
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
+ echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
@@ -1324,6 +1317,9 @@
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
exit ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1346,11 +1342,11 @@
#include
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
- "4"
+ "4"
#else
- ""
+ ""
#endif
- ); exit (0);
+ ); exit (0);
#endif
#endif
diff -Nru privoxy-3.0.17/config.sub privoxy-3.0.19/config.sub
--- privoxy-3.0.17/config.sub 2009-06-21 19:21:12.000000000 +0000
+++ privoxy-3.0.19/config.sub 2011-11-12 12:54:35.000000000 +0000
@@ -1,10 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-# Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011 Free Software Foundation, Inc.
-timestamp='2008-02-05'
+timestamp='2011-11-11'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -32,13 +32,16 @@
# Please send patches to . Submit a context
-# diff and a properly formatted ChangeLog entry.
+# diff and a properly formatted GNU ChangeLog entry.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
@@ -72,8 +75,9 @@
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
+Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -120,8 +124,10 @@
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
@@ -148,10 +154,13 @@
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray)
+ -apple | -axis | -knuth | -cray | -microblaze)
os=
basic_machine=$1
;;
+ -bluegene*)
+ os=-cnk
+ ;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
@@ -166,10 +175,10 @@
os=-chorusos
basic_machine=$1
;;
- -chorusrdb)
- os=-chorusrdb
+ -chorusrdb)
+ os=-chorusrdb
basic_machine=$1
- ;;
+ ;;
-hiux*)
os=-hiuxwe2
;;
@@ -242,15 +251,20 @@
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | be32 | be64 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
+ | epiphany \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
+ | le32 | le64 \
+ | lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep \
+ | maxq | mb | microblaze | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -270,28 +284,42 @@
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
+ | moxie \
| mt \
| msp430 \
+ | nds32 | nds32le | nds32be \
| nios | nios2 \
| ns16k | ns32k \
+ | open8 \
| or32 \
| pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
+ | rl78 | rx \
| score \
- | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
- | v850 | v850e \
+ | spu \
+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+ | ubicom32 \
+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| we32k \
- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
- | z8k)
+ | x86 | xc16x | xstormy16 | xtensa \
+ | z8k | z80)
basic_machine=$basic_machine-unknown
;;
- m6811 | m68hc11 | m6812 | m68hc12)
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | picochip)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
os=-none
@@ -302,6 +330,18 @@
basic_machine=mt-unknown
;;
+ strongarm | thumb | xscale)
+ basic_machine=arm-unknown
+ ;;
+
+ xscaleeb)
+ basic_machine=armeb-unknown
+ ;;
+
+ xscaleel)
+ basic_machine=armel-unknown
+ ;;
+
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
@@ -321,19 +361,23 @@
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
+ | be32-* | be64-* \
| bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
+ | le32-* | le64-* \
+ | lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
@@ -355,27 +399,32 @@
| mmix-* \
| mt-* \
| msp430-* \
+ | nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \
+ | open8-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
- | romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | rl78-* | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+ | tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tile*-* \
| tron-* \
- | v850-* | v850e-* | vax-* \
+ | ubicom32-* \
+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+ | vax-* \
| we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
- | z8k-*)
+ | z8k-* | z80-*)
;;
# Recognize the basic CPU types without company name, with glob match.
xtensa*)
@@ -397,7 +446,7 @@
basic_machine=a29k-amd
os=-udi
;;
- abacus)
+ abacus)
basic_machine=abacus-unknown
;;
adobe68k)
@@ -443,6 +492,10 @@
basic_machine=m68k-apollo
os=-bsd
;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
aux)
basic_machine=m68k-apple
os=-aux
@@ -459,10 +512,27 @@
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
+ c54x-*)
+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
c90)
basic_machine=c90-cray
os=-unicos
;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
convex-c1)
basic_machine=c1-convex
os=-bsd
@@ -491,7 +561,7 @@
basic_machine=craynv-cray
os=-unicosmp
;;
- cr16)
+ cr16 | cr16-*)
basic_machine=cr16-unknown
os=-elf
;;
@@ -530,6 +600,10 @@
basic_machine=m88k-motorola
os=-sysv3
;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
@@ -703,6 +777,9 @@
basic_machine=ns32k-utek
os=-sysv
;;
+ microblaze)
+ basic_machine=microblaze-xilinx
+ ;;
mingw32)
basic_machine=i386-pc
os=-mingw32
@@ -739,10 +816,18 @@
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
+ msys)
+ basic_machine=i386-pc
+ os=-msys
+ ;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
+ nacl)
+ basic_machine=le32-unknown
+ os=-nacl
+ ;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
@@ -807,6 +892,12 @@
np1)
basic_machine=np1-gould
;;
+ neo-tandem)
+ basic_machine=neo-tandem
+ ;;
+ nse-tandem)
+ basic_machine=nse-tandem
+ ;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@@ -889,9 +980,10 @@
;;
power) basic_machine=power-ibm
;;
- ppc) basic_machine=powerpc-unknown
+ ppc | ppcbe) basic_machine=powerpc-unknown
;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ppc-* | ppcbe-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
@@ -985,6 +1077,9 @@
basic_machine=i860-stratus
os=-sysv4
;;
+ strongarm-* | thumb-*)
+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
sun2)
basic_machine=m68000-sun
;;
@@ -1041,20 +1136,8 @@
basic_machine=t90-cray
os=-unicos
;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
- ;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
- ;;
tile*)
- basic_machine=tile-unknown
+ basic_machine=$basic_machine-unknown
os=-linux-gnu
;;
tx39)
@@ -1124,6 +1207,9 @@
xps | xps100)
basic_machine=xps100-honeywell
;;
+ xscale-* | xscalee[bl]-*)
+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ;;
ymp)
basic_machine=ymp-cray
os=-unicos
@@ -1132,6 +1218,10 @@
basic_machine=z8k-unknown
os=-sim
;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
none)
basic_machine=none-none
os=-none
@@ -1170,7 +1260,7 @@
we32k)
basic_machine=we32k-att
;;
- sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
@@ -1217,9 +1307,12 @@
if [ x"$os" != x"" ]
then
case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
+ # First match some system type aliases
+ # that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
+ -auroraux)
+ os=-auroraux
+ ;;
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
@@ -1240,10 +1333,11 @@
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
+ | -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
@@ -1252,9 +1346,10 @@
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@@ -1262,7 +1357,7 @@
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1301,7 +1396,7 @@
-opened*)
os=-openedition
;;
- -os400*)
+ -os400*)
os=-os400
;;
-wince*)
@@ -1350,7 +1445,7 @@
-sinix*)
os=-sysv4
;;
- -tpf*)
+ -tpf*)
os=-tpf
;;
-triton*)
@@ -1392,6 +1487,11 @@
-zvmoe)
os=-zvmoe
;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -nacl*)
+ ;;
-none)
;;
*)
@@ -1414,10 +1514,10 @@
# system, and we'll never get to this point.
case $basic_machine in
- score-*)
+ score-*)
os=-elf
;;
- spu-*)
+ spu-*)
os=-elf
;;
*-acorn)
@@ -1429,8 +1529,17 @@
arm*-semi)
os=-aout
;;
- c4x-* | tic4x-*)
- os=-coff
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
@@ -1457,7 +1566,7 @@
m68*-cisco)
os=-aout
;;
- mep-*)
+ mep-*)
os=-elf
;;
mips*-cisco)
@@ -1484,7 +1593,7 @@
*-ibm)
os=-aix
;;
- *-knuth)
+ *-knuth)
os=-mmixware
;;
*-wec)
@@ -1589,7 +1698,7 @@
-sunos*)
vendor=sun
;;
- -aix*)
+ -cnk*|-aix*)
vendor=ibm
;;
-beos*)
diff -Nru privoxy-3.0.17/configure.in privoxy-3.0.19/configure.in
--- privoxy-3.0.17/configure.in 2010-10-30 15:57:50.000000000 +0000
+++ privoxy-3.0.19/configure.in 2011-12-26 17:03:31.000000000 +0000
@@ -1,38 +1,38 @@
dnl Process this file with autoconf to produce a configure script.
-dnl
-dnl $Id: configure.in,v 1.147 2010/10/30 15:57:50 fabiankeil Exp $
-dnl
+dnl
+dnl $Id: configure.in,v 1.166 2011/12/26 17:03:31 fabiankeil Exp $
+dnl
dnl Written by and Copyright (C) 2001-2010 the
dnl Privoxy team. http://www.privoxy.org/
dnl
dnl Based on the Internet Junkbuster originally written
-dnl by and Copyright (C) 1997 Anonymous Coders and
+dnl by and Copyright (C) 1997 Anonymous Coders and
dnl Junkbusters Corporation. http://www.junkbusters.com
dnl
-dnl This program is free software; you can redistribute it
+dnl This program is free software; you can redistribute it
dnl and/or modify it under the terms of the GNU General
dnl Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at
dnl your option) any later version.
-dnl
+dnl
dnl This program is distributed in the hope that it will
dnl be useful, but WITHOUT ANY WARRANTY; without even the
dnl implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE. See the GNU General Public
dnl License for more details.
-dnl
+dnl
dnl The GNU General Public License should be included with
dnl this file. If not, you can view it at
dnl http://www.gnu.org/copyleft/gpl.html
dnl or write to the Free Software Foundation, Inc., 59
dnl Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-dnl
+dnl
dnl =================================================================
dnl AutoConf Initialization
dnl =================================================================
-AC_REVISION($Revision: 1.147 $)
+AC_REVISION($Revision: 1.166 $)
AC_INIT(jcc.c)
if test ! -f config.h.in; then
@@ -44,7 +44,7 @@
else
autoheader
fi
-fi
+fi
AC_CONFIG_HEADER([config.h])
AC_CANONICAL_HOST
@@ -52,13 +52,13 @@
dodk=auto
DKPREFIX=none
AC_ARG_WITH(docbook, dnl
- --with-docbook=[[yes|no|directory]]
- Enable docbook documentation creation
+ --with-docbook=[[yes|no|directory]]
+ Enable docbook documentation creation
(default = yes, for gnu and linux),[dnl
case "$with_docbook" in
yes) dodk=yes;;
no) dodk=no;;
-*)
+*)
dodk=yes
DKPREFIX=$withval
;;
@@ -78,12 +78,13 @@
VERSION_MAJOR=3
VERSION_MINOR=0
-VERSION_POINT=17
+VERSION_POINT=19
CODE_STATUS="stable"
-dnl CODE_STATUS can be "alpha", "beta", or "stable", and will be
-dnl used for CGI output. Set version to 0.0.0 and status to "UNRELEASED"
-dnl whenever CVS in a stable branch differs from the last release.
+dnl CODE_STATUS can be "alpha", "beta", "stable" or "UNRELEASED",
+dnl and will be used for CGI output. Increment version number and
+dnl set status to "UNRELEASED" whenever CVS differs from the last
+dnl release and no new release is near.
dnl =================================================================
dnl Substitute the version numbers
@@ -124,7 +125,7 @@
AC_SUBST(BGROUPS)
dnl =================================================================
-dnl debug, gcc and gdb support
+dnl debug, gcc and gdb support
dnl =================================================================
AC_ARG_WITH(debug,
@@ -202,7 +203,7 @@
AC_MSG_CHECKING([for group])
AC_ARG_WITH(group,
[ --with-group=privoxy Set group for privoxy],
- [
+ [
if test "x$withval" != "xyes"; then
if test $BGROUPS = no ; then
AC_MSG_ERROR(There is no 'groups' program on this system)
@@ -241,7 +242,7 @@
dnl =================================================================
dnl additional gcc flags
dnl =================================================================
-dnl
+dnl
if test "$GCC"; then
if test "$host" != "powerpc-unknown-amigaos"; then
CFLAGS="-pipe $CFLAGS"
@@ -259,7 +260,7 @@
dnl into Cygwin or MinGW32 modes. Depending on the mode selected,
dnl the compiler will use completely different sets of library
dnl and include files.
-dnl
+dnl
dnl =================================================================
AC_MINGW32
@@ -315,7 +316,7 @@
fi
AC_SUBST(WIN_ONLY)
-dnl Checking which text html browser we have avaliable
+dnl Checking which text html browser we have available
if test $dodk != no; then
AC_CHECK_PROGS(WDUMP,w3m lynx links,false)
if test "$WDUMP" = false; then
@@ -323,7 +324,7 @@
fi
if test $DB2HTML = false; then
dnl We need to clean the variable, otherwise AC_CHECK_PROGS
- dnl will fail
+ dnl will fail
DB2HTML=""
AC_CHECK_PROGS(DB2HTML,db2html docbook2html,false)
fi
@@ -429,7 +430,7 @@
[if test $enableval = no; then
# Disable pthreads
if test $have_pthread = yes; then
- AC_MSG_WARN([pthreads seem to be available but you are using --disable-pthread.])
+ AC_MSG_WARN([pthreads seem to be available but you are using --disable-pthread.])
AC_MSG_WARN([This is almost always a mistake and can render Privoxy unacceptable slow.])
fi
have_pthread=no
@@ -647,10 +648,10 @@
dnl =================================================================
dnl Mac OSX specific
dnl =================================================================
-
+
case "$host" in
*-apple-darwin*) SPECIAL_CFLAGS="-Dunix"
-;;
+;;
esac
dnl =================================================================
@@ -700,21 +701,23 @@
AC_CHECK_HEADERS([OS.h arpa/inet.h errno.h fcntl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h sys/timeb.h sys/wait.h unistd.h])
dnl Checks for library functions.
-dnl AC_TYPE_SIGNAL
-dnl AC_CHECK_FUNC(strstr)
-dnl bcopy and memmove are for PCRE
-AC_CHECK_FUNCS([strerror bcopy memmove])
+dnl bcopy is for PCRE
+AC_CHECK_FUNCS([bcopy])
AC_PROG_GCC_TRADITIONAL
-dnl uncommenting does not work for swa. suse linux
-dnl AC_FUNC_MALLOC
-AC_FUNC_SETPGRP
AC_TYPE_SIGNAL
-dnl uncommenting does not work for swa. suse linux
-dnl AC_FUNC_STAT
AC_CHECK_FUNCS([access atexit getcwd gethostbyaddr gethostbyaddr_r gethostbyname gethostbyname_r gettimeofday inet_ntoa localtime_r memchr memmove memset poll putenv random regcomp select setlocale snprintf socket strchr strdup strerror strftime strlcat strlcpy strptime strstr strtoul timegm tzset])
dnl Checks for RFC 2553 resolver and socket functions
-if test $target_type = mingw; then
+AC_ARG_ENABLE(ipv6-support,
+[ --disable-ipv6-support Disable IPv6 support and other RFC-2554-related improvements],
+[if test $enableval = yes; then
+ enable_ipv6_support=yes
+fi], enable_ipv6_support=yes)
+
+if test $enable_ipv6_support != yes; then
+ AC_MSG_WARN([Skipping checks for IPv6 support and other RFC-2554-related improvements.
+ Due to lock contention, this may result in slower DNS resolution for IPv4 setups, too.])
+elif test $target_type = mingw; then
AC_CHECK_LIB(ws2_32, main)
AC_MSG_CHECKING(getaddrinfo in ws2_32)
@@ -771,7 +774,7 @@
], [have_pcre=no])
])
], [have_pcre=no])
-
+
AC_CHECK_LIB(pcreposix, regcomp, [
AC_CHECK_HEADER(pcreposix.h, [
AC_EGREP_HEADER(pcreposix_regerror, pcreposix.h, [AC_MSG_WARN([[pcreposix old version installed]]); have_pcreposix=no], [have_pcreposix=yes])
@@ -780,7 +783,7 @@
AC_EGREP_HEADER(pcreposix_regerror, pcre/pcreposix.h, [AC_MSG_WARN([[pcreposix old version installed]]); have_pcreposix=no], [have_pcreposix=yes]; [AC_DEFINE(PCREPOSIX_H_IN_SUBDIR)])
], [have_pcreposix=no])
])
-], [have_pcreposix=no], -lpcre)
+], [have_pcreposix=no], -lpcre)
dnl ================================================================
dnl libpcrs is temporarily disabled.
@@ -835,15 +838,15 @@
fi],)
AC_ARG_ENABLE(image-blocking,
-[ --disable-image-blocking Don't try to figure out whether a request is
+[ --disable-image-blocking Don't try to figure out whether a request is
for an image or HTML - assume HTML.],
[if test $enableval = yes; then
AC_DEFINE(FEATURE_IMAGE_BLOCKING)
fi],
AC_DEFINE(FEATURE_IMAGE_BLOCKING))
-AC_ARG_ENABLE(acl-files,
-[ --disable-acl-files Prevents the use of ACL files to control access to
+AC_ARG_ENABLE(acl-support,
+[ --disable-acl-support Prevents the use of ACLs to control access to
Privoxy by IP address.],
[if test $enableval = yes; then
AC_DEFINE(FEATURE_ACL)
@@ -925,12 +928,25 @@
AC_CHECK_LIB(z, zlibVersion, [have_zlib="yes"], [have_zlib="no"])
if test $have_zlib = "yes"; then
LIBS="$LIBS -lz"
- AC_DEFINE(FEATURE_ZLIB,1,[Define to 1 to use compression through the zlib library.])
+ AC_DEFINE(FEATURE_ZLIB,1,[Define to 1 to use zlib to decompress data before filtering.])
else
AC_MSG_WARN([No zlib found.
Privoxy will not be able to filter compressed content.
This may become a fatal error in the future.])
- fi
+ fi
+fi
+
+AC_ARG_ENABLE(compression,
+[ --enable-compression Allow Privoxy to compress buffered content if the client supports it. Requires zlib support.],
+[enableval2=$enableval],
+[enableval2=no])
+if test $enableval2 = yes; then
+ if test $have_zlib = "yes"; then
+ echo Enabling compression support.
+ AC_DEFINE(FEATURE_COMPRESSION,1,[Define to 1 to use compression through the zlib library.])
+ else
+ AC_MSG_WARN([No zlib found. Privoxy will not be able to (re-)compressed buffered content.])
+ fi
fi
@@ -944,8 +960,8 @@
STATIC_PCRE_ONLY=#
LIBS="$LIBS -lpcre -lpcreposix"
else
- AC_MSG_WARN([You are using the static PCRE code which is scheduled for removal, for details see:
- https://sourceforge.net/mailarchive/message.php?msg_id=20080511195555.2dc6cfdc%40fabiankeil.de])
+ AC_MSG_WARN([You are using the static PCRE code which is out of date and scheduled for removal, for details see:
+ http://sourceforge.net/mailarchive/forum.php?thread_name=20080511195555.2dc6cfdc%40fabiankeil.de&forum_name=ijbswa-developers])
pcre_dyn=no
AC_DEFINE(STATIC_PCRE)
STATIC_PCRE_ONLY=
@@ -983,7 +999,7 @@
dnl Final cleanup and output
dnl =================================================================
-dnl Remove the SPECIAL_CFLAGS stuff from CFLAGS, and add it seperately
+dnl Remove the SPECIAL_CFLAGS stuff from CFLAGS, and add it separately
dnl in the Makefile
CFLAGS=$old_CFLAGS_nospecial
AC_SUBST(SPECIAL_CFLAGS)
diff -Nru privoxy-3.0.17/cygwin.h privoxy-3.0.19/cygwin.h
--- privoxy-3.0.17/cygwin.h 2009-06-21 19:21:12.000000000 +0000
+++ privoxy-3.0.19/cygwin.h 2011-09-04 11:10:56.000000000 +0000
@@ -1,6 +1,6 @@
#ifndef CYGWIN_H_INCLUDED
#define CYGWIN_H_INCLUDED
-#define CYGWIN_H_VERSION "$Id: cygwin.h,v 1.7 2009/05/16 13:27:20 fabiankeil Exp $"
+#define CYGWIN_H_VERSION "$Id: cygwin.h,v 1.8 2011/09/04 11:10:56 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cygwin.h,v $
@@ -13,10 +13,10 @@
* Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
- * by and Copyright (C) 1997 Anonymous Coders and
+ * by and Copyright (C) 1997 Anonymous Coders and
* Junkbusters Corporation. http://www.junkbusters.com
*
- * This program is free software; you can redistribute it
+ * This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
* Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at
diff -Nru privoxy-3.0.17/deanimate.c privoxy-3.0.19/deanimate.c
--- privoxy-3.0.17/deanimate.c 2009-06-21 19:21:12.000000000 +0000
+++ privoxy-3.0.19/deanimate.c 2011-09-04 11:10:56.000000000 +0000
@@ -1,4 +1,4 @@
-const char deanimate_rcs[] = "$Id: deanimate.c,v 1.20 2009/05/16 13:27:20 fabiankeil Exp $";
+const char deanimate_rcs[] = "$Id: deanimate.c,v 1.21 2011/09/04 11:10:56 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/deanimate.c,v $
@@ -6,7 +6,7 @@
* Purpose : Declares functions to manipulate binary images on the
* fly. High-level functions include:
* - Deanimation of GIF images
- *
+ *
* Functions declared include: gif_deanimate, buf_free,
* buf_copy, buf_getbyte, gif_skip_data_block
* and gif_extract_image
@@ -19,7 +19,7 @@
* and ideas from the Image::DeAnim Perl module by
* Ken MacFarlane,
*
- * This program is free software; you can redistribute it
+ * This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
* Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at
@@ -53,7 +53,7 @@
const char deanimate_h_rcs[] = DEANIMATE_H_VERSION;
/*********************************************************************
- *
+ *
* Function : buf_free
*
* Description : Safely frees a struct binbuffer
@@ -79,7 +79,7 @@
/*********************************************************************
- *
+ *
* Function : buf_extend
*
* Description : Ensure that a given binbuffer can hold a given amount
@@ -90,7 +90,7 @@
* Parameters :
* 1 : buf = Pointer to the binbuffer
* 2 : length = Desired minimum size
- *
+ *
*
* Returns : 0 on success, 1 on failure.
*
@@ -121,7 +121,7 @@
/*********************************************************************
- *
+ *
* Function : buf_copy
*
* Description : Safely copies a given amount of bytes from one
@@ -142,7 +142,7 @@
/*
* Sanity check: Can't copy more data than we have
*/
- if (src->offset + length > src->size)
+ if (src->offset + length > src->size)
{
return 1;
}
@@ -150,7 +150,7 @@
/*
* Ensure that dst can hold the new data
*/
- if (buf_extend(dst, length))
+ if (buf_extend(dst, length))
{
return 1;
}
@@ -169,7 +169,7 @@
/*********************************************************************
- *
+ *
* Function : buf_getbyte
*
* Description : Safely gets a byte from a given binbuffer at a
@@ -197,7 +197,7 @@
/*********************************************************************
- *
+ *
* Function : gif_skip_data_block
*
* Description : Safely advances the offset of a given struct binbuffer
@@ -215,7 +215,7 @@
{
unsigned char c;
- /*
+ /*
* Data blocks are sequences of chunks, which are headed
* by a one-byte length field, with the last chunk having
* zero length.
@@ -236,12 +236,12 @@
/*********************************************************************
- *
+ *
* Function : gif_extract_image
*
* Description : Safely extracts an image data block from a given
* struct binbuffer that contains a GIF image and whose
- * offset is positioned at the start of a data block
+ * offset is positioned at the start of a data block
* into a given destination binbuffer.
*
* Parameters :
@@ -279,7 +279,7 @@
if (buf_copy(src, dst, (size_t)map_length))
{
return 1;
- }
+ }
}
if (buf_copy(src, dst, 1)) return 1;
@@ -304,7 +304,7 @@
}
/*********************************************************************
- *
+ *
* Function : gif_deanimate
*
* Description : Deanimate a given GIF image, i.e. given a GIF with
@@ -336,9 +336,9 @@
c = buf_getbyte(src, 10);
/*
- * Check & copy GIF header
+ * Check & copy GIF header
*/
- if (strncmp(src->buffer, "GIF89a", 6) && strncmp(src->buffer, "GIF87a", 6))
+ if (strncmp(src->buffer, "GIF89a", 6) && strncmp(src->buffer, "GIF87a", 6))
{
return 1;
}
@@ -390,7 +390,7 @@
case 0x3b:
goto write;
- /*
+ /*
* Image block: Extract to current image buffer.
*/
case 0x2c:
@@ -450,13 +450,13 @@
*/
default:
goto failed;
-
+
}
} /* -END- while src */
/*
* Either we got here by goto, or because the GIF is
- * bogus and EOF was reached before an end-of-gif marker
+ * bogus and EOF was reached before an end-of-gif marker
* was found.
*/
diff -Nru privoxy-3.0.17/deanimate.h privoxy-3.0.19/deanimate.h
--- privoxy-3.0.17/deanimate.h 2009-06-21 19:21:12.000000000 +0000
+++ privoxy-3.0.19/deanimate.h 2011-09-04 11:10:56.000000000 +0000
@@ -1,6 +1,6 @@
#ifndef DEANIMATE_H_INCLUDED
#define DEANIMATE_H_INCLUDED
-#define DEANIMATE_H_VERSION "$Id: deanimate.h,v 1.13 2009/05/16 13:27:20 fabiankeil Exp $"
+#define DEANIMATE_H_VERSION "$Id: deanimate.h,v 1.14 2011/09/04 11:10:56 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/deanimate.h,v $
@@ -8,9 +8,9 @@
* Purpose : Declares functions to manipulate binary images on the
* fly. High-level functions include:
* - Deanimation of GIF images
- *
+ *
* Functions declared include: gif_deanimate and buf_free.
- *
+ *
*
* Copyright : Written by and Copyright (C) 2001 - 2004 by the the
* SourceForge Privoxy team. http://www.privoxy.org/
@@ -19,10 +19,10 @@
* Ken MacFarlane,
*
* Based on the Internet Junkbuster originally written
- * by and Copyright (C) 1997 Anonymous Coders and
+ * by and Copyright (C) 1997 Anonymous Coders and
* Junkbusters Corporation. http://www.junkbusters.com
*
- * This program is free software; you can redistribute it
+ * This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
* Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at
@@ -64,7 +64,7 @@
extern int gif_deanimate(struct binbuffer *src, struct binbuffer *dst, int get_first_image);
extern void buf_free(struct binbuffer *buf);
-/*
+/*
* Revision control strings from this header and associated .c file
*/
extern const char deanimate_rcs[];
diff -Nru privoxy-3.0.17/debian/changelog privoxy-3.0.19/debian/changelog
--- privoxy-3.0.17/debian/changelog 2012-01-10 04:01:44.000000000 +0000
+++ privoxy-3.0.19/debian/changelog 2012-01-10 04:01:45.000000000 +0000
@@ -1,3 +1,26 @@
+privoxy (3.0.19-1~ppa1~oneiric1) oneiric; urgency=low
+
+ * Backport to Oneiric.
+
+ -- Nicola Ferralis Mon, 09 Jan 2012 22:49:51 -0500
+
+privoxy (3.0.19-1) unstable; urgency=low
+
+ * New upstream version 3.0.19-stable.
+ * Adapt all patches to new version.
+
+ -- Roland Rosenfeld Tue, 27 Dec 2011 11:19:53 +0100
+
+privoxy (3.0.18-1) unstable; urgency=low
+
+ * New upstream version 3.0.18-stable.
+ * Adapt all patches to new version.
+ * Add build-targets build-arch and build-indep.
+ * Upgrade to Standards-Version 3.9.2 (no changes).
+ * 29_typo: most old typos are fixed now, but lintian found new ones.
+
+ -- Roland Rosenfeld Mon, 21 Nov 2011 19:29:06 +0100
+
privoxy (3.0.17-1) unstable; urgency=low
* New upstream version 3.0.17-stable (Closes: #611016).
diff -Nru privoxy-3.0.17/debian/control privoxy-3.0.19/debian/control
--- privoxy-3.0.17/debian/control 2012-01-10 04:01:44.000000000 +0000
+++ privoxy-3.0.19/debian/control 2012-01-10 04:01:45.000000000 +0000
@@ -5,7 +5,7 @@
Build-Depends: debhelper (>= 5.0.0), autoconf, autotools-dev, libpcre3-dev,
jade, docbook-dsssl, docbook, w3m, sp, sgmlspl, groff, man2html, dpatch,
zlib1g-dev
-Standards-Version: 3.9.1
+Standards-Version: 3.9.2
Homepage: http://www.privoxy.org/
Package: privoxy
diff -Nru privoxy-3.0.17/debian/patches/05_defaut_action.dpatch privoxy-3.0.19/debian/patches/05_defaut_action.dpatch
--- privoxy-3.0.17/debian/patches/05_defaut_action.dpatch 2012-01-10 04:01:44.000000000 +0000
+++ privoxy-3.0.19/debian/patches/05_defaut_action.dpatch 2012-01-10 04:01:45.000000000 +0000
@@ -8,16 +8,7 @@
diff -urNad '--exclude=CVS' '--exclude=.svn' privoxy~/default.action.master privoxy/default.action.master
--- privoxy~/default.action.master
+++ privoxy/default.action.master
-@@ -1704,7 +1704,7 @@
- # URL = http://kb.adobe.com/selfservice/viewContent.do?externalId=kb402747&sliceId=1
- .adobe.com
- # URL = http://qa.debian.org/popcon.php
--qa.debian.org/popcon\.php
-+qa.debian.org/popcon
- #MASTER# REMARKS: Support Requests item #2432535 2008-12-16
- # URL = http://www.mta.info/bandt/traffic/advmain.htm
- .mta.info/.*advmain.htm$
-@@ -2225,6 +2225,9 @@
+@@ -2259,6 +2259,9 @@
#MASTER# REMARKS: Exclude per Debian bug report #377843
# URL = http://blogs.msdn.com/wga/archive/2006/07/16/667063.aspx
blogs.msdn.com
@@ -27,7 +18,7 @@
{-filter{unsolicited-popups}}
# Sticky Actions = -filter{unsolicited-popups}
-@@ -2275,6 +2278,11 @@
+@@ -2312,6 +2315,11 @@
{+filter{tiny-textforms}}
.sourceforge.net/tracker
diff -Nru privoxy-3.0.17/debian/patches/14_config.dpatch privoxy-3.0.19/debian/patches/14_config.dpatch
--- privoxy-3.0.17/debian/patches/14_config.dpatch 2012-01-10 04:01:44.000000000 +0000
+++ privoxy-3.0.19/debian/patches/14_config.dpatch 2012-01-10 04:01:45.000000000 +0000
@@ -9,13 +9,13 @@
--- privoxy~/config
+++ privoxy/config
@@ -1,6 +1,6 @@
--# Sample Configuration File for Privoxy v3.0.17
+-# Sample Configuration File for Privoxy v3.0.19
+# Sample Configuration File for Privoxy
#
--# $Id: config,v 1.93 2010/11/13 12:48:18 fabiankeil Exp $
+-# $Id: config,v 1.98 2011/12/26 17:04:50 fabiankeil Exp $
+# Id: config,v
#
- # Copyright (C) 2001-2010 Privoxy Developers http://www.privoxy.org/
+ # Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/
#
@@ -128,7 +128,7 @@
# If set, this option should be the first option in the config
diff -Nru privoxy-3.0.17/debian/patches/15_mansection8.dpatch privoxy-3.0.19/debian/patches/15_mansection8.dpatch
--- privoxy-3.0.17/debian/patches/15_mansection8.dpatch 2012-01-10 04:01:44.000000000 +0000
+++ privoxy-3.0.19/debian/patches/15_mansection8.dpatch 2012-01-10 04:01:45.000000000 +0000
@@ -8,88 +8,22 @@
diff -urNad '--exclude=CVS' '--exclude=.svn' privoxy~/GNUmakefile.in privoxy/GNUmakefile.in
--- privoxy~/GNUmakefile.in
+++ privoxy/GNUmakefile.in
-@@ -175,7 +175,7 @@
- DOC_FILES = AUTHORS LICENSE README ChangeLog INSTALL \
- `find doc/webserver/ -name "*.html" | grep -v "\(webserver\|team\)\/index\.html"` \
- `find doc/webserver/ -name "*.css"` \
-- privoxy.1
-+ privoxy.8
-
- #############################################################################
- # Filenames and libraries
-@@ -457,7 +457,7 @@
- $(RM) doc/man/* doc/webserver/man-page/*.html
- ifneq ($(MAN2HTML),false)
- $(ECHO) "Privoxy Man page