logo       

current/debian/patches 00list, NONE, 1.1.2.1 01_local_usermanual.dpatch, NO: msg#00001

web.privoxy.cvs

Subject: current/debian/patches 00list, NONE, 1.1.2.1 01_local_usermanual.dpatch, NONE, 1.1.2.1 02_linkcolor.dpatch, NONE, 1.1.2.1 04_nomultiproxy.dpatch, NONE, 1.1.2.1 05_defaut_action.dpatch, NONE, 1.1.2.1 06_8bit_manual.dpatch, NONE, 1.1.2.1 07_typos.dpatch, NONE, 1.1.2.1 08_log_pthread.dpatch, NONE, 1.1.2.1 09_no_identity.dpatch, NONE, 1.1.2.1 10_backup_doc.dpatch, NONE, 1.1.2.1 11_backup_autotools.dpatch, NONE, 1.1.2.1 12_multiple-filters.dpatch, NONE, 1.1.2.1 13_memory.dpatch, NONE, 1.1.2.1 14_config.dpatch, NONE, 1.1.2.1 15_mansection8.dpatch, NONE, 1.1.2.1

Update of /cvsroot/ijbswa/current/debian/patches
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv13016/patches

Added Files:
Tag: v_3_0_branch
00list 01_local_usermanual.dpatch 02_linkcolor.dpatch
04_nomultiproxy.dpatch 05_defaut_action.dpatch
06_8bit_manual.dpatch 07_typos.dpatch 08_log_pthread.dpatch
09_no_identity.dpatch 10_backup_doc.dpatch
11_backup_autotools.dpatch 12_multiple-filters.dpatch
13_memory.dpatch 14_config.dpatch 15_mansection8.dpatch
Log Message:
All Debian packaging changes from Debian version 3.0.3-2-1.
This includes a migration to the dpatch mechanism.


--- NEW FILE: 00list ---
01_local_usermanual.dpatch
02_linkcolor.dpatch
04_nomultiproxy.dpatch
05_defaut_action.dpatch
06_8bit_manual.dpatch
07_typos.dpatch
08_log_pthread.dpatch
09_no_identity.dpatch
10_backup_doc.dpatch
11_backup_autotools.dpatch
12_multiple-filters.dpatch
13_memory.dpatch
14_config.dpatch
15_mansection8.dpatch

--- NEW FILE: 01_local_usermanual.dpatch ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## 01_local_usermanual.dpatch by Roland Rosenfeld <roland@xxxxxxxxxx>
##
## 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 2006-02-11 23:44:26.000000000 +0100
+++ privoxy/cgi.c 2006-02-11 23:44:34.000000000 +0100
@@ -609,6 +609,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 */ }
@@ -821,21 +824,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();
+ }
}

