Remove unused Debian patches and add new patches.
want to use these features, you can enable them in
/etc/privoxy/config and do a "/etc/init.d/privoxy restart".
-- A patch was applied to access the local copy of the user manual
- (/usr/share/doc/privoxy/user-manual/*) was applied. With the option
- user-manual /usr/share/doc/privoxy/user-manual
- in /etc/privoxy/config this is activated and the manual can be
- accessed as http://config.privoxy.org/user-manual
+- Experimental IPv6 support was added to the package.
-- A patch was applied to use multiple filter files. So you can leave
- /etc/privoxy/default.filter untouched and use a local file like
- /etc/privoxy/user.filter for your local changes (you have to enable
- this file using a second filterfile directive in /etc/privoxy/config).
+- The global default for all URLs (/) is no longer set in
+ default.action but in a new file global.action, so your local
+ changes should go to global.action and user.action only, while
+ default.action is maintained by package upgrades automatically.
+
+- Since 3.0.5 the upstream package uses the Cautious default settings
+ instead of Medium (like 3.0.3 did). To avoid problems on upgrades
+ of old packages, the Debian package still uses the Medium settings.
+ You can find the different profiles in /etc/privoxy/standard.action.
+ To change the default, go to http://p.p/edit-actions-list?f=global
+ (this can also be reached from http://p.p/show-status via the
+ global.action edit link) and modify the default to your needs. You
+ can either set one of the standard profiles (Cautious, Medium, or
+ Advanced) or change every single setting using the "Edit" button.
+ It is necessary to set "enable-edit-actions 1" (see above) in
+ /etc/privoxy/config to use the web interface. Alternatively you can
+ modify /etc/privoxy/global.action by hand. The other templates are
+ available in /etc/privoxy/standard.action.
+
+- /etc/privoxy/default.action is now owned by root, so you can not
+ modify it via http://p.p/edit-actions-list?f=default any longer
+ (assumed that you set "enable-edit-action 1" above). You should
+ realize your local adaptions in /etc/privoxy/global.action and
+ /etc/privoxy/user.action, so default.action can be easily upgraded
+ by new package versions. If you do not like this change, feel free
+ to change the owner of default.action to "privoxy" and the file is
+ editable again.
Roland Rosenfeld <roland@debian.org>
-$Id: README.Debian,v 1.1.2.3 2006/07/02 11:06:24 roro Exp $
+$Id: README.Debian,v 1.3 2006/07/18 14:48:48 david__schmidt Exp $
-privoxy (3.0.4.cvs20060917-1) UNRELEASED; urgency=low
+privoxy (3.0.5~cvs20060923-1) UNRELEASED; urgency=low
- * New upstream CVS snapshot as of 2006-09-17.
+ * New upstream CVS snapshot as of 2006-09-23.
* hide-referrer{foo} now allows everything as a forged referrer not
only http/https URLs and ignoring invalid URLs (Closes: #258193).
* Fixes the name of the filter from "popups" to "all-popups" in
* Adapted all patches to this version.
* The following patches are incorporated upstream now, so they are no
longer needed: 01_local_usermanual.dpatch, 04_nomultiproxy.dpatch,
- 08_log_pthread.dpatch, 09_no_identity.dpatch,
+ 07_typos.dpatch, 08_log_pthread.dpatch, 09_no_identity.dpatch,
12_multiple-filters.dpatch, 13_memory.dpatch, 18_dns_retry.dpatch.
* 20_makefile_fixup.dpatch: Fix a syntax error in the GNUmakefile.in.
* 05_default_action.dpatch: main parts are incorporated upstream now.
cause they use %01 and %02 as delimiters for multipage results
(Closes: #243245).
* 03_ipv6.dpatch: Add IPv6 support (Closes: #179461).
-
- -- Roland Rosenfeld <roland@debian.org> Sun, 17 Sep 2006 10:00:08 +0200
+ * 23_fix_faq_id.dpatch: Fix value of id attribute in <sect2> tag (no
+ underscore allowed) of faq.sgml.
+ * 24_global_action.dpatch: Move the global default for all pages (/)
+ from default.action to global.action to make updates with local
+ configurations easier.
+ * 25_standard_medium.dpatch: Change the global default from
+ standard.Cautious to standard.Medium, which is similar to the old
+ 3.0.3 behavior and doesn't change too much (only
+ filter{js-annoyances}, filter{html-annoyances} and
+ filter{unsolicited-popups} are switched off now additionally).
+ * 26_edit_only_writable.dpatch: Hide the edit button on
+ http://p.p/show-status if action file can not be written by the
+ privoxy user.
+ * default.action and standard.action are no longer owned by privoxy but
+ by root to show that these files are maintained upstream while users
+ should maintain their local changes in global.action and user.action.
+
+ -- Roland Rosenfeld <roland@debian.org> Sat, 23 Sep 2006 14:22:21 +0200
privoxy (3.0.3-2-2) unstable; urgency=low
-# 01_local_usermanual.dpatch # now upstream
02_linkcolor.dpatch
03_ipv6.dpatch
-# 04_nomultiproxy.dpatch # now upstream
05_defaut_action.dpatch
06_8bit_manual.dpatch
-07_typos.dpatch
-# 08_log_pthread.dpatch # now upstream
-# 09_no_identity.dpatch # now upstream
10_backup_doc.dpatch
11_backup_autotools.dpatch
-# 12_multiple-filters.dpatch # now upstream
-# 13_memory.dpatch # new upstream
14_config.dpatch
15_mansection8.dpatch
# 16_gzip.dpatch # still broken.
17_502_no_such_domain.dpatch
-# 18_dns_retry.dpatch # now upstream
19_manpage_fixup.dpatch
20_makefile_fixup.dpatch
-21_version_3.0.4.dpatch
-# 22_user_action.dpatch # now upstream
+23_fix_faq_id.dpatch
+24_global_action.dpatch
+25_standard_medium.dpatch
+26_edit_only_writable.dpatch
+++ /dev/null
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 01_local_usermanual.dpatch by Roland Rosenfeld <roland@debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Add new "cgi" user-manual, which sends the user manual to the client
-## DP: and activate it in config file (Closes: #148128).
-
-@DPATCH@
-diff -urNad privoxy~/cgi.c privoxy/cgi.c
---- privoxy~/cgi.c
-+++ privoxy/cgi.c
-@@ -616,6 +616,9 @@
- { "t",
- cgi_transparent_image,
- NULL, TRUE /* Send a transparent image (short name) */ },
-+ { "user-manual",
-+ cgi_send_user_manual,
-+ NULL, TRUE /* Send user-manual */ },
- { NULL, /* NULL Indicates end of list and default page */
- cgi_error_404,
- NULL, TRUE /* Unknown CGI page */ }
-@@ -828,21 +831,28 @@
- {
- return cgi_error_memory();
- }
--
- query_args_start = path_copy;
-- while (*query_args_start && *query_args_start != '?')
-+ while (*query_args_start && *query_args_start != '?' && *query_args_start != '/')
- {
- query_args_start++;
- }
-- if (*query_args_start == '?')
-+ if (*query_args_start == '/')
- {
- *query_args_start++ = '\0';
-- }
--
-- if (NULL == (param_list = parse_cgi_parameters(query_args_start)))
-- {
-- free(path_copy);
-- return cgi_error_memory();
-+ if ((param_list = new_map()))
-+ {
-+ map(param_list, "file", 1, url_decode(query_args_start), 0);
-+ }
-+ } else {
-+ if (*query_args_start == '?')
-+ {
-+ *query_args_start++ = '\0';
-+ }
-+ if (NULL == (param_list = parse_cgi_parameters(query_args_start)))
-+ {
-+ free(path_copy);
-+ return cgi_error_memory();
-+ }
- }
-
- /*
-@@ -1604,7 +1614,13 @@
- if (!item) return NULL;
-
- result = strdup("<a href=\"");
-- string_append(&result, config->usermanual);
-+ if (config->usermanual[0] == '/') {
-+ string_append(&result, "http://");
-+ string_append(&result, CGI_SITE_2_HOST);
-+ string_append(&result, "/user-manual/");
-+ } else {
-+ string_append(&result, config->usermanual);
-+ }
- string_append(&result, ACTIONS_HELP_PREFIX);
- string_join (&result, string_toupper(item));
- string_append(&result, "\">");
-@@ -2193,7 +2209,11 @@
- if (!err) err = map(exports, "default-cgi", 1, html_encode(CGI_PREFIX), 0);
- if (!err) err = map(exports, "menu", 1, make_menu(caller), 0);
- if (!err) err = map(exports, "code-status", 1, CODE_STATUS, 1);
-- if (!err) err = map(exports, "user-manual", 1, csp->config->usermanual ,1);
-+ if (csp->config->usermanual[0] == '/') {
-+ if (!err) err = map(exports, "user-manual", 1, "http://"CGI_SITE_2_HOST"/user-manual/" ,1);
-+ } else {
-+ if (!err) err = map(exports, "user-manual", 1, csp->config->usermanual ,1);
-+ }
- if (!err) err = map(exports, "actions-help-prefix", 1, ACTIONS_HELP_PREFIX ,1);
- #ifdef FEATURE_TOGGLE
- if (!err) err = map_conditional(exports, "enabled-display", global_toggle_state);
-diff -urNad privoxy~/cgisimple.c privoxy/cgisimple.c
---- privoxy~/cgisimple.c
-+++ privoxy/cgisimple.c
-@@ -660,6 +660,89 @@
- return JB_ERR_OK;
-
- }
-+/*********************************************************************
-+ *
-+ * Function : cgi_send_user_manual
-+ *
-+ * Description : CGI function that sends a user manual HTML file
-+ *
-+ * Parameters :
-+ * 1 : csp = Current client state (buffers, headers, etc...)
-+ * 2 : rsp = http_response data structure for output
-+ * 3 : parameters = map of cgi parameters
-+ *
-+ * CGI Parameters : file=name.html, the mane of the HTML file
-+ * (relative to user-manual from config)
-+ *
-+ * Returns : JB_ERR_OK on success
-+ * 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;
-+ char *full_path;
-+ FILE *fp;
-+ char buf[BUFFER_SIZE];
-+
-+ assert(csp);
-+ assert(rsp);
-+ assert(parameters);
-+
-+ get_string_param(parameters, "file", &filename);
-+ /* Check paramter for hack attempts */
-+ if (filename && strchr(filename, '/')) {
-+ return JB_ERR_CGI_PARAMS;
-+ }
-+ if (filename && strstr(filename, "..")) {
-+ return JB_ERR_CGI_PARAMS;
-+ }
-+
-+ full_path = make_path(csp->config->usermanual,
-+ filename?filename:"index.html");
-+ if (full_path == NULL)
-+ {
-+ return JB_ERR_MEMORY;
-+ }
-+
-+ /* Allocate buffer */
-+ rsp->body = strdup("");
-+ if (rsp->body == NULL)
-+ {
-+ free(full_path);
-+ return JB_ERR_MEMORY;
-+ }
-+
-+ /* Open user-manual file */
-+ if (NULL == (fp = fopen(full_path, "r")))
-+ {
-+ log_error(LOG_LEVEL_ERROR, "Cannot open user-manual file %s: %E", full_path);
-+ free(full_path);
-+ free(rsp->body);
-+ return JB_ERR_FILE;
-+ }
-+ free(full_path);
-+
-+ /* Read file and write it out */
-+ while (fgets(buf, BUFFER_SIZE, fp))
-+ {
-+ if (string_append(&rsp->body, buf))
-+ {
-+ fclose(fp);
-+ return JB_ERR_MEMORY;
-+ }
-+ }
-+ fclose(fp);
-+
-+ if (enlist(rsp->headers, "Content-Type: text/html"))
-+ {
-+ return JB_ERR_MEMORY;
-+ }
-+
-+ return JB_ERR_OK;
-+}
-
-
- /*********************************************************************
-diff -urNad privoxy~/cgisimple.h privoxy/cgisimple.h
---- privoxy~/cgisimple.h
-+++ privoxy/cgisimple.h
-@@ -132,6 +132,9 @@
- extern jb_err cgi_send_stylesheet(struct client_state *csp,
- struct http_response *rsp,
- const struct map *parameters);
-+extern jb_err cgi_send_user_manual(struct client_state *csp,
-+ struct http_response *rsp,
-+ const struct map *parameters);
-
- #ifdef FEATURE_GRACEFUL_TERMINATION
- extern jb_err cgi_die (struct client_state *csp,
-diff -urNad privoxy~/loadcfg.c privoxy/loadcfg.c
---- privoxy~/loadcfg.c
-+++ privoxy/loadcfg.c
-@@ -1605,7 +1605,13 @@
- * link to it's section in the user-manual
- */
- buf = strdup("\n<br><a href=\"");
-- string_append(&buf, config->usermanual);
-+ if (config->usermanual[0] == '/') {
-+ string_append(&buf, "http://");
-+ string_append(&buf, CGI_SITE_2_HOST);
-+ string_append(&buf, "/user-manual/");
-+ } else {
-+ string_append(&buf, config->usermanual);
-+ }
- string_append(&buf, CONFIG_HELP_PREFIX);
- string_join (&buf, string_toupper(command));
- string_append(&buf, "\">");
* Based on the Internet Junkbuster originally written
* by and Copyright (C) 1997 Anonymous Coders and
* Junkbusters Corporation. http://www.junkbusters.com
-@@ -2221,7 +2224,6 @@
+@@ -2250,7 +2253,6 @@
*********************************************************************/
struct map *default_exports(const struct client_state *csp, const char *caller)
{
jb_err err;
struct map * exports;
int local_help_exists = 0;
-@@ -2257,8 +2259,7 @@
+@@ -2286,8 +2288,7 @@
if (!err) err = map_block_killer(exports, "can-toggle");
#endif
* Based on the Internet Junkbuster originally written
* by and Copyright (C) 1997 Anonymous Coders and
* Junkbusters Corporation. http://www.junkbusters.com
-@@ -465,6 +468,9 @@
+@@ -468,6 +471,9 @@
#include <ctype.h>
#include <string.h>
#include <assert.h>
#ifndef _WIN32
#ifndef __OS2__
-@@ -499,17 +505,119 @@
+@@ -502,17 +508,119 @@
const char filters_h_rcs[] = FILTERS_H_VERSION;
/*********************************************************************
*
* Function : block_acl
-@@ -539,7 +647,7 @@
+@@ -542,7 +650,7 @@
/* search the list */
while (acl != NULL)
{
{
if (dst == NULL)
{
-@@ -549,8 +657,8 @@
+@@ -552,8 +660,8 @@
return(0);
}
}
{
if (acl->action == ACL_PERMIT)
{
-@@ -569,81 +677,249 @@
+@@ -572,81 +680,249 @@
}
diff -urNad privoxy~/jcc.c privoxy/jcc.c
--- privoxy~/jcc.c
+++ privoxy/jcc.c
-@@ -744,6 +744,7 @@
+@@ -747,6 +747,7 @@
#include "cgi.h"
#include "loadcfg.h"
#include "urlmatch.h"
const char jcc_h_rcs[] = JCC_H_VERSION;
const char project_h_rcs[] = PROJECT_H_VERSION;
-@@ -2304,61 +2305,78 @@
+@@ -2306,61 +2307,78 @@
* Returns : Port that was opened.
*
*********************************************************************/
}
-@@ -2387,12 +2405,18 @@
+@@ -2389,12 +2407,18 @@
static void listen_loop(void)
{
struct client_state *csp = NULL;
#ifdef FEATURE_GRACEFUL_TERMINATION
while (!g_terminate)
-@@ -2466,14 +2490,55 @@
+@@ -2468,14 +2492,55 @@
* that this will hurt people's feelings.
*/
{
log_error(LOG_LEVEL_CONNECT, "accept failed: %E");
-@@ -2491,6 +2556,8 @@
+@@ -2493,6 +2558,8 @@
log_error(LOG_LEVEL_CONNECT, "OK");
}
* Based on the Internet Junkbuster originally written
* by and Copyright (C) 1997 Anonymous Coders and
* Junkbusters Corporation. http://www.junkbusters.com
-@@ -1929,6 +1932,167 @@
+@@ -1932,6 +1935,167 @@
return JB_ERR_OK;
}
diff -urNad privoxy~/project.h privoxy/project.h
--- privoxy~/project.h
+++ privoxy/project.h
-@@ -598,6 +598,20 @@
+@@ -607,6 +607,20 @@
#endif /* ndef _WIN32 */
/**
* A standard error code. This should be JB_ERR_OK or one of the JB_ERR_xxx
-@@ -667,19 +681,6 @@
+@@ -681,19 +695,6 @@
*/
#define FOREVER 1
/* Forward def for struct client_state */
struct configuration_spec;
-@@ -758,13 +759,16 @@
+@@ -772,13 +773,16 @@
char *ver; /**< Protocol version */
int status; /**< HTTP Status */
of host's IP. NULL before connect_to() */
char *dbuffer; /**< Buffer with '\0'-delimited domain name. */
-@@ -1144,13 +1148,16 @@
+@@ -1158,13 +1162,16 @@
As a string. */
char *ip_addr_str;
/** Client PC's IP address, as reported by the accept() function.
/** Our hostname. I.e. the reverse DNS of the IP address that the client
used to reach us, as a string. */
char *my_hostname;
-@@ -1325,18 +1332,33 @@
+@@ -1339,18 +1346,33 @@
/** Connection type. Must be SOCKS_NONE, SOCKS_4, or SOCKS_4A. */
int type;
/** Next entry in the linked list. */
struct forward_spec *next;
};
-@@ -1345,7 +1367,7 @@
+@@ -1359,7 +1381,7 @@
/**
* Initializer for a static struct forward_spec.
*/
/**
-@@ -1374,7 +1396,8 @@
+@@ -1388,7 +1410,8 @@
*/
struct access_control_addr
{
unsigned long mask; /**< The network mask as an integer. */
unsigned long port; /**< The port number. */
};
-@@ -1409,6 +1432,17 @@
+@@ -1423,6 +1446,17 @@
/** configuration_spec::feature_flags: HTTP-header-based toggle. */
#define RUNTIME_FEATURE_HTTP_TOGGLE 4
/**
* Data loaded from the configuration file.
*
-@@ -1472,11 +1506,13 @@
+@@ -1486,11 +1520,13 @@
#endif /* def FEATURE_COOKIE_JAR */
+++ /dev/null
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 04_multiproxy.dpatch by Roland Rosenfeld <roland@debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: emove comment from config file and FAQ, which points to list of
-## DP: open proxies at multiproxy.org (Closes: #198953).
-
-@DPATCH@
-diff -urNad privoxy~/config privoxy/config
---- privoxy~/config
-+++ privoxy/config
-@@ -931,11 +931,10 @@
- # This feature allows routing of HTTP requests through a chain
- # of multiple proxies. It can be used to better protect privacy
- # and confidentiality when accessing specific domains by routing
--# requests to those domains through an anonymous public proxy (see
--# e.g. http://www.multiproxy.org/anon_list.htm) Or to use a caching
--# proxy to speed up browsing. Or chaining to a parent proxy may be
--# necessary because the machine that Privoxy runs on has no direct
--# Internet access.
-+# requests to those domains through an anonymous public proxy or
-+# use a caching proxy to speed up browsing. Or chaining to a parent
-+# proxy may be necessary because the machine that Privoxy runs on has
-+# no direct Internet access.
- #
- # Also specified here are SOCKS proxies. Privoxy supports the SOCKS
- # 4 and SOCKS 4A protocols.
-diff -urNad privoxy~/doc/source/p-config.sgml privoxy/doc/source/p-config.sgml
---- privoxy~/doc/source/p-config.sgml
-+++ privoxy/doc/source/p-config.sgml
-@@ -1606,9 +1606,8 @@
- multiple proxies.
- It can be used to better protect privacy and confidentiality when
- accessing specific domains by routing requests to those domains
-- through an anonymous public proxy (see e.g. <ulink
-- url="http://www.multiproxy.org/anon_list.htm">http://www.multiproxy.org/anon_list.htm</ulink>)
-- Or to use a caching proxy to speed up browsing. Or chaining to a parent
-+ through an anonymous public proxy
-+ or to use a caching proxy to speed up browsing. Or chaining to a parent
- proxy may be necessary because the machine that <application>Privoxy</application>
- runs on has no direct Internet access.
- </para>
diff -urNad privoxy~/default.action.master privoxy/default.action.master
--- privoxy~/default.action.master
+++ privoxy/default.action.master
-@@ -1844,3 +1844,8 @@
+@@ -1891,3 +1891,8 @@
{ +filter{js-events} }
#MASTER# PROBLEM-URL: http://www.pharmcast.com/WarningLetters/Yr2002/December2002/J&J1202.htm
www.pharmcast.com/
+++ /dev/null
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 07_typos.dpatch by Roland Rosenfeld <roland@debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: s/persistant/persistent/, s/Januar/January/ in man page.
-## DP: Several typos in user-manual fixed.
-
-@DPATCH@
-diff -urNad privoxy~/doc/source/privoxy-man-page.sgml privoxy/doc/source/privoxy-man-page.sgml
---- privoxy~/doc/source/privoxy-man-page.sgml
-+++ privoxy/doc/source/privoxy-man-page.sgml
-@@ -367,7 +367,7 @@
-
- # Set personal exceptions to the policies in default.action #######
-
-- # Sites where we want persistant cookies, so allow *all* cookies
-+ # Sites where we want persistent cookies, so allow *all* cookies
- {-crunch-cookies -session-cookies-only}
- .redhat.com
- .sun.com
+++ /dev/null
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 08_log_pthread.dpatch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Fix race conditions in log writing functions (Closes: #299662).
-
-@DPATCH@
-diff -urNad privoxy-dpatch~/errlog.c privoxy-dpatch/errlog.c
---- privoxy-dpatch~/errlog.c 2006-02-05 16:17:43.000000000 +0100
-+++ privoxy-dpatch/errlog.c 2006-02-05 16:18:06.000000000 +0100
-@@ -292,6 +292,30 @@
- static char *os2_socket_strerr(int errcode, char *tmp_buf);
- #endif
-
-+#ifdef FEATURE_PTHREAD
-+static inline void lock_logfile()
-+{
-+ pthread_mutex_lock(&log_mutex);
-+}
-+static inline void unlock_logfile()
-+{
-+ pthread_mutex_unlock(&log_mutex);
-+}
-+static inline void lock_loginit()
-+{
-+ pthread_mutex_lock(&log_init_mutex);
-+}
-+static inline void unlock_loginit()
-+{
-+ pthread_mutex_unlock(&log_init_mutex);
-+}
-+#else /* ! FEATURE_PTHREAD */
-+static inline void lock_logfile() {}
-+static inline void unlock_logfile() {}
-+static inline void lock_loginit() {}
-+static inline void unlock_loginit() {}
-+#endif
-+
- /*********************************************************************
- *
- * Function : fatal_error
-@@ -346,7 +370,7 @@
- {
- FILE *fp;
-
-- /* FIXME RACE HAZARD: should start critical section error_log_use here */
-+ lock_loginit();
-
- /* set the logging detail level */
- debug = debuglevel | LOG_LEVEL_MINIMUM;
-@@ -354,9 +378,13 @@
- if ((logfp != NULL) && (logfp != stderr))
- {
- log_error(LOG_LEVEL_INFO, "(Re-)Open logfile %s", logfname ? logfname : "none");
-+ lock_logfile();
- fclose(logfp);
-+ } else {
-+ lock_logfile();
- }
- logfp = stderr;
-+ unlock_logfile();
-
- /* set the designated log file */
- if( logfname )
-@@ -369,7 +397,9 @@
- /* set logging to be completely unbuffered */
- setbuf(fp, NULL);
-
-+ lock_logfile();
- logfp = fp;
-+ unlock_logfile();
- }
-
- log_error(LOG_LEVEL_INFO, "Privoxy version " VERSION);
-@@ -378,7 +408,7 @@
- log_error(LOG_LEVEL_INFO, "Program name: %s", prog_name);
- }
-
-- /* FIXME RACE HAZARD: should end critical section error_log_use here */
-+ unlock_loginit();
-
- } /* init_error_log */
-
-@@ -428,6 +458,9 @@
- return;
- }
-
-+ /* protect the whole function because of the static buffer (outbuf) */
-+ lock_logfile();
-+
- /* FIXME get current thread id */
- #ifdef FEATURE_PTHREAD
- this_thread = (long)pthread_self();
-@@ -480,41 +513,41 @@
- switch (loglevel)
- {
- case LOG_LEVEL_ERROR:
-- outc = sprintf(outbuf, "Privoxy(%05ld) Error: ", this_thread);
-+ outc = sprintf(outbuf, "Privoxy(%08lx) Error: ", this_thread);
- break;
- case LOG_LEVEL_FATAL:
-- outc = sprintf(outbuf, "Privoxy(%05ld) Fatal error: ", this_thread);
-+ outc = sprintf(outbuf, "Privoxy(%08lx) Fatal error: ", this_thread);
- break;
- case LOG_LEVEL_GPC:
-- outc = sprintf(outbuf, "Privoxy(%05ld) Request: ", this_thread);
-+ outc = sprintf(outbuf, "Privoxy(%08lx) Request: ", this_thread);
- break;
- case LOG_LEVEL_CONNECT:
-- outc = sprintf(outbuf, "Privoxy(%05ld) Connect: ", this_thread);
-+ outc = sprintf(outbuf, "Privoxy(%08lx) Connect: ", this_thread);
- break;
- case LOG_LEVEL_LOG:
-- outc = sprintf(outbuf, "Privoxy(%05ld) Writing: ", this_thread);
-+ outc = sprintf(outbuf, "Privoxy(%08lx) Writing: ", this_thread);
- break;
- case LOG_LEVEL_HEADER:
-- outc = sprintf(outbuf, "Privoxy(%05ld) Header: ", this_thread);
-+ outc = sprintf(outbuf, "Privoxy(%08lx) Header: ", this_thread);
- break;
- case LOG_LEVEL_INFO:
-- outc = sprintf(outbuf, "Privoxy(%05ld) Info: ", this_thread);
-+ outc = sprintf(outbuf, "Privoxy(%08lx) Info: ", this_thread);
- break;
- case LOG_LEVEL_RE_FILTER:
-- outc = sprintf(outbuf, "Privoxy(%05ld) Re-Filter: ", this_thread);
-+ outc = sprintf(outbuf, "Privoxy(%08lx) Re-Filter: ", this_thread);
- break;
- #ifdef FEATURE_FORCE_LOAD
- case LOG_LEVEL_FORCE:
-- outc = sprintf(outbuf, "Privoxy(%05ld) Force: ", this_thread);
-+ outc = sprintf(outbuf, "Privoxy(%08lx) Force: ", this_thread);
- break;
- #endif /* def FEATURE_FORCE_LOAD */
- #ifdef FEATURE_FAST_REDIRECTS
- case LOG_LEVEL_REDIRECTS:
-- outc = sprintf(outbuf, "Privoxy(%05ld) Redirect: ", this_thread);
-+ outc = sprintf(outbuf, "Privoxy(%08lx) Redirect: ", this_thread);
- break;
- #endif /* def FEATURE_FAST_REDIRECTS */
- case LOG_LEVEL_DEANIMATE:
-- outc = sprintf(outbuf, "Privoxy(%05ld) Gif-Deanimate: ", this_thread);
-+ outc = sprintf(outbuf, "Privoxy(%08lx) Gif-Deanimate: ", this_thread);
- break;
- case LOG_LEVEL_CLF:
- outbuf = outbuf_save;
-@@ -523,14 +556,14 @@
- break;
- #ifdef FEATURE_KILL_POPUPS
- case LOG_LEVEL_POPUPS:
-- outc = sprintf(outbuf, "Privoxy(%05ld) Kill-Popups: ", this_thread);
-+ outc = sprintf(outbuf, "Privoxy(%08lx) Kill-Popups: ", this_thread);
- break;
- #endif /* def FEATURE_KILL_POPUPS */
- case LOG_LEVEL_CGI:
-- outc = sprintf(outbuf, "Privoxy(%05ld) CGI: ", this_thread);
-+ outc = sprintf(outbuf, "Privoxy(%08lx) CGI: ", this_thread);
- break;
- default:
-- outc = sprintf(outbuf, "Privoxy(%05ld) UNKNOWN LOG TYPE(%d): ", this_thread, loglevel);
-+ outc = sprintf(outbuf, "Privoxy(%08lx) UNKNOWN LOG TYPE(%d): ", this_thread, loglevel);
- break;
- }
-
-@@ -605,16 +638,14 @@
- else
- {
- /* Error */
-- sprintf(outbuf, "Privoxy(%ld) Error: log_error(): Bad format string:\n"
-+ sprintf(outbuf, "Privoxy(%08lx) Error: log_error(): Bad format string:\n"
- "Format = \"%s\"\n"
- "Exiting.", this_thread, fmt);
-- /* FIXME RACE HAZARD: should start critical section error_log_use here */
- if( !logfp )
- {
- logfp = stderr;
- }
- fputs(outbuf, logfp);
-- /* FIXME RACE HAZARD: should end critical section error_log_use here */
- fatal_error(outbuf);
- /* Never get here */
- break;
-@@ -768,16 +799,15 @@
- }
- break;
- default:
-- sprintf(outbuf, "Privoxy(%ld) Error: log_error(): Bad format string:\n"
-+ sprintf(outbuf, "Privoxy(%08lx) Error: log_error(): Bad format string:\n"
- "Format = \"%s\"\n"
- "Exiting.", this_thread, fmt);
-- /* FIXME RACE HAZARD: should start critical section error_log_use here */
- if( !logfp )
- {
- logfp = stderr;
- }
- fputs(outbuf_save, logfp);
-- /* FIXME RACE HAZARD: should end critical section error_log_use here */
-+ unlock_logfile();
- fatal_error(outbuf_save);
- /* Never get here */
- break;
-@@ -814,8 +844,6 @@
- outbuf[outc] = '\0';
- }
-
-- /* FIXME RACE HAZARD: should start critical section error_log_use here */
--
- /* deal with glibc stupidity - it won't let you initialize logfp */
- if( !logfp )
- {
-@@ -830,7 +858,7 @@
- /* Never get here */
- }
-
-- /* FIXME RACE HAZARD: should end critical section error_log_use here */
-+ unlock_logfile();
-
- #if defined(_WIN32) && !defined(_WIN_CONSOLE)
- /* Write to display */
-diff -urNad privoxy-dpatch~/jcc.c privoxy-dpatch/jcc.c
---- privoxy-dpatch~/jcc.c 2006-02-05 16:17:43.000000000 +0100
-+++ privoxy-dpatch/jcc.c 2006-02-05 16:18:06.000000000 +0100
-@@ -722,6 +722,10 @@
- pthread_mutex_t gethostbyaddr_mutex;
- pthread_mutex_t gethostbyname_mutex;
- #endif /* def OSX_DARWIN */
-+#ifdef FEATURE_PTHREAD
-+pthread_mutex_t log_mutex;
-+pthread_mutex_t log_init_mutex;
-+#endif /* FEATURE_PTHREAD */
-
- #if defined(unix) || defined(__EMX__)
- const char *basedir = NULL;
-@@ -1923,7 +1927,10 @@
- pthread_mutex_init(&gethostbyaddr_mutex,0);
- pthread_mutex_init(&gethostbyname_mutex,0);
- #endif /* def OSX_DARWIN */
--
-+#ifdef FEATURE_PTHREAD
-+ pthread_mutex_init(&log_mutex,0);
-+ pthread_mutex_init(&log_init_mutex,0);
-+#endif /* FEATURE_PTHREAD */
- /*
- * Unix signal handling
- *
-diff -urNad privoxy-dpatch~/jcc.h privoxy-dpatch/jcc.h
---- privoxy-dpatch~/jcc.h 2006-02-05 16:17:43.000000000 +0100
-+++ privoxy-dpatch/jcc.h 2006-02-05 16:18:06.000000000 +0100
-@@ -127,6 +127,10 @@
- extern pthread_mutex_t gethostbyaddr_mutex;
- extern pthread_mutex_t gethostbyname_mutex;
- #endif /* def OSX_DARWIN */
-+#ifdef FEATURE_PTHREAD
-+extern pthread_mutex_t log_mutex;
-+extern pthread_mutex_t log_init_mutex;
-+#endif /* FEATURE_PTHREAD */
-
- /* Functions */
-
+++ /dev/null
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 09_no_identity.dpatch by Michael Shields <shields@msrl.com>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: After dechunking remove the "chunked"-header instead of replacing it
-## DP: by an "identity" header. (#318683).
-
-@DPATCH@
-diff -urNad privoxy~/parsers.c privoxy/parsers.c
---- privoxy~/parsers.c
-+++ privoxy/parsers.c
-@@ -1248,8 +1248,7 @@
- *
- * Description : - Prohibit filtering (CT_TABOO) if transfer coding compresses
- * - Raise the CSP_FLAG_CHUNKED flag if coding is "chunked"
-- * - Change from "chunked" to "identity" if body was chunked
-- * but has been de-chunked for filtering.
-+ * - Remove if chunked body was de-chunked for filtering.
- *
- * Parameters :
- * 1 : csp = Current client state (buffers, headers, etc...)
-@@ -1281,14 +1280,13 @@
-
- /*
- * If the body was modified, it has been
-- * de-chunked first, so adjust the header:
-+ * de-chunked first, so remove the header.
-+ * Don't use "identity" encoding, which was included in
-+ * RFC 2616 by mistake (http://purl.org/NET/http-errata#identity).
- */
- if (csp->flags & CSP_FLAG_MODIFIED)
- {
- freez(*header);
-- *header = strdup("Transfer-Encoding: identity");
-- log_error(LOG_LEVEL_HEADER, "Set: %s", *header);
-- return (header == NULL) ? JB_ERR_MEMORY : JB_ERR_OK;
- }
- }
-
+++ /dev/null
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 12_multiple-filters.dpatch
-## by David Schmidt <david__schmidt@users.sourceforge.net>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Multiple filter file support
-
-@DPATCH@
-diff -urNad privoxy~/actions.c privoxy/actions.c
---- privoxy~/actions.c 2006-02-11 23:44:25.000000000 +0100
-+++ privoxy/actions.c 2006-02-11 23:44:37.000000000 +0100
-@@ -871,7 +871,7 @@
- }
-
-
--static struct file_list *current_actions_file[MAX_ACTION_FILES] = {
-+static struct file_list *current_actions_file[MAX_AF_FILES] = {
- NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL
- };
-@@ -894,7 +894,7 @@
- {
- int i;
-
-- for (i = 0; i < MAX_ACTION_FILES; i++)
-+ for (i = 0; i < MAX_AF_FILES; i++)
- {
- if (current_actions_file[i])
- {
-@@ -979,7 +979,7 @@
- int i;
- int result;
-
-- for (i = 0; i < MAX_ACTION_FILES; i++)
-+ for (i = 0; i < MAX_AF_FILES; i++)
- {
- if (csp->config->actions_file[i])
- {
-diff -urNad privoxy~/cgiedit.c privoxy/cgiedit.c
---- privoxy~/cgiedit.c 2006-02-11 23:44:25.000000000 +0100
-+++ privoxy/cgiedit.c 2006-02-11 23:44:37.000000000 +0100
-@@ -2560,7 +2560,7 @@
- }
-
- buttons = strdup("");
-- for (i = 0; i < MAX_ACTION_FILES; i++)
-+ for (i = 0; i < MAX_AF_FILES; i++)
- {
- if (((fl = csp->actions_list[i]) != NULL) && ((b = fl->f) != NULL))
- {
-@@ -2958,8 +2958,8 @@
- struct file_line * cur_line;
- unsigned line_number;
- jb_err err;
-- struct file_list *filter_file;
- struct re_filterfile_spec *filter_group;
-+ int i, have_filters = 0;
-
- if (0 == (csp->config->feature_flags & RUNTIME_FEATURE_CGI_EDIT_ACTIONS))
- {
-@@ -3008,10 +3008,15 @@
-
- if (!err) err = actions_to_radio(exports, cur_line->data.action);
-
-- filter_file = csp->rlist;
-- filter_group = ((filter_file != NULL) ? filter_file->f : NULL);
--
-- if (!err) err = map_conditional(exports, "any-filters-defined", (filter_group != NULL));
-+ for (i = 0; i < MAX_AF_FILES; i++)
-+ {
-+ if ((csp->rlist[i] != NULL) && (csp->rlist[i]->f != NULL))
-+ {
-+ if (!err) err = map_conditional(exports, "any-filters-defined", 1);
-+ have_filters = 1;
-+ break;
-+ }
-+ }
-
- if (err)
- {
-@@ -3020,10 +3025,8 @@
- return err;
- }
-
-- if (filter_group == NULL)
-- {
-+ if (0 == have_filters)
- err = map(exports, "filter-params", 1, "", 1);
-- }
- else
- {
- /* We have some entries in the filter list */
-@@ -3047,69 +3050,76 @@
-
- result = strdup("");
-
-- for (;(!err) && (filter_group != NULL); filter_group = filter_group->next)
-+ for (i = 0; i < MAX_AF_FILES; i++)
- {
-- char current_mode = 'x';
-- struct list_entry *filter_name;
-- char * this_line;
-- struct map *line_exports;
-- char number[20];
--
-- filter_name = cur_line->data.action->multi_add[ACTION_MULTI_FILTER]->first;
-- while ((filter_name != NULL)
-- && (0 != strcmp(filter_group->name, filter_name->str)))
-- {
-- filter_name = filter_name->next;
-- }
--
-- if (filter_name != NULL)
-- {
-- current_mode = 'y';
-- }
-- else
-+ if ((csp->rlist[i] != NULL) && (csp->rlist[i]->f != NULL))
- {
-- filter_name = cur_line->data.action->multi_remove[ACTION_MULTI_FILTER]->first;
-- while ((filter_name != NULL)
-- && (0 != strcmp(filter_group->name, filter_name->str)))
-- {
-- filter_name = filter_name->next;
-- }
-- if (filter_name != NULL)
-+ filter_group = csp->rlist[i]->f;
-+ for (;(!err) && (filter_group != NULL); filter_group = filter_group->next)
- {
-- current_mode = 'n';
-- }
-- }
-+ char current_mode = 'x';
-+ struct list_entry *filter_name;
-+ char * this_line;
-+ struct map *line_exports;
-+ char number[20];
-
-- /* Generate a unique serial number */
-- snprintf(number, sizeof(number), "%x", index++);
-- number[sizeof(number) - 1] = '\0';
-+ filter_name = cur_line->data.action->multi_add[ACTION_MULTI_FILTER]->first;
-+ while ((filter_name != NULL)
-+ && (0 != strcmp(filter_group->name, filter_name->str)))
-+ {
-+ filter_name = filter_name->next;
-+ }
-
-- line_exports = new_map();
-- if (line_exports == NULL)
-- {
-- err = JB_ERR_MEMORY;
-- freez(result);
-- }
-- else
-- {
-- if (!err) err = map(line_exports, "index", 1, number, 1);
-- if (!err) err = map(line_exports, "name", 1, filter_group->name, 1);
-- if (!err) err = map(line_exports, "description", 1, filter_group->description, 1);
-- if (!err) err = map_radio(line_exports, "this-filter", "ynx", current_mode);
-+ if (filter_name != NULL)
-+ {
-+ current_mode = 'y';
-+ }
-+ else
-+ {
-+ filter_name = cur_line->data.action->multi_remove[ACTION_MULTI_FILTER]->first;
-+ log_error(LOG_LEVEL_CGI, "cgiedit: filter_group->name: [%s]",filter_group->name);
-+ while ((filter_name != NULL)
-+ && (0 != strcmp(filter_group->name, filter_name->str)))
-+ {
-+ filter_name = filter_name->next;
-+ }
-+ if (filter_name != NULL)
-+ {
-+ current_mode = 'n';
-+ }
-+ }
-
-- this_line = NULL;
-- if (!err)
-- {
-- this_line = strdup(filter_template);
-- if (this_line == NULL) err = JB_ERR_MEMORY;
-- }
-- if (!err) err = template_fill(&this_line, line_exports);
-- string_join(&result, this_line);
-+ /* Generate a unique serial number */
-+ snprintf(number, sizeof(number), "%x", index++);
-+ number[sizeof(number) - 1] = '\0';
-
-- free_map(line_exports);
-+ line_exports = new_map();
-+ if (line_exports == NULL)
-+ {
-+ err = JB_ERR_MEMORY;
-+ freez(result);
-+ }
-+ else
-+ {
-+ if (!err) err = map(line_exports, "index", 1, number, 1);
-+ if (!err) err = map(line_exports, "name", 1, filter_group->name, 1);
-+ if (!err) err = map(line_exports, "description", 1, filter_group->description, 1);
-+ if (!err) err = map_radio(line_exports, "this-filter", "ynx", current_mode);
-+
-+ this_line = NULL;
-+ if (!err)
-+ {
-+ this_line = strdup(filter_template);
-+ if (this_line == NULL) err = JB_ERR_MEMORY;
-+ }
-+ if (!err) err = template_fill(&this_line, line_exports);
-+ string_join(&result, this_line);
-+
-+ free_map(line_exports);
-+ }
-+ }
- }
- }
--
- freez(filter_template);
-
- if (!err)
-@@ -3213,7 +3223,7 @@
- get_string_param(parameters, "p", &action_set_name);
- if (action_set_name != NULL)
- {
-- for (index = 0; index < MAX_ACTION_FILES; index++)
-+ for (index = 0; index < MAX_AF_FILES; index++)
- {
- if (((fl = csp->actions_list[index]) != NULL) && ((b = fl->f) != NULL))
- {
-diff -urNad privoxy~/cgisimple.c privoxy/cgisimple.c
---- privoxy~/cgisimple.c 2006-02-11 23:44:37.000000000 +0100
-+++ privoxy/cgisimple.c 2006-02-11 23:44:37.000000000 +0100
-@@ -829,7 +829,7 @@
- switch (*(lookup(parameters, "file")))
- {
- case 'a':
-- if (!get_number_param(csp, parameters, "index", &i) && i < MAX_ACTION_FILES && csp->actions_list[i])
-+ if (!get_number_param(csp, parameters, "index", &i) && i < MAX_AF_FILES && csp->actions_list[i])
- {
- filename = csp->actions_list[i]->filename;
- file_description = "Actions File";
-@@ -837,9 +837,9 @@
- break;
-
- case 'f':
-- if (csp->rlist)
-+ if (!get_number_param(csp, parameters, "index", &i) && i < MAX_AF_FILES && csp->rlist[i])
- {
-- filename = csp->rlist->filename;
-+ filename = csp->rlist[i]->filename;
- file_description = "Filter File";
- }
- break;
-@@ -954,7 +954,7 @@
- * FIXME: Shouldn't include hardwired HTML here, use line template instead!
- */
- s = strdup("");
-- for (i = 0; i < MAX_ACTION_FILES; i++)
-+ for (i = 0; i < MAX_AF_FILES; i++)
- {
- if (((fl = csp->actions_list[i]) != NULL) && ((b = fl->f) != NULL))
- {
-@@ -983,13 +983,29 @@
- if (!err) err = map(exports, "actions-filenames", 1, "<tr><td>None specified</td></tr>", 1);
- }
-
-- if (csp->rlist)
-+ /*
-+ * List all re_filterfiles in use, together with view options.
-+ * FIXME: Shouldn't include hardwired HTML here, use line template instead!
-+ */
-+ s = strdup("");
-+ for (i = 0; i < MAX_AF_FILES; i++)
- {
-- if (!err) err = map(exports, "re-filter-filename", 1, html_encode(csp->rlist->filename), 0);
-+ if (((fl = csp->rlist[i]) != NULL) && ((b = fl->f) != NULL))
-+ {
-+ if (!err) err = string_append(&s, "<tr><td>");
-+ if (!err) err = string_join(&s, html_encode(csp->rlist[i]->filename));
-+ snprintf(buf, 100, "</td><td class=\"buttons\"><a href=\"/show-status?file=filter&index=%d\">View</a>", i);
-+ if (!err) err = string_append(&s, buf);
-+ if (!err) err = string_append(&s, "</td></tr>\n");
-+ }
-+ }
-+ if (*s != '\0')
-+ {
-+ if (!err) err = map(exports, "re-filter-filename", 1, s, 0);
- }
- else
- {
-- if (!err) err = map(exports, "re-filter-filename", 1, "None specified", 1);
-+ if (!err) err = map(exports, "re-filter-filename", 1, "<tr><td>None specified</td></tr>", 1);
- if (!err) err = map_block_killer(exports, "have-filterfile");
- }
-
-@@ -1206,7 +1222,7 @@
-
- matches = strdup("<table class=\"transparent\">");
-
-- for (i = 0; i < MAX_ACTION_FILES; i++)
-+ for (i = 0; i < MAX_AF_FILES; i++)
- {
- if (NULL == csp->config->actions_file_short[i]
- || !strcmp(csp->config->actions_file_short[i], "standard")) continue;
-diff -urNad privoxy~/config privoxy/config
---- privoxy~/config 2006-02-11 23:44:37.000000000 +0100
-+++ privoxy/config 2006-02-11 23:44:37.000000000 +0100
-@@ -182,7 +182,7 @@
- #
- # Specifies:
- #
--# The filter file to use
-+# The filter file(s) to use
- #
- # Type of value:
- #
-@@ -199,21 +199,23 @@
- #
- # Notes:
- #
--# The filter file contains content modification rules that use
-+# The filter files contain content modification rules that use
- # regular expressions. These rules permit powerful changes on the
- # content of Web pages, e.g., you could disable your favorite
- # JavaScript annoyances, re-write the actual displayed text,
--# or just have some fun replacing "Microsoft" with "MicroSuck"
--# wherever it appears on a Web page.
-+# or just have some fun playing buzzword bingo with a web page.
- #
- # The +filter{name} actions rely on the relevant filter (name)
--# to be defined in the filter file!
-+# to be defined in a filter file!
- #
- # A pre-defined filter file called default.filter that contains
- # a bunch of handy filters for common problems is included in the
- # distribution. See the section on the filter action for a list.
--#
-+# When adding your own, it is recommended you add them to the
-+# user.filter file.
-+#
- filterfile default.filter
-+#filterfile user.filter
-
- #
- # 1.5. logfile
-diff -urNad privoxy~/filters.c privoxy/filters.c
---- privoxy~/filters.c 2006-02-11 23:44:25.000000000 +0100
-+++ privoxy/filters.c 2006-02-11 23:44:37.000000000 +0100
-@@ -1290,6 +1290,8 @@
- struct re_filterfile_spec *b;
- struct list_entry *filtername;
-
-+ int i, found_filters = 0;
-+
- /*
- * Sanity first
- */
-@@ -1299,10 +1301,26 @@
- }
- size = csp->iob->eod - csp->iob->cur;
-
-- if ( ( NULL == (fl = csp->rlist) ) || ( NULL == fl->f) )
-+ /*
-+ * Need to check the set of re_filterfiles...
-+ */
-+ for (i = 0; i < MAX_AF_FILES; i++)
-+ {
-+ fl = csp->rlist[i];
-+ if (NULL != fl)
-+ {
-+ if (NULL != fl->f)
-+ {
-+ found_filters = 1;
-+ break;
-+ }
-+ }
-+ }
-+
-+ if (0 == found_filters)
- {
- log_error(LOG_LEVEL_ERROR, "Unable to get current state of regexp filtering.");
-- return(NULL);
-+ return(NULL);
- }
-
- /*
-@@ -1320,6 +1338,11 @@
- csp->flags |= CSP_FLAG_MODIFIED;
- }
-
-+ for (i = 0; i < MAX_AF_FILES; i++)
-+ {
-+ fl = csp->rlist[i];
-+ if ((NULL == fl) || (NULL == fl->f))
-+ break;
- /*
- * For all applying +filter actions, look if a filter by that
- * name exists and if yes, execute it's pcrs_joblist on the
-@@ -1356,6 +1379,7 @@
- }
- }
- }
-+ }
-
- /*
- * If there were no hits, destroy our copy and let
-@@ -1536,7 +1560,7 @@
-
- init_current_action(csp->action);
-
-- for (i = 0; i < MAX_ACTION_FILES; i++)
-+ for (i = 0; i < MAX_AF_FILES; i++)
- {
- if (((fl = csp->actions_list[i]) == NULL) || ((b = fl->f) == NULL))
- {
-diff -urNad privoxy~/loadcfg.c privoxy/loadcfg.c
---- privoxy~/loadcfg.c 2006-02-11 23:44:37.000000000 +0100
-+++ privoxy/loadcfg.c 2006-02-11 23:44:37.000000000 +0100
-@@ -65,7 +65,7 @@
- * - savearg now embeds option names in help links
- *
- * Revision 1.45 2002/04/24 02:11:54 oes
-- * Jon's multiple AF patch: Allow up to MAX_ACTION_FILES actionsfile options
-+ * Jon's multiple AF patch: Allow up to MAX_AF_FILES actionsfile options
- *
- * Revision 1.44 2002/04/08 20:37:13 swa
- * fixed JB spelling
-@@ -510,7 +510,7 @@
- freez(config->haddr);
- freez(config->logfile);
-
-- for (i = 0; i < MAX_ACTION_FILES; i++)
-+ for (i = 0; i < MAX_AF_FILES; i++)
- {
- freez(config->actions_file_short[i]);
- freez(config->actions_file[i]);
-@@ -530,7 +530,11 @@
- list_remove_all(config->trust_info);
- #endif /* def FEATURE_TRUST */
-
-- freez(config->re_filterfile);
-+ for (i = 0; i < MAX_AF_FILES; i++)
-+ {
-+ freez(config->re_filterfile[i]);
-+ }
-+
- freez(config);
- }
-
-@@ -694,16 +698,16 @@
- * *************************************************************************/
- case hash_actions_file :
- i = 0;
-- while ((i < MAX_ACTION_FILES) && (NULL != config->actions_file[i]))
-+ while ((i < MAX_AF_FILES) && (NULL != config->actions_file[i]))
- {
- i++;
- }
-
-- if (i >= MAX_ACTION_FILES)
-+ if (i >= MAX_AF_FILES)
- {
- log_error(LOG_LEVEL_FATAL, "Too many 'actionsfile' directives in config file - limit is %d.\n"
-- "(You can increase this limit by changing MAX_ACTION_FILES in project.h and recompiling).",
-- MAX_ACTION_FILES);
-+ "(You can increase this limit by changing MAX_AF_FILES in project.h and recompiling).",
-+ MAX_AF_FILES);
- }
- config->actions_file_short[i] = strdup(arg);
- p = malloc(strlen(arg) + sizeof(".action"));
-@@ -860,15 +864,27 @@
- * In confdir by default.
- * *************************************************************************/
- case hash_filterfile :
-- if(config->re_filterfile)
-+ i = 0;
-+ while ((i < MAX_AF_FILES) && (NULL != config->re_filterfile[i]))
- {
-- log_error(LOG_LEVEL_ERROR, "Ignoring extraneous directive 'filterfile %s' "
-- "in line %lu in configuration file (%s).", arg, linenum, configfile);
-- string_append(&config->proxy_args,
-- " <b><font color=\"red\">WARNING: extraneous directive, ignored</font></b>");
-- continue;
-+ i++;
- }
-- config->re_filterfile = make_path(config->confdir, arg);
-+
-+ if (i >= MAX_AF_FILES)
-+ {
-+ log_error(LOG_LEVEL_FATAL, "Too many 'filterfile' directives in config file - limit is %d.\n"
-+ "(You can increase this limit by changing MAX_AF_FILES in project.h and recompiling).",
-+ MAX_AF_FILES);
-+ }
-+ config->re_filterfile_short[i] = strdup(arg);
-+ p = malloc(strlen(arg));
-+ if (p == NULL)
-+ {
-+ log_error(LOG_LEVEL_FATAL, "Out of memory");
-+ }
-+ strcpy(p, arg);
-+ config->re_filterfile[i] = make_path(config->confdir, p);
-+ free(p);
- continue;
-
- /* *************************************************************************
-diff -urNad privoxy~/loaders.c privoxy/loaders.c
---- privoxy~/loaders.c 2006-02-11 23:44:25.000000000 +0100
-+++ privoxy/loaders.c 2006-02-11 23:44:37.000000000 +0100
-@@ -329,7 +329,12 @@
- static struct file_list *current_trustfile = NULL;
- #endif /* def FEATURE_TRUST */
-
--static struct file_list *current_re_filterfile = NULL;
-+static int load_one_re_filterfile(struct client_state *csp, int fileid);
-+
-+static struct file_list *current_re_filterfile[MAX_AF_FILES] = {
-+ NULL, NULL, NULL, NULL, NULL,
-+ NULL, NULL, NULL, NULL, NULL
-+};
-
-
-
-@@ -388,7 +393,7 @@
- /*
- * Actions files
- */
-- for (i = 0; i < MAX_ACTION_FILES; i++)
-+ for (i = 0; i < MAX_AF_FILES; i++)
- {
- if (csp->actions_list[i])
- {
-@@ -397,11 +402,14 @@
- }
-
- /*
-- * Filter file
-+ * Filter files
- */
-- if (csp->rlist)
-+ for (i = 0; i < MAX_AF_FILES; i++)
- {
-- csp->rlist->active = 1;
-+ if (csp->rlist[i])
-+ {
-+ csp->rlist[i]->active = 1;
-+ }
- }
-
- /*
-@@ -1247,10 +1255,15 @@
- *********************************************************************/
- void unload_current_re_filterfile(void)
- {
-- if (current_re_filterfile)
-+ int i;
-+
-+ for (i = 0; i < MAX_AF_FILES; i++)
- {
-- current_re_filterfile->unloader = unload_re_filterfile;
-- current_re_filterfile = NULL;
-+ if (current_re_filterfile[i])
-+ {
-+ current_re_filterfile[i]->unloader = unload_re_filterfile;
-+ current_re_filterfile[i] = NULL;
-+ }
- }
- }
- #endif
-@@ -1273,6 +1286,46 @@
- *********************************************************************/
- int load_re_filterfile(struct client_state *csp)
- {
-+ int i;
-+ int result;
-+
-+ for (i = 0; i < MAX_AF_FILES; i++)
-+ {
-+ if (csp->config->re_filterfile[i])
-+ {
-+ result = load_one_re_filterfile(csp, i);
-+ if (result)
-+ {
-+ return result;
-+ }
-+ }
-+ else if (current_re_filterfile[i])
-+ {
-+ current_re_filterfile[i]->unloader = unload_re_filterfile;
-+ current_re_filterfile[i] = NULL;
-+ }
-+ }
-+
-+ return 0;
-+}
-+
-+/*********************************************************************
-+ *
-+ * Function : load_one_re_filterfile
-+ *
-+ * Description : Load a re_filterfile.
-+ * Generate a chained list of re_filterfile_spec's from
-+ * the "FILTER: " blocks, compiling all their substitutions
-+ * into chained lists of pcrs_job structs.
-+ *
-+ * Parameters :
-+ * 1 : csp = Current client state (buffers, headers, etc...)
-+ *
-+ * Returns : 0 => Ok, everything else is an error.
-+ *
-+ *********************************************************************/
-+int load_one_re_filterfile(struct client_state *csp, int fileid)
-+{
- FILE *fp;
-
- struct re_filterfile_spec *new_bl, *bl = NULL;
-@@ -1286,11 +1339,12 @@
- /*
- * No need to reload if unchanged
- */
-- if (!check_file_changed(current_re_filterfile, csp->config->re_filterfile, &fs))
-+ log_error(LOG_LEVEL_RE_FILTER, "load_one_re_filterfile: checking: %s\n",csp->config->re_filterfile[fileid]);
-+ if (!check_file_changed(current_re_filterfile[fileid], csp->config->re_filterfile[fileid], &fs))
- {
- if (csp)
- {
-- csp->rlist = current_re_filterfile;
-+ csp->rlist[fileid] = current_re_filterfile[fileid];
- }
- return(0);
- }
-@@ -1302,7 +1356,7 @@
- /*
- * Open the file or fail
- */
-- if ((fp = fopen(csp->config->re_filterfile, "r")) == NULL)
-+ if ((fp = fopen(csp->config->re_filterfile[fileid], "r")) == NULL)
- {
- goto load_re_filterfile_error;
- }
-@@ -1397,9 +1451,9 @@
- /*
- * Schedule the now-obsolete old data for unloading
- */
-- if ( NULL != current_re_filterfile )
-+ if ( NULL != current_re_filterfile[fileid] )
- {
-- current_re_filterfile->unloader = unload_re_filterfile;
-+ current_re_filterfile[fileid]->unloader = unload_re_filterfile;
- }
-
- /*
-@@ -1407,18 +1461,18 @@
- */
- fs->next = files->next;
- files->next = fs;
-- current_re_filterfile = fs;
-+ current_re_filterfile[fileid] = fs;
-
- if (csp)
- {
-- csp->rlist = fs;
-+ csp->rlist[fileid] = fs;
- }
-
- return( 0 );
-
- load_re_filterfile_error:
- log_error(LOG_LEVEL_FATAL, "can't load re_filterfile '%s': %E",
-- csp->config->re_filterfile);
-+ csp->config->re_filterfile[fileid]);
- return(-1);
-
- }
-diff -urNad privoxy~/project.h privoxy/project.h
---- privoxy~/project.h 2006-02-11 23:44:25.000000000 +0100
-+++ privoxy/project.h 2006-02-11 23:44:37.000000000 +0100
-@@ -1010,10 +1010,10 @@
- #define RC_FLAG_BLOCKED 0x20
-
- /**
-- * Maximum number of actions files. This limit is arbitrary - it's just used
-+ * Maximum number of actions/filter files. This limit is arbitrary - it's just used
- * to size an array.
- */
--#define MAX_ACTION_FILES 10
-+#define MAX_AF_FILES 10
-
- /**
- * The state of a Privoxy processing thread.
-@@ -1069,10 +1069,10 @@
- char *x_forwarded;
-
- /** Actions files associated with this client */
-- struct file_list *actions_list[MAX_ACTION_FILES];
-+ struct file_list *actions_list[MAX_AF_FILES];
-
-- /** pcrs job file. */
-- struct file_list *rlist;
-+ /** pcrs job files. */
-+ struct file_list *rlist[MAX_AF_FILES];
-
- /** Length after content modification. */
- size_t content_length;
-@@ -1328,10 +1328,10 @@
- const char *logdir;
-
- /** The full paths to the actions files. */
-- const char *actions_file[MAX_ACTION_FILES];
-+ const char *actions_file[MAX_AF_FILES];
-
- /** The short names of the actions files. */
-- const char *actions_file_short[MAX_ACTION_FILES];
-+ const char *actions_file_short[MAX_AF_FILES];
-
- /** The administrator's email address */
- char *admin_address;
-@@ -1342,8 +1342,11 @@
- /** URL to the user manual (on our website or local copy) */
- char *usermanual;
-
-- /** The file name of the pcre filter file */
-- const char *re_filterfile;
-+ /** The file names of the pcre filter files. */
-+ const char *re_filterfile[MAX_AF_FILES];
-+
-+ /** The short names of the pcre filter files. */
-+ const char *re_filterfile_short[MAX_AF_FILES];
-
- #ifdef FEATURE_COOKIE_JAR
-
-diff -urNad privoxy~/templates/show-status privoxy/templates/show-status
---- privoxy~/templates/show-status 2006-02-11 23:44:25.000000000 +0100
-+++ privoxy/templates/show-status 2006-02-11 23:44:37.000000000 +0100
-@@ -149,17 +149,12 @@
- </tr>
- @actions-filenames@
- <tr>
-- <th colspan="2"><a href="@user-manual@filter-file.html">Filter File:</a></th>
-+ <th colspan="2"><a href="@user-manual@filter-file.html">Filter Files:</a></th>
- </tr>
- <tr>
- <td>
- @re-filter-filename@
- </td>
-- <td class="buttons">
-- <!-- @if-have-filterfile-start -->
-- <a href="show-status?file=filter">View</a>
-- <!-- if-have-filterfile-end@ -->
-- </td>
- </tr>
- <!-- @if-trust-support-start -->
- <tr>
+++ /dev/null
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 13_memory.dpatch by David Schmidt <david__schmidt@users.sourceforge.net>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: A few memory leaks plugged (mostly on error paths)
-## DP: Removing a double free
-## DP: Don't forget to malloc space for the null terminator...
-
-@DPATCH@
-#diff -urNad privoxy~/cgisimple.c privoxy/cgisimple.c
-#--- privoxy~/cgisimple.c 2006-02-11 18:55:17.000000000 +0100
-#+++ privoxy/cgisimple.c 2006-02-11 18:55:27.000000000 +0100
-#@@ -880,12 +880,13 @@
-# string_join (&s, html_encode(buf));
-# }
-# fclose(fp);
-#-
-# if (map(exports, "contents", 1, s, 0))
-# {
-#+ freez(s);
-# free_map(exports);
-# return JB_ERR_MEMORY;
-# }
-#+ freez(s);
-# }
-#
-# return template_fill_for_cgi(csp, "show-status-file", exports, rsp);
-#@@ -898,7 +899,7 @@
-# if (!err) err = string_append(&s, " ");
-# }
-# if (!err) err = map(exports, "invocation", 1, s, 0);
-#-
-#+ freez(s);
-# if (!err) err = map(exports, "options", 1, csp->config->proxy_args, 1);
-# if (!err) err = show_defines(exports);
-#
-diff -urNad privoxy~/filters.c privoxy/filters.c
---- privoxy~/filters.c 2006-02-11 18:55:17.000000000 +0100
-+++ privoxy/filters.c 2006-02-11 18:55:27.000000000 +0100
-@@ -966,6 +966,7 @@
- string_append(&p, buf);
- }
- err = map(exports, "trusted-referrers", 1, p, 0);
-+ freez(p);
-
- if (err)
- {
-@@ -988,6 +989,7 @@
- string_append(&p, buf);
- }
- err = map(exports, "trust-info", 1, p, 0);
-+ freez(p);
- }
- else
- {
-diff -urNad privoxy~/jbsockets.c privoxy/jbsockets.c
---- privoxy~/jbsockets.c 2004-01-31 10:27:50.000000000 +0100
-+++ privoxy/jbsockets.c 2006-02-11 18:55:27.000000000 +0100
-@@ -434,7 +434,7 @@
- return 0;
- }
-
-- if (len < 0)
-+ if (len < 0) /* constant condition - size_t isn't ever negative */
- {
- return 1;
- }
-diff -urNad privoxy~/loadcfg.c privoxy/loadcfg.c
---- privoxy~/loadcfg.c 2006-02-11 18:55:17.000000000 +0100
-+++ privoxy/loadcfg.c 2006-02-11 18:55:37.000000000 +0100
-@@ -877,7 +877,7 @@
- MAX_AF_FILES);
- }
- config->re_filterfile_short[i] = strdup(arg);
-- p = malloc(strlen(arg));
-+ p = malloc(strlen(arg) + 1);
- if (p == NULL)
- {
- log_error(LOG_LEVEL_FATAL, "Out of memory");
-diff -urNad privoxy~/pcrs.c privoxy/pcrs.c
---- privoxy~/pcrs.c 2004-01-31 10:27:51.000000000 +0100
-+++ privoxy/pcrs.c 2006-02-11 18:55:27.000000000 +0100
-@@ -744,7 +744,7 @@
- int pcrs_execute_list(pcrs_job *joblist, char *subject, size_t subject_length, char **result, size_t *result_length)
- {
- pcrs_job *job;
-- char *old, *new;
-+ char *old, *new = NULL;
- int hits, total_hits;
-
- old = subject;
+++ /dev/null
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 18_dns_retry.dpatch by Fabian Keil <fk@fabiankeil.de>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Retries DNS queries 10 times before giving up.
-## DP: Extracted from http://www.fabiankeil.de/sourcecode/privoxy/
-
-@DPATCH@
-diff -urNad privoxy~/jbsockets.c privoxy/jbsockets.c
---- privoxy~/jbsockets.c
-+++ privoxy/jbsockets.c
-@@ -780,6 +780,7 @@
- {
- struct sockaddr_in inaddr;
- struct hostent *hostp;
-+ unsigned int dns_retries = 0;
- #if defined(HAVE_GETHOSTBYNAME_R_6_ARGS) || defined(HAVE_GETHOSTBYNAME_R_5_ARGS) || defined(HAVE_GETHOSTBYNAME_R_3_ARGS)
- struct hostent result;
- #if defined(HAVE_GETHOSTBYNAME_R_6_ARGS) || defined(HAVE_GETHOSTBYNAME_R_5_ARGS)
-@@ -800,8 +801,13 @@
- if ((inaddr.sin_addr.s_addr = inet_addr(host)) == -1)
- {
- #if defined(HAVE_GETHOSTBYNAME_R_6_ARGS)
-- gethostbyname_r(host, &result, hbuf,
-- HOSTENT_BUFFER_SIZE, &hostp, &thd_err);
-+ while ( gethostbyname_r(host, &result, hbuf,
-+ HOSTENT_BUFFER_SIZE, &hostp, &thd_err)
-+ && (thd_err == TRY_AGAIN) && (dns_retries++ < 10) )
-+ {
-+ log_error(LOG_LEVEL_ERROR, "Timeout #%u while trying to resolve %s. Trying again.",
-+ dns_retries, host);
-+ }
- #elif defined(HAVE_GETHOSTBYNAME_R_5_ARGS)
- hostp = gethostbyname_r(host, &result, hbuf,
- HOSTENT_BUFFER_SIZE, &thd_err);
-@@ -816,10 +822,20 @@
- }
- #elif OSX_DARWIN
- pthread_mutex_lock(&gethostbyname_mutex);
-- hostp = gethostbyname(host);
-+ while ( NULL == (hostp = gethostbyname(host))
-+ && (h_errno == TRY_AGAIN) && (dns_retries++ < 10) )
-+ {
-+ log_error(LOG_LEVEL_ERROR, "Timeout #%u while trying to resolve %s. Trying again.",
-+ dns_retries, host);
-+ }
- pthread_mutex_unlock(&gethostbyname_mutex);
- #else
-- hostp = gethostbyname(host);
-+ while ( NULL == (hostp = gethostbyname(host))
-+ && (h_errno == TRY_AGAIN) && (dns_retries++ < 10) )
-+ {
-+ log_error(LOG_LEVEL_ERROR, "%u. timeout while trying to resolve %s. Trying again.",
-+ dns_retries, host);
-+ }
- #endif /* def HAVE_GETHOSTBYNAME_R_(6|5|3)_ARGS */
- /*
- * On Mac OSX, if a domain exists but doesn't have a type A
+++ /dev/null
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 21_version_3.0.4.dpatch by Roland Rosenfeld <roland@debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Bump version to 3.0.4 otherwise privoxy complains in the version check.
-
-@DPATCH@
-diff -urNad privoxy~/configure.in privoxy/configure.in
---- privoxy~/configure.in
-+++ privoxy/configure.in
-@@ -488,9 +488,9 @@
- dnl Application version number
- dnl =================================================================
-
--VERSION_MAJOR=0
-+VERSION_MAJOR=3
- VERSION_MINOR=0
--VERSION_POINT=0
-+VERSION_POINT=4
- CODE_STATUS="UNRELEASED"
-
- dnl CODE_STATUS can be "alpha", "beta", or "stable", and will be
+++ /dev/null
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 22_user_action.dpatch by Roland Rosenfeld <roland@debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Fix popup filter name in user.action (see #385886).
-
-@DPATCH@
-diff -urNad privoxy~/user.action privoxy/user.action
---- privoxy~/user.action
-+++ privoxy/user.action
-@@ -39,7 +39,7 @@
- +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
- -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
- allow-all-cookies = -crunch-all-cookies -session-cookies-only -filter{content-cookies}
-- allow-popups = -filter{popups} -kill-popups
-+ allow-popups = -filter{all-popups} -kill-popups
- +block-as-image = +block +handle-as-image
- -block-as-image = -block
-
-@@ -51,7 +51,7 @@
-
- # Your favourite blend of filters:
- #
--myfilters = +filter{html-annoyances} +filter{js-annoyances} +filter{popups}\
-+myfilters = +filter{html-annoyances} +filter{js-annoyances} +filter{all-popups}\
- +filter{webbugs} +filter{banners-by-size} +filter{fun}
-
- # Allow ads for selected useful free sites:
--- /dev/null
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 23_fix_faq_id.dpatch by Roland Rosenfeld <roland@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix value of id attribute in <sect2> tag (no underscore allowed).
+
+@DPATCH@
+diff -urNad privoxy~/doc/source/faq.sgml privoxy/doc/source/faq.sgml
+--- privoxy~/doc/source/faq.sgml
++++ privoxy/doc/source/faq.sgml
+@@ -149,7 +149,7 @@
+ <!-- ~~~~~ New section ~~~~~ -->
+
+ <sect1 id="general"><title>General Information</title>
+-<sect2 renderas="sect3" id="who_uses"><title>Who should use Privoxy?</title>
++<sect2 renderas="sect3" id="whouses"><title>Who should use Privoxy?</title>
+ <para>
+ Anyone that is interested in security, privacy, or in
+ finer-grained control over their web and Internet experience.
--- /dev/null
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 24_global_action.dpatch by Roland Rosenfeld <roland@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Move the global default for all pages (/) from default.action
+## DP: to global.action to make updates with local configurations easier.
+
+@DPATCH@
+diff -urNad privoxy~/GNUmakefile.in privoxy/GNUmakefile.in
+--- privoxy~/GNUmakefile.in
++++ privoxy/GNUmakefile.in
+@@ -166,7 +166,7 @@
+ #############################################################################
+ # We include these files in our distributions
+ #############################################################################
+-CONFIGS = config trust default.action standard.action user.action default.filter user.filter
++CONFIGS = config trust global.action default.action standard.action user.action default.filter user.filter
+ # take care that no CVS .cvsignore or other crappy files
+ # are included here
+ # and escape every '#' in the find. doh.
+diff -urNad privoxy~/config privoxy/config
+--- privoxy~/config
++++ privoxy/config
+@@ -335,6 +335,7 @@
+ # without at least one actions file.
+ #
+ actionsfile standard # Internal purpose, recommended
++actionsfile global # Global default setting for all sites
+ actionsfile default # Main actions file
+ actionsfile user # User customizations
+
+diff -urNad privoxy~/default.action.master privoxy/default.action.master
+--- privoxy~/default.action.master
++++ privoxy/default.action.master
+@@ -505,67 +505,6 @@
+ #
+ allow-ads = -block -filter{banners-by-size} -filter{banners-by-link}
+
+-#############################################################################
+-# Defaults
+-#############################################################################
+-{ \
+--add-header \
+--block \
+--content-type-overwrite \
+--crunch-client-header \
+--crunch-if-none-match \
+--crunch-outgoing-cookies \
+--crunch-incoming-cookies \
+--crunch-server-header \
+--deanimate-gifs \
+--downgrade-http-version \
+--fast-redirects \
+--filter{js-annoyances} \
+--filter{js-events} \
+--filter{html-annoyances} \
+--filter{content-cookies} \
+--filter{refresh-tags} \
+--filter{unsolicited-popups} \
+--filter{all-popups} \
+--filter{img-reorder} \
+--filter{banners-by-size} \
+--filter{banners-by-link} \
+--filter{webbugs} \
+--filter{tiny-textforms} \
+--filter{jumping-windows} \
+--filter{frameset-borders} \
+--filter{demoronizer} \
+--filter{shockwave-flash} \
+--filter{quicktime-kioskmode} \
+--filter{fun} \
+--filter{crude-parental} \
+--filter{ie-exploits} \
+--filter{site-specifics} \
+--filter-client-headers \
+--filter-server-headers \
+--force-text-mode \
+--handle-as-empty-document \
+--handle-as-image \
+--hide-accept-language \
+--hide-content-disposition \
+--hide-if-modified-since \
+-+hide-forwarded-for-headers \
+-+hide-from-header{block} \
+--hide-referrer \
+--hide-user-agent \
+--inspect-jpegs \
+--kill-popups \
+--limit-connect \
+--prevent-compression \
+--overwrite-last-modified \
+--redirect \
+--send-vanilla-wafer \
+--send-wafer \
+--session-cookies-only \
+-+set-image-blocker{pattern} \
+--treat-forbidden-connects-like-blocks \
+-}
+-/ # Match all URLs
+
+ #############################################################################
+ # These extensions belong to images:
+diff -urNad privoxy~/global.action privoxy/global.action
+--- privoxy~/global.action
++++ privoxy/global.action
+@@ -0,0 +1,61 @@
++#############################################################################
++# Defaults
++#############################################################################
++{ \
++-add-header \
++-block \
++-content-type-overwrite \
++-crunch-client-header \
++-crunch-if-none-match \
++-crunch-outgoing-cookies \
++-crunch-incoming-cookies \
++-crunch-server-header \
++-deanimate-gifs \
++-downgrade-http-version \
++-fast-redirects \
++-filter{js-annoyances} \
++-filter{js-events} \
++-filter{html-annoyances} \
++-filter{content-cookies} \
++-filter{refresh-tags} \
++-filter{unsolicited-popups} \
++-filter{all-popups} \
++-filter{img-reorder} \
++-filter{banners-by-size} \
++-filter{banners-by-link} \
++-filter{webbugs} \
++-filter{tiny-textforms} \
++-filter{jumping-windows} \
++-filter{frameset-borders} \
++-filter{demoronizer} \
++-filter{shockwave-flash} \
++-filter{quicktime-kioskmode} \
++-filter{fun} \
++-filter{crude-parental} \
++-filter{ie-exploits} \
++-filter{site-specifics} \
++-filter-client-headers \
++-filter-server-headers \
++-force-text-mode \
++-handle-as-empty-document \
++-handle-as-image \
++-hide-accept-language \
++-hide-content-disposition \
++-hide-if-modified-since \
+++hide-forwarded-for-headers \
+++hide-from-header{block} \
++-hide-referrer \
++-hide-user-agent \
++-inspect-jpegs \
++-kill-popups \
++-limit-connect \
++-prevent-compression \
++-overwrite-last-modified \
++-redirect \
++-send-vanilla-wafer \
++-send-wafer \
++-session-cookies-only \
+++set-image-blocker{pattern} \
++-treat-forbidden-connects-like-blocks \
++}
++/ # Match all URLs
--- /dev/null
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 25_standard_medium.dpatch by Roland Rosenfeld <roland@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Change the global default from standard.Cautious to
+## DP: standard.Medium, which is similar to the old 3.0.3 behavior and
+## DP: doesn't change too much.
+
+@DPATCH@
+diff -urNad privoxy~/global.action privoxy/global.action
+--- privoxy~/global.action
++++ privoxy/global.action
+@@ -10,29 +10,29 @@
+ -crunch-outgoing-cookies \
+ -crunch-incoming-cookies \
+ -crunch-server-header \
+--deanimate-gifs \
+++deanimate-gifs{last} \
+ -downgrade-http-version \
+ -fast-redirects \
+ -filter{js-annoyances} \
+ -filter{js-events} \
+ -filter{html-annoyances} \
+ -filter{content-cookies} \
+--filter{refresh-tags} \
+++filter{refresh-tags} \
+ -filter{unsolicited-popups} \
+ -filter{all-popups} \
+--filter{img-reorder} \
+--filter{banners-by-size} \
+++filter{img-reorder} \
+++filter{banners-by-size} \
+ -filter{banners-by-link} \
+--filter{webbugs} \
+++filter{webbugs} \
+ -filter{tiny-textforms} \
+--filter{jumping-windows} \
+++filter{jumping-windows} \
+ -filter{frameset-borders} \
+ -filter{demoronizer} \
+ -filter{shockwave-flash} \
+ -filter{quicktime-kioskmode} \
+ -filter{fun} \
+ -filter{crude-parental} \
+--filter{ie-exploits} \
+++filter{ie-exploits} \
+ -filter{site-specifics} \
+ -filter-client-headers \
+ -filter-server-headers \
+@@ -44,17 +44,17 @@
+ -hide-if-modified-since \
+ +hide-forwarded-for-headers \
+ +hide-from-header{block} \
+--hide-referrer \
+++hide-referrer{forge} \
+ -hide-user-agent \
+ -inspect-jpegs \
+ -kill-popups \
+ -limit-connect \
+--prevent-compression \
+++prevent-compression \
+ -overwrite-last-modified \
+ -redirect \
+ -send-vanilla-wafer \
+ -send-wafer \
+--session-cookies-only \
+++session-cookies-only \
+ +set-image-blocker{pattern} \
+ -treat-forbidden-connects-like-blocks \
+ }
--- /dev/null
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 26_edit_only_writable.dpatch by Roland Rosenfeld <roland@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Hide the edit button on http://p.p/show-status if action file can
+## DP: not be written by the privoxy user.
+
+@DPATCH@
+diff -urNad privoxy~/cgisimple.c privoxy/cgisimple.c
+--- privoxy~/cgisimple.c
++++ privoxy/cgisimple.c
+@@ -244,6 +244,10 @@
+ #include <string.h>
+ #include <assert.h>
+
++#if !defined(_WIN32) && !defined(__OS2__)
++#include <unistd.h>
++#endif
++
+ #ifdef _WIN32
+ #define snprintf _snprintf
+ #endif /* def _WIN32 */
+@@ -1030,8 +1034,14 @@
+ #ifdef FEATURE_CGI_EDIT_ACTIONS
+ if (NULL == strstr(csp->actions_list[i]->filename, "standard.action") && NULL != csp->config->actions_file_short[i])
+ {
++#if !defined(_WIN32) && !defined(__OS2__)
++ if (access(csp->config->actions_file[i], W_OK) == 0) {
++#endif
+ snprintf(buf, 100, " <a href=\"/edit-actions-list?f=%s\">Edit</a>", csp->config->actions_file_short[i]);
+ if (!err) err = string_append(&s, buf);
++#if !defined(_WIN32) && !defined(__OS2__)
++ }
++#endif
+ }
+ #endif
+
fi
chown -R privoxy.adm /var/log/privoxy
chmod 750 /var/log/privoxy
- chown privoxy /etc/privoxy/*.action /etc/privoxy/trust
+ chown privoxy /etc/privoxy/user.action /etc/privoxy/trust
+ [ -f /etc/privoxy/global.action ] \
+ && chown privoxy /etc/privoxy/global.action
+
+ if [ "x$2" != "x" ] && dpkg --compare-versions "$2" lt "3.0.4"
+ then
+ # Upgrading from a 3.0.3* version
+ chown root /etc/privoxy/standard.action \
+ /etc/privoxy/default.action
+ fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
install -m 644 config $(DEBDIR)/etc/privoxy/config
install -m 0644 default.action $(DEBDIR)/etc/privoxy/default.action
+ install -m 0644 global.action $(DEBDIR)/etc/privoxy/global.action
install -m 0644 standard.action $(DEBDIR)/etc/privoxy/standard.action
install -m 0644 user.action $(DEBDIR)/etc/privoxy/user.action
install -m 0644 default.filter $(DEBDIR)/etc/privoxy/default.filter