/*
@@ -1597,7 +1607,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, "\">");
@@ -2171,7 +2187,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 2006-02-11 23:44:26.000000000 +0100
+++ privoxy/cgisimple.c 2006-02-11 23:44:34.000000000 +0100
@@ -642,6 +642,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 2006-02-11 23:44:26.000000000 +0100
+++ privoxy/cgisimple.h 2006-02-11 23:44:34.000000000 +0100
@@ -128,6 +128,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 2006-02-11 23:44:26.000000000 +0100
+++ privoxy/loadcfg.c 2006-02-11 23:44:34.000000000 +0100
@@ -1579,7 +1579,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, "\">");

--- NEW FILE: 02_linkcolor.dpatch ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## 02_linkcolor.dpatch by Roland Rosenfeld <roland@xxxxxxxxxx>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Run htmldoc with --linkcolor #0000ff and --no-embedfonts

@DPATCH@
diff -urNad privoxy~/utils/ldp_print/ldp_print privoxy/utils/ldp_print/ldp_print
--- privoxy~/utils/ldp_print/ldp_print 2006-02-05 22:03:58.000000000 +0100
+++ privoxy/utils/ldp_print/ldp_print 2006-02-05 22:12:43.000000000 +0100
@@ -54,7 +54,7 @@

my($cmd) = "htmldoc --size universal --bodyfont helvetica --fontsize 8 " .
"-t pdf -f ${fname_wo_ext}.pdf --firstpage p1 --titlefile
title.html" .
- " body.html --footer c.1";
+ " body.html --footer c.1 --linkcolor #0000ff --no-embedfonts";

# For postscript output; append onto the above cmd string:
#

--- NEW FILE: 04_nomultiproxy.dpatch ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## 04_multiproxy.dpatch by Roland Rosenfeld <roland@xxxxxxxxxx>
##
## 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 2006-02-05 16:23:12.000000000 +0100
+++ privoxy/config 2006-02-05 16:25:45.000000000 +0100
@@ -889,11 +889,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 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.
#
# Also specified here are SOCKS proxies. Privoxy supports the SOCKS
# 4 and SOCKS 4A protocols.
diff -urNad privoxy~/doc/source/faq.sgml privoxy/doc/source/faq.sgml
--- privoxy~/doc/source/faq.sgml 2006-02-05 16:23:12.000000000 +0100
+++ privoxy/doc/source/faq.sgml 2006-02-05 16:25:45.000000000 +0100
@@ -1255,13 +1255,6 @@
on (those suspicious) people with a more than average preference for privacy.
</para>
<para>
- You can find a list of anonymous public proxies at <ulink
- url="http://www.multiproxy.org/anon_list.htm";>multiproxy.org</ulink> and many
- more through Google. A particularly interesting project is the JAP service
- offered by the Technical University of Dresden (<ulink
-
url="http://anon.inf.tu-dresden.de/index_en.html";>http://anon.inf.tu-dresden.de/index_en.html</ulink>).
-</para>
-<para>
There is, however, even in the single-machine case the possibility to make the
server believe that your machine is in fact a shared proxy serving a whole big
LAN, and we are looking into that.
diff -urNad privoxy~/doc/source/p-config.sgml privoxy/doc/source/p-config.sgml
--- privoxy~/doc/source/p-config.sgml 2006-02-05 16:23:12.000000000 +0100
+++ privoxy/doc/source/p-config.sgml 2006-02-05 16:25:45.000000000 +0100
@@ -1519,9 +1519,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>

--- NEW FILE: 05_defaut_action.dpatch ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## 05_default_action.dpatch by Roland Rosenfeld <roland@xxxxxxxxxx>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Serveral changes/additons to default.action.

@DPATCH@
diff -urNad privoxy~/default.action.master privoxy/default.action.master
--- privoxy~/default.action.master 2006-02-05 16:23:12.000000000 +0100
+++ privoxy/default.action.master 2006-02-05 16:25:47.000000000 +0100
@@ -1444,6 +1444,8 @@
.microsoft.com
#MASTER# PROBLEM-URL: http://javabog.dk/ijk/
javabog.dk/ijk/
+#MASTER# PROBLEM-URL: http://validator.w3.org/
+/valid-

#----------------------------------------------------------------------------
# These don't work without the referrer information:
@@ -1464,6 +1466,8 @@
#MASTER# PROBLEM-URL: http://www.mandrakelinux.com/en/ftp.php3
#MASTER# REMARKS: Link to download page breaks
www.mandrakelinux.com/en/ftp.php3
+#MASTER# PROBLEM-URL:
http://www.petitiononline.com/mod_perl/signed.cgi?eldred&2901
+www.petitiononline.com/mod_perl/signed.cgi

#----------------------------------------------------------------------------
# These animated gifs are either useful or nice:
@@ -1601,6 +1605,8 @@
cf.nbc4.com/
#MASTER# PROBLEM-URL: http://www.hh.schule.de/ak/nt/
www.hh.schule.de/ak/nt/
+#MASTER# PROBLEM-URL:
http://www.perl.com/language/newdocs/pod/perlop.html#Regexp_Quote_Like_Operators
+www.perl.com/language/newdocs/pod/

{+fast-redirects -block}
#MASTER# PROBLEM-URL: http://isbn.nu/0596001088/price/2.html

--- NEW FILE: 06_8bit_manual.dpatch ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## 06_8bit_manual.dpatch by Roland Rosenfeld <roland@xxxxxxxxxx>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Stop converting 8bit chars in the documentation (#203697)

@DPATCH@
diff -urNad privoxy-dpatch~/doc/source/ldp.dsl.in
privoxy-dpatch/doc/source/ldp.dsl.in
--- privoxy-dpatch~/doc/source/ldp.dsl.in 2006-02-05 16:17:43.000000000
+0100
+++ privoxy-dpatch/doc/source/ldp.dsl.in 2006-02-05 16:17:46.000000000
+0100
@@ -47,9 +47,9 @@

;; this is necessary because right now jadetex does not understand
;; symbolic entities, whereas things work well with numeric entities.
-(declare-characteristic preserve-sdata?
- "UNREGISTERED::James Clark//Characteristic::preserve-sdata?"
- #f)
+;(declare-characteristic preserve-sdata?
+; "UNREGISTERED::James Clark//Characteristic::preserve-sdata?"
+; #f)

;; put the legal notice in a separate file
(define %generate-legalnotice-link%
@@ -257,9 +257,9 @@

;; this is necessary because right now jadetex does not understand
;; symbolic entities, whereas things work well with numeric entities.
-(declare-characteristic preserve-sdata?
- "UNREGISTERED::James Clark//Characteristic::preserve-sdata?"
- #f)
+;(declare-characteristic preserve-sdata?
+; "UNREGISTERED::James Clark//Characteristic::preserve-sdata?"
+; #f)

;; put the legal notice in a separate file
(define %generate-legalnotice-link%

--- NEW FILE: 07_typos.dpatch ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## 07_typos.dpatch by Roland Rosenfeld <roland@xxxxxxxxxx>
##
## 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 2006-02-05 22:03:58.000000000
+0100
+++ privoxy/doc/source/privoxy-man-page.sgml 2006-02-11 18:32:40.000000000
+0100
@@ -333,7 +333,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
diff -urNad privoxy~/doc/source/user-manual.sgml
privoxy/doc/source/user-manual.sgml
--- privoxy~/doc/source/user-manual.sgml 2004-01-31 10:49:48.000000000
+0100
+++ privoxy/doc/source/user-manual.sgml 2006-02-11 18:34:24.000000000 +0100
@@ -368,7 +368,7 @@
</para>

<para>
- In order not to loose your personal changes and adjustments when updating
+ In order not to lose your personal changes and adjustments when updating
to the latest <literal>default.action</literal> file we <emphasis>strongly
recommend</emphasis> that you use <literal>user.action</literal> for your
customization of <application>Privoxy</application>. See the <link
@@ -1720,7 +1720,7 @@

<para>
To determine which actions apply to a request, the URL of the request is
- compared to all patterns in each action file file. Every time it matches, the
list of
+ compared to all patterns in each <quote>action file</quote> file. Every time
it matches, the list of
applicable actions for the URL is incrementally updated, using the heading
of the section in which the pattern is located. If multiple matches for
the same URL set the same action differently, the last match wins. If not,
@@ -5251,7 +5251,7 @@
blocks of HTML code disappear when a specific symbol is set. We use this
for many purposes, one of them being to include the beta warning in all
our user interface (CGI) pages when <application>Privoxy</application>
- in in an alpha or beta development stage:
+ is in an alpha or beta development stage:
</para>

<para>

--- NEW FILE: 08_log_pthread.dpatch ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## 08_log_pthread.dpatch by Jindrich Makovicka <makovick@xxxxxxxxxxxxxxxxxxxx>
##
## 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 */


--- NEW FILE: 09_no_identity.dpatch ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## 09_no_identity.dpatch by Michael Shields <shields@xxxxxxxx>
##
## 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 2006-02-05 16:23:12.000000000 +0100
+++ privoxy/parsers.c 2006-02-05 16:25:49.000000000 +0100
@@ -871,8 +871,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...)
@@ -904,13 +903,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");
- return (header == NULL) ? JB_ERR_MEMORY : JB_ERR_OK;
}
}


--- NEW FILE: 10_backup_doc.dpatch ---
#! /bin/sh -e
## 10_backup_doc.dpatch by Roland Rosenfeld <roland@xxxxxxxxxx>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Backup the upstream versions of all generated documentation

dpatch_patch ()
{
tar cf debian/patched/doc.bak.tar \
doc/source doc/text doc/webserver \
INSTALL README AUTHORS privoxy.1
}

dpatch_unpatch ()
{
tar xf debian/patched/doc.bak.tar
}

DPATCH_LIB_NO_DEFAULT=1

. /usr/share/dpatch/dpatch.lib.sh

--- NEW FILE: 11_backup_autotools.dpatch ---
#! /bin/sh -e
## 11_backup_autotools.dpatch by Ralf Treinen <treinen@xxxxxxxxxx>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: replace all config.{guess,sub} by the vesion installed in
## DP: /usr/share/misc

dpatch_patch ()
{
find . -name config.guess -o -name config.sub \
| tar cf debian/patched/config.guess+sub.tar -T -
find . -name config.guess \
-exec ln -sf /usr/share/misc/config.guess '{}' \;
find . -name config.sub \
-exec ln -sf /usr/share/misc/config.sub '{}' \;
}

dpatch_unpatch ()
{
tar xf debian/patched/config.guess+sub.tar
}

DPATCH_LIB_NO_DEFAULT=1

. /usr/share/dpatch/dpatch.lib.sh

--- NEW FILE: 12_multiple-filters.dpatch ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## 12_multiple-filters.dpatch
## by David Schmidt <david__schmidt@xxxxxxxxxxxxxxxxxxxxx>
##
## 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@xxxxxxxxxxxxxxxx">Filter
File:</a></th>
+ <th colspan="2"><a href="@user-manual@xxxxxxxxxxxxxxxx">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>

--- NEW FILE: 13_memory.dpatch ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## 13_memory.dpatch by David Schmidt <david__schmidt@xxxxxxxxxxxxxxxxxxxxx>
##
## 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;

--- NEW FILE: 14_config.dpatch ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## 14_config.dpatch by Roland Rosenfeld <roland@xxxxxxxxxx>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Several Debian specific changes to config file

@DPATCH@
diff -urNad privoxy~/config privoxy/config
--- privoxy~/config 2006-02-11 20:29:59.000000000 +0100
+++ privoxy/config 2006-02-11 20:30:28.000000000 +0100
@@ -1,4 +1,4 @@
-# Sample Configuration File for Privoxy v3.0.x
+# Sample Configuration File for Privoxy
#
# Copyright (C) 2001-2004 Privoxy Developers http://privoxy.org
#
@@ -104,7 +104,7 @@
# flat, except for confdir/templates, where the HTML templates
# for CGI output reside (e.g. Privoxy's 404 error page).
#
-confdir .
+confdir /etc/privoxy

#
# 1.2. logdir
@@ -131,7 +131,7 @@
#
# No trailing "/", please
#
-logdir .
+logdir /var/log/privoxy

#
# 1.3. actionsfile
@@ -406,7 +406,7 @@
# If set, this option should be the first option in the config
# file, because it is used while the config file is being read.
#
-#user-manual http://www.privoxy.org/user-manual/
+user-manual /usr/share/doc/privoxy/user-manual

#
# 2.2. trust-info-url
@@ -442,8 +442,8 @@
# don't end up locked out from the information on why they were
# locked out in the first place!
#
-trust-info-url http://www.example.com/why_we_block.html
-trust-info-url http://www.example.com/what_we_allow.html
+#trust-info-url http://www.example.com/why_we_block.html
+#trust-info-url http://www.example.com/what_we_allow.html

#
# 2.3. admin-address
@@ -730,7 +730,7 @@
# Note that you must have compiled Privoxy with support for this
# feature, otherwise this option has no effect.
#
-enable-remote-toggle 1
+enable-remote-toggle 0

#
# 4.4. enable-edit-actions
@@ -763,7 +763,7 @@
# Note that you must have compiled Privoxy with support for this
# feature, otherwise this option has no effect.
#
-enable-edit-actions 1
+enable-edit-actions 0

#
# 4.5. ACLs: permit-access and deny-access

--- NEW FILE: 15_mansection8.dpatch ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## 15_mansection8.dpatch by Roland Rosenfeld <roland@xxxxxxxxxx>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Move man page from man section 1 to man section 8.

@DPATCH@
diff -urNad privoxy~/doc/source/privoxy-man-page.sgml
privoxy/doc/source/privoxy-man-page.sgml
--- privoxy~/doc/source/privoxy-man-page.sgml 2006-02-11 23:44:40.000000000
+0100
+++ privoxy/doc/source/privoxy-man-page.sgml 2006-02-11 23:44:40.000000000
+0100
@@ -57,7 +57,7 @@
</refentryinfo>
<refmeta>
<refentrytitle>privoxy</refentrytitle>
- <manvolnum>1</manvolnum>
+ <manvolnum>8</manvolnum>
<refmiscinfo>
Privoxy &p-version;<![%p-not-stable;[ &p-status;]]>
</refmiscinfo>
diff -urNad privoxy~/GNUmakefile.in privoxy/GNUmakefile.in
--- privoxy~/GNUmakefile.in 2006-02-11 23:44:25.000000000 +0100
+++ privoxy/GNUmakefile.in 2006-02-11 23:44:40.000000000 +0100
@@ -177,7 +177,7 @@
`find doc/text/ -type f | grep -v "CVS" | grep -v "\.\#" | grep
-v ".*~" | grep -v ".cvsignore" | grep -v "TAGS"` \
`find doc/webserver/ -name "*.html" | grep -v
"\(webserver\|team\)\/index\.html"` \
`find doc/webserver/ -name "*.css"` \
- privoxy.1 \
+ privoxy.8 \
doc/pdf/*.pdf

#############################################################################
@@ -520,7 +520,7 @@
$(RM) /etc/init.d/privoxy
$(RM) /usr/sbin/privoxy
$(RM) /usr/sbin/rcprivoxy
- $(RM) /usr/share/man/man1/privoxy.1.gz
+ $(RM) /usr/share/man/man1/privoxy.8.gz

#############################################################################
# generic distribution
@@ -692,7 +692,7 @@
$(RM) doc/man/* doc/webserver/man-page/*.html
ifneq ($(MAN2HTML),false)
$(ECHO) "<html><head><title>Privoxy Man page</title><link
rel=\"stylesheet\" type=\"text/css\"
href=\"../p_web.css\"></head><body><H2>NAME</H2>" >
doc/webserver/man-page/privoxy-man-page.html
- man ./privoxy.1 | $(MAN2HTML) -bare >>
doc/webserver/man-page/privoxy-man-page.html
+ man ./privoxy.8 | $(MAN2HTML) -bare >>
doc/webserver/man-page/privoxy-man-page.html
$(ECHO) "</body></html>" >> doc/webserver/man-page/privoxy-man-page.html
else
$(MAKE) groff2html
@@ -704,14 +704,14 @@
man: dok-release
mkdir -p doc/source/temp && cd doc/source/temp && $(RM) * ;\
nsgmls ../privoxy-man-page.sgml | sgmlspl
../../../utils/docbook2man/docbook2man-spec.pl &&\
- perl -pi.bak -e 's/ <URL:.*>//; s/\[ /\[/g' privoxy.1 ;\
- $(DB) ../privoxy-man-page.sgml && $(MV) -f privoxy.1 ../../../privoxy.1
+ perl -pi.bak -e 's/ <URL:.*>//; s/\[ /\[/g' privoxy.8 ;\
+ $(DB) ../privoxy-man-page.sgml && $(MV) -f privoxy.8 ../../../privoxy.8

# For those with man2html ala RH7s.
man2html:
mkdir -p doc/webserver/man-page
ifneq ($(MAN2HTML),false)
- $(MAN2HTML) privoxy.1 |grep -v "^Content-type" > tmp.html
+ $(MAN2HTML) privoxy.8 |grep -v "^Content-type" > tmp.html
$(PERL) -pi.bak -e 's/<A .*Contents<\/A>//; s/<A
.*man2html<\/A>/man2html/' tmp.html
$(PERL) -pi.bak -e 's/(<\/HEAD>)/<LINK REL=\"STYLESHEET\"
TYPE=\"text\/css\" HREF=\"..\/p_doc.css\"><\/HEAD>/' tmp.html
# Twice because my version of man2html is pulling in commas and periods in
URLs.
@@ -726,7 +726,7 @@

# Otherwise we get plain groff conversion.
groff2html:
- $(G2H_CMD) ./privoxy.1 | $(SED) -e 's@</head>@<link REL="STYLESHEET"
TYPE="text/css" HREF="../p_doc.css"></head>@' >
doc/webserver/man-page/privoxy-man-page.html
+ $(G2H_CMD) ./privoxy.8 | $(SED) -e 's@</head>@<link REL="STYLESHEET"
TYPE="text/css" HREF="../p_doc.css"></head>@' >
doc/webserver/man-page/privoxy-man-page.html


# readme page and INSTALL file
@@ -1122,8 +1122,8 @@
$(INSTALL) $(INSTALL_T) $(DOK_WEB)/p_doc.css $$DOC;\
fi
@# Not all platforms support gzipped man pages.
- @$(ECHO) Installing man page to $(MAN_DEST)/privoxy.1
- -$(INSTALL) $(INSTALL_T) privoxy.1 $(MAN_DEST)/privoxy.1
+ @$(ECHO) Installing man page to $(MAN_DEST)/privoxy.8
+ -$(INSTALL) $(INSTALL_T) privoxy.8 $(MAN_DEST)/privoxy.8

@# Change the config file default directories according to the
configured ones
@$(ECHO) Rewriting config for this installation
@@ -1273,7 +1273,7 @@

@# man page and docs
@$(ECHO) Removing $(PROGRAM) docs
- -$(RM) $(MAN_DEST)/privoxy.1*
+ -$(RM) $(MAN_DEST)/privoxy.8*
-$(RM) -r $(DOC_DEST) || $(RM) -r $(prefix)/doc/privoxy

@# Log and jarfile and pidfile


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise