From: Roland Rosenfeld Date: Thu, 7 Jun 2007 10:41:02 +0000 (+0000) Subject: Add changes from 3.0.6-2, 3.0.6-3 and several unreleased changes X-Git-Tag: v_3_0_7~221 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=6aa60a252059f209c5f3fb14502ad1deff7aba61 Add changes from 3.0.6-2, 3.0.6-3 and several unreleased changes according to CVS as of 2007-06-07. --- diff --git a/debian/changelog b/debian/changelog index dffb210c..4a4c1ff8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,34 @@ +privoxy (3.0.7~CSV20070607-0.1) UNRELEASED; urgency=low + + * CVS as of 2007-06-07. + * Enable new zlib feature (Closes: #368448): + - build-depend on zlib1g-dev + - disable prevent-compression in 25_standard_medium.dpatch + * Remove 28_pcre_returncode.dpatch, which is now applied upstream. + * 29_usermanual: fix some broken markup in user-manual.sgml + * 30_actionsfile_fullname.dpatch: The "actionsfile" syntax in the + configuration file is consistent with the rest of the configuration + options and requires the whole file name. + + -- Roland Rosenfeld Thu, 7 Jun 2007 12:30:02 +0200 + +privoxy (3.0.6-3) unstable; urgency=low + + * According to http://wiki.debian.org/AccountHandlingInMaintainerScripts + removing system users in postrm isn't a good idea. So the removal of + user privoxy in postrm was disabled and deluser/adduser of existing + user in postinst was also removed. This should avoid problems with + purging privoxy if passwd package isn't intalled (Closes: #417015). + + -- Roland Rosenfeld Sat, 19 May 2007 21:22:42 +0200 + +privoxy (3.0.6-2) unstable; urgency=medium + + * 28_pcre_returncode: Don't crash if pcre returns an error code that + pcrs didn't expect (Closes: #404284). + + -- Roland Rosenfeld Sat, 23 Dec 2006 21:47:12 +0100 + privoxy (3.0.6-1) unstable; urgency=low * New upstream release 3.0.6. @@ -355,7 +386,7 @@ privoxy (2.9.16-1) unstable; urgency=low privoxy (2.9.14-beta-4) unstable; urgency=low * Damn, why did I write "i386-linux" into the rules file, when I try to - write a work around for hppa? Fixed now (Closes #148227). + write a work around for hppa? Fixed now (Closes: #148227). -- Roland Rosenfeld Sun, 26 May 2002 22:33:26 +0200 diff --git a/debian/control b/debian/control index f33f074a..085e5bf7 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: privoxy Section: web Priority: optional Maintainer: Roland Rosenfeld -Build-Depends: debhelper (>= 5.0.0), autoconf, autotools-dev, libpcre3-dev, jade, docbook-dsssl, w3m, sp, sgmlspl, groff, htmldoc (>= 1.8.25-1), man2html, dpatch +Build-Depends: debhelper (>= 5.0.0), autoconf, autotools-dev, libpcre3-dev, jade, docbook-dsssl, w3m, sp, sgmlspl, groff, htmldoc (>= 1.8.25-1), man2html, dpatch, zlib1g-dev Standards-Version: 3.7.2 Package: privoxy diff --git a/debian/patches/00list b/debian/patches/00list index 4de48842..f70b06bb 100644 --- a/debian/patches/00list +++ b/debian/patches/00list @@ -6,12 +6,12 @@ 11_backup_autotools.dpatch 14_config.dpatch 15_mansection8.dpatch -# 16_gzip.dpatch # still broken. 17_502_no_such_domain.dpatch 19_manpage_fixup.dpatch 20_makefile_fixup.dpatch 23_fix_faq_id.dpatch 24_global_action.dpatch 25_standard_medium.dpatch -26_edit_only_writable.dpatch 27_remove_nsl.dpatch +29_usermanual.dpatch +30_actionsfile_fullname.dpatch diff --git a/debian/patches/05_defaut_action.dpatch b/debian/patches/05_defaut_action.dpatch index 0c1ea5cd..f1d9c973 100644 --- a/debian/patches/05_defaut_action.dpatch +++ b/debian/patches/05_defaut_action.dpatch @@ -8,7 +8,7 @@ diff -urNad privoxy~/default.action.master privoxy/default.action.master --- privoxy~/default.action.master +++ privoxy/default.action.master -@@ -1695,6 +1695,11 @@ +@@ -1839,6 +1839,11 @@ {+filter{tiny-textforms} +prevent-compression} .sourceforge.net/tracker diff --git a/debian/patches/14_config.dpatch b/debian/patches/14_config.dpatch index ae8f063a..76240b89 100644 --- a/debian/patches/14_config.dpatch +++ b/debian/patches/14_config.dpatch @@ -12,7 +12,7 @@ diff -urNad privoxy~/config privoxy/config -# Sample Configuration File for Privoxy v3.0.6 +# Sample Configuration File for Privoxy # - # $Id: config,v 1.56 2006/11/14 01:54:36 hal9 Exp $ + # $Id: config,v 1.57 2007/01/02 01:39:52 david__schmidt Exp $ # @@ -123,7 +123,7 @@ # If set, this option should be the first option in the config diff --git a/debian/patches/15_mansection8.dpatch b/debian/patches/15_mansection8.dpatch index 61cf002f..944f316e 100644 --- a/debian/patches/15_mansection8.dpatch +++ b/debian/patches/15_mansection8.dpatch @@ -62,7 +62,7 @@ diff -urNad privoxy~/GNUmakefile.in privoxy/GNUmakefile.in # readme page and INSTALL file -@@ -1123,8 +1123,8 @@ +@@ -1127,8 +1127,8 @@ $(INSTALL) $(INSTALL_T) $(DOK_WEB)/p_doc.css $$DOC/user-manual;\ fi @# Not all platforms support gzipped man pages. @@ -73,7 +73,7 @@ diff -urNad privoxy~/GNUmakefile.in privoxy/GNUmakefile.in @# Change the config file default directories according to the configured ones @$(ECHO) Rewriting config for this installation -@@ -1284,7 +1284,7 @@ +@@ -1288,7 +1288,7 @@ @# man page and docs @$(ECHO) Removing $(PROGRAM) docs diff --git a/debian/patches/16_gzip.dpatch b/debian/patches/16_gzip.dpatch deleted file mode 100755 index 9d6cc722..00000000 --- a/debian/patches/16_gzip.dpatch +++ /dev/null @@ -1,527 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 16_gzip.dpatch by Wil Mahan -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Add deflate-filter support to privoxy, see sf bug id 895531 -## DP: Adapted from privoxy 3.1 to 3.0.x by Roland Rosenfeld. -## DP: This requires --enable-zlib as configure option in debian/rules -## DP: and a build dependeny on zlib1g-dev. - -@DPATCH@ -diff -urNad privoxy~/actionlist.h privoxy/actionlist.h ---- privoxy~/actionlist.h -+++ privoxy/actionlist.h -@@ -116,6 +116,7 @@ - DEFINE_ACTION_STRING ("deanimate-gifs", ACTION_DEANIMATE, ACTION_STRING_DEANIMATE) - DEFINE_CGI_PARAM_RADIO ("deanimate-gifs", ACTION_DEANIMATE, ACTION_STRING_DEANIMATE, "first", 0) - DEFINE_CGI_PARAM_RADIO ("deanimate-gifs", ACTION_DEANIMATE, ACTION_STRING_DEANIMATE, "last", 1) -+DEFINE_ACTION_BOOL ("decompress-from-server", ACTION_DECOMPRESS_IN) - DEFINE_ACTION_BOOL ("downgrade-http-version", ACTION_DOWNGRADE) - DEFINE_ACTION_BOOL ("fast-redirects", ACTION_FAST_REDIRECTS) - DEFINE_ACTION_MULTI ("filter", ACTION_MULTI_FILTER) -diff -urNad privoxy~/configure.in privoxy/configure.in ---- privoxy~/configure.in -+++ privoxy/configure.in -@@ -1234,6 +1234,20 @@ - libpcrs is available], - [ if test $enableval = "no"; then have_pcrs=no; fi ]) - -+AC_ARG_ENABLE(zlib, -+[ --enable-zlib Use the zlib library to allow compressing or -+ decompressing data on the fly.], -+[enableval2=$enableval], -+[enableval2=no]) -+if test $enableval2 = yes; then -+ AC_CHECK_LIB(z, zlibVersion, , [ -+ AC_MSG_ERROR([Unable to find a copy of zlib. The zlib library -+is necessary to enable compresion support. ]) -+ ]) -+ AC_DEFINE(FEATURE_ZLIB,1, -+ [ Define to 1 to use compression through the zlib library. ]) -+fi -+ - - # If we have libpcre and either we also have pcreposix or - # we don't need pcreposix, then link pcre dynamically; else -diff -urNad privoxy~/default.action.master privoxy/default.action.master ---- privoxy~/default.action.master -+++ privoxy/default.action.master -@@ -452,7 +452,7 @@ - -hide-user-agent \ - -kill-popups \ - -limit-connect \ --+prevent-compression \ -+-prevent-compression \ - -send-vanilla-wafer \ - -send-wafer \ - +session-cookies-only \ -diff -urNad privoxy~/filters.c privoxy/filters.c ---- privoxy~/filters.c -+++ privoxy/filters.c -@@ -1325,6 +1325,38 @@ - return(NULL); - } - -+#ifdef FEATURE_ZLIB -+ /* If the body has a compressed transfer-encoding, uncompress -+ * it first, adjusting size and iob->eod. Note that -+ * decompression occurs after de-chunking. -+ */ -+ if (csp->content_type & CT_GZIP || csp->content_type & CT_DEFLATE) -+ { -+ /* Notice that we at least tried to decompress. */ -+ if (JB_ERR_OK != decompress_iob(csp)) -+ { -+ /* We failed to decompress the data; there's no point -+ * in continuing since we can't filter. This is -+ * slightly tricky because we need to remember not to -+ * modify the Content-Encoding header later; using -+ * CT_TABOO flag is a kludge for this purpose. -+ */ -+ csp->content_type |= CT_TABOO; -+ return(NULL); -+ } -+ log_error(LOG_LEVEL_RE_FILTER, "Decompressing successful"); -+ -+ /* Decompression gives us a completely new iob, so we -+ * need to update. -+ */ -+ size = csp->iob->eod - csp->iob->cur; -+ old = csp->iob->cur; -+ -+ csp->flags |= CSP_FLAG_MODIFIED; -+ } -+#endif -+ -+ - /* - * If the body has a "chunked" transfer-encoding, - * get rid of it first, adjusting size and iob->eod -diff -urNad privoxy~/jcc.c privoxy/jcc.c ---- privoxy~/jcc.c -+++ privoxy/jcc.c -@@ -659,6 +659,10 @@ - # include - # endif - -+#ifdef FEATURE_ZLIB -+#include -+#endif -+ - #endif - - #include "project.h" -@@ -1609,6 +1613,8 @@ - - if ((csp->content_type & CT_TEXT) && /* It's a text / * MIME-Type */ - !http->ssl && /* We talk plaintext */ -+ !(csp->content_type & CT_GZIP) && -+ !(csp->content_type & CT_DEFLATE) && - block_popups) /* Policy allows */ - { - block_popups_now = 1; -diff -urNad privoxy~/parsers.c privoxy/parsers.c ---- privoxy~/parsers.c -+++ privoxy/parsers.c -@@ -433,6 +433,10 @@ - #include - #include - -+#ifdef FEATURE_ZLIB -+#include -+#endif -+ - #if !defined(_WIN32) && !defined(__OS2__) - #include - #endif -@@ -632,6 +636,281 @@ - } - - -+#ifdef FEATURE_ZLIB -+/********************************************************************* -+ * -+ * Function : decompress_iob -+ * -+ * Description : Decompress buffered page, expanding the -+ * buffer as necessary. csp->iob->cur -+ * should point to the the beginning of the -+ * compressed data block. -+ * -+ * Parameters : -+ * 1 : csp = Current client state (buffers, headers, etc...) -+ * -+ * Returns : JB_ERR_OK on success, JB_ERR_MEMORY if out-of-memory -+ * limit reached, JB_ERR_COMPRESS if error decompressing -+ * buffer. -+ * -+ *********************************************************************/ -+jb_err decompress_iob(struct client_state *csp) -+{ -+ char *buf; /* new, uncompressed buffer */ -+ int bufsize = csp->iob->size; /* allocated size of the new buffer */ -+ /* Number of bytes at the beginning -+ * of the iob that we should NOT -+ * decompress. -+ */ -+ int skip_size = csp->iob->cur - csp->iob->buf; -+ int status; /* return status of the inflate() call */ -+ z_stream zstr; /* used by calls to zlib */ -+ -+ /* This is to protect the parsing of gzipped data, but it should(?) -+ * be valid for deflated data also. -+ */ -+ if (bufsize < 10) -+ { -+ log_error (LOG_LEVEL_ERROR, "Buffer too small decompressing iob"); -+ return JB_ERR_COMPRESS; -+ } -+ -+ if (csp->content_type & CT_GZIP) -+ { -+ /* Our task is slightly complicated by the facts that data -+ * compressed by gzip does not include a zlib header, and -+ * that there is no easily accessible interface in zlib to -+ * handle a gzip header. We strip off the gzip header by -+ * hand, and later inform zlib not to expect a header. -+ */ -+ -+ /* Strip off the gzip header. Please see RFC 1952 for more -+ * explanation of the appropriate fields. -+ */ -+ if ((*csp->iob->cur++ != (char)0x1f) -+ || (*csp->iob->cur++ != (char)0x8b) -+ || (*csp->iob->cur++ != Z_DEFLATED)) -+ { -+ log_error (LOG_LEVEL_ERROR, -+ "Invalid gzip header when decompressing"); -+ return JB_ERR_COMPRESS; -+ } -+ else { -+ int flags = *csp->iob->cur++; -+ if (flags & 0xe0) -+ { -+ /* The gzip header has reserved bits set; bail out. */ -+ log_error (LOG_LEVEL_ERROR, -+ "Invalid gzip header when decompressing"); -+ return JB_ERR_COMPRESS; -+ } -+ csp->iob->cur += 6; -+ -+ /* Skip extra fields if necessary. */ -+ if (flags & 0x04) -+ { -+ /* Skip a given number of bytes, specified as a 16-bit -+ * little-endian value. -+ */ -+ csp->iob->cur += *csp->iob->cur++ + (*csp->iob->cur++ << 8); -+ } -+ -+ /* Skip the filename if necessary. */ -+ if (flags & 0x08) -+ { -+ /* A null-terminated string follows. */ -+ while (*csp->iob->cur++); -+ } -+ -+ /* Skip the comment if necessary. */ -+ if (flags & 0x10) -+ { -+ while (*csp->iob->cur++); -+ } -+ -+ /* Skip the CRC if necessary. */ -+ if (flags & 0x02) -+ { -+ csp->iob->cur += 2; -+ } -+ } -+ } -+ else if (csp->content_type & CT_DEFLATE) -+ { -+ log_error (LOG_LEVEL_INFO, "Decompressing deflated iob: %d", *csp->iob->cur); -+ /* In theory (that is, according to RFC 1950), deflate-compressed -+ * data should begin with a two-byte zlib header and have an -+ * adler32 checksum at the end. It seems that in practice the -+ * only the raw compressed data is sent. Note that this means that -+ * we are not RFC 1950-compliant here, but the advantage is that -+ * this actually works. :) -+ * -+ * We add a dummy null byte to tell zlib where the data ends, -+ * and later inform it not to expect a header. -+ * -+ * Fortunately, add_to_iob() has thoughtfully null-terminated -+ * the buffer; we can just increment the end pointer to include -+ * the dummy byte. -+ */ -+ csp->iob->eod++; -+ } -+ else -+ { -+ log_error (LOG_LEVEL_ERROR, -+ "Unable to determine compression format for decompression"); -+ return JB_ERR_COMPRESS; -+ } -+ -+ /* Set up the fields required by zlib. */ -+ zstr.next_in = csp->iob->cur; -+ zstr.avail_in = csp->iob->eod - csp->iob->cur; -+ zstr.zalloc = Z_NULL; -+ zstr.zfree = Z_NULL; -+ zstr.opaque = Z_NULL; -+ -+ /* Passing -MAX_WBITS to inflateInit2 tells the library -+ * that there is no zlib header. -+ */ -+ if (inflateInit2 (&zstr, -MAX_WBITS) != Z_OK) -+ { -+ log_error (LOG_LEVEL_ERROR, -+ "Error initializing decompression"); -+ return JB_ERR_COMPRESS; -+ } -+ -+ /* Next, we allocate new storage for the inflated data. -+ * We don't modify the existing iob yet, so in case there -+ * is error in decompression we can recover gracefully. -+ */ -+ buf = zalloc (bufsize); -+ if (NULL == buf) -+ { -+ log_error (LOG_LEVEL_ERROR, -+ "Out of memory decompressing iob"); -+ return JB_ERR_MEMORY; -+ } -+ -+ assert(bufsize >= skip_size); -+ memcpy(buf, csp->iob->buf, skip_size); -+ zstr.avail_out = bufsize - skip_size; -+ zstr.next_out = buf + skip_size; -+ -+ /* Try to decompress the whole stream in one shot. */ -+ while (Z_BUF_ERROR == (status = inflate(&zstr, Z_FINISH))) -+ { -+ /* We need to allocate more memory for the output buffer. */ -+ -+ char *tmpbuf; /* used for realloc'ing the buffer */ -+ int oldbufsize = bufsize; /* keep track of the old bufsize */ -+ -+ /* If zlib wants more data then there's a problem, because -+ * the complete compressed file should have been buffered. -+ */ -+ if (0 == zstr.avail_in) -+ { -+ log_error(LOG_LEVEL_ERROR, -+ "Unexpected end of compressed iob"); -+ return JB_ERR_COMPRESS; -+ } -+ -+ /* If we tried the limit and still didn't have enough -+ * memory, just give up. -+ */ -+ if (bufsize == csp->config->buffer_limit) -+ { -+ log_error(LOG_LEVEL_ERROR, "Out of memory decompressing iob"); -+ return JB_ERR_MEMORY; -+ } -+ -+ /* Try doubling the buffer size each time. */ -+ bufsize *= 2; -+ -+ /* Don't exceed the buffer limit. */ -+ if (bufsize > csp->config->buffer_limit) -+ { -+ bufsize = csp->config->buffer_limit; -+ } -+ -+ /* Try to allocate the new buffer. */ -+ tmpbuf = realloc(buf, bufsize); -+ if (NULL == tmpbuf) -+ { -+ log_error(LOG_LEVEL_ERROR, "Out of memory decompressing iob"); -+ freez(buf); -+ return JB_ERR_MEMORY; -+ } -+ else -+ { -+ char *oldnext_out = zstr.next_out; -+ -+ /* Update the fields for inflate() to use the new -+ * buffer, which may be in a different location from -+ * the old one. -+ */ -+ zstr.avail_out += bufsize - oldbufsize; -+ zstr.next_out = tmpbuf + bufsize - zstr.avail_out; -+ -+ /* Compare with an uglier method of calculating these values -+ * that doesn't require the extra oldbufsize variable. -+ */ -+ assert(zstr.avail_out == -+ tmpbuf + bufsize - (char *)zstr.next_out); -+ assert((char *)zstr.next_out == -+ tmpbuf + ((char *)oldnext_out - buf)); -+ assert(zstr.avail_out > 0); -+ -+ buf = tmpbuf; -+ } -+ } -+ -+ inflateEnd(&zstr); -+ if (status != Z_STREAM_END) -+ { -+ /* We failed to decompress the stream. */ -+ log_error(LOG_LEVEL_ERROR, -+ "Error in decompressing to the buffer (iob): %s", -+ zstr.msg); -+ return JB_ERR_COMPRESS; -+ } -+ -+ /* Finally, we can actually update the iob, since the -+ * decompression was successful. First, free the old -+ * buffer. -+ */ -+ freez(csp->iob->buf); -+ -+ /* Now, update the iob to use the new buffer. */ -+ csp->iob->buf = buf; -+ csp->iob->cur = csp->iob->buf + skip_size; -+ csp->iob->eod = zstr.next_out; -+ csp->iob->size = bufsize; -+ -+ /* Make sure the new uncompressed iob obeys some minimal -+ * consistency conditions. -+ */ -+ if ((csp->iob->buf < csp->iob->cur) -+ && (csp->iob->cur <= csp->iob->eod) -+ && (csp->iob->eod <= csp->iob->buf + csp->iob->size)) -+ { -+ char t = csp->iob->cur[100]; -+ csp->iob->cur[100] = 0; -+ log_error(LOG_LEVEL_INFO, -+ "Sucessfully decompressed: %s", csp->iob->cur); -+ csp->iob->cur[100] = t; -+ return JB_ERR_OK; -+ } -+ else -+ { -+ /* It seems that zlib did something weird. */ -+ log_error(LOG_LEVEL_ERROR, -+ "Unexpected error decompressing the buffer (iob): %d==%d, %d>%d, %d<%d", csp->iob->cur, csp->iob->buf + skip_size, csp->iob->eod, csp->iob->buf, csp->iob->eod, csp->iob->buf + csp->iob->size); -+ return JB_ERR_COMPRESS; -+ } -+ -+} -+#endif /* defined(FEATURE_ZLIB) */ -+ -+ - /********************************************************************* - * - * Function : get_header -@@ -936,13 +1215,59 @@ - *********************************************************************/ - jb_err server_content_encoding(struct client_state *csp, char **header) - { -+#ifdef FEATURE_ZLIB -+ if (strstr(*header, "gzip")) -+ { -+ /* -+ * If the body was modified, we have tried to -+ * decompress it, so adjust the header if necessary. -+ */ -+ if ((csp->flags & CSP_FLAG_MODIFIED) /* we attempted to decompress */ -+ && !(csp->content_type & CT_TABOO)) /* decompression was successful */ -+ { -+ freez(*header); -+ *header = strdup("Content-Encoding: identity"); -+ return (header == NULL) ? JB_ERR_MEMORY : JB_ERR_OK; -+ } -+ else -+ { -+ csp->content_type |= CT_GZIP; -+ } -+ } -+ else if (strstr(*header, "deflate")) -+ { -+ /* -+ * If the body was modified, we have tried to -+ * decompress it, so adjust the header if necessary. -+ */ -+ if ((csp->flags & CSP_FLAG_MODIFIED) /* we attempted to decompress */ -+ && !(csp->content_type & CT_TABOO)) /* decompression was successful */ -+ { -+ freez(*header); -+ *header = strdup("Content-Encoding: identity"); -+ return (header == NULL) ? JB_ERR_MEMORY : JB_ERR_OK; -+ } -+ else -+ { -+ csp->content_type |= CT_DEFLATE; -+ } -+ } -+ else if (strstr(*header, "compress")) -+ { -+ /* We can't decompress this; therefore we can't filter -+ * it either. -+ */ -+ csp->content_type |= CT_TABOO; -+ } -+#else /* !defined(FEATURE_GZIP) */ - /* - * Turn off pcrs and gif filtering if body compressed - */ - if (strstr(*header, "gzip") || strstr(*header, "compress") || strstr(*header, "deflate")) - { -- csp->content_type = CT_TABOO; -+ csp->content_type |= CT_TABOO; - } -+#endif /* !defined(FEATURE_GZIP) */ - - return JB_ERR_OK; - -diff -urNad privoxy~/parsers.h privoxy/parsers.h ---- privoxy~/parsers.h -+++ privoxy/parsers.h -@@ -194,6 +194,7 @@ - - extern int flush_socket(jb_socket fd, struct client_state *csp); - extern jb_err add_to_iob(struct client_state *csp, char *buf, int n); -+extern jb_err decompress_iob(struct client_state *csp); - extern char *get_header(struct client_state *csp); - extern char *get_header_value(const struct list *header_list, const char *header_name); - extern char *sed(const struct parsers pats[], const add_header_func_ptr more_headers[], struct client_state *csp); -diff -urNad privoxy~/project.h privoxy/project.h ---- privoxy~/project.h -+++ privoxy/project.h -@@ -563,7 +563,7 @@ - #define JB_ERR_PARSE 4 /**< Error parsing file */ - #define JB_ERR_MODIFIED 5 /**< File has been modified outside of the - CGI actions editor. */ -- -+#define JB_ERR_COMPRESS 6 /**< Error on decompression */ - - /** - * This macro is used to free a pointer that may be NULL. -@@ -818,6 +818,15 @@ - #define CT_TABOO 4 /**< csp->content_type bitmask: - DO NOT filter, irrespective of other flags. */ - -+/* Although these are not, strictly speaking, content types -+ * (they are content encodings), it is simple to handle -+ * them as such. -+ */ -+#define CT_GZIP 8 /**< csp->content_type bitmask: -+ gzip-compressed data. */ -+#define CT_DEFLATE 16 /**< csp->content_type bitmask: -+ zlib-compressed data. */ -+ - /** - * The mask which includes all actions. - */ -@@ -862,6 +871,8 @@ - #define ACTION_VANILLA_WAFER 0x00008000UL - /** Action bitmap: Limit CONNECT requests to safe ports. */ - #define ACTION_LIMIT_CONNECT 0x00010000UL -+/** Action bitmap: Uncompress incoming text for filtering. */ -+#define ACTION_DECOMPRESS_IN 0x00020000UL - - /** Action string index: How to deanimate GIFs */ - #define ACTION_STRING_DEANIMATE 0 diff --git a/debian/patches/17_502_no_such_domain.dpatch b/debian/patches/17_502_no_such_domain.dpatch index 6eafee79..c77ba518 100755 --- a/debian/patches/17_502_no_such_domain.dpatch +++ b/debian/patches/17_502_no_such_domain.dpatch @@ -19,8 +19,8 @@ diff -urNad privoxy~/templates/no-such-domain privoxy/templates/no-such-domain -@@ -92,7 +92,7 @@ - +@@ -95,7 +95,7 @@ +
- 404 diff --git a/debian/patches/24_global_action.dpatch b/debian/patches/24_global_action.dpatch index e50ababc..bbf87add 100755 --- a/debian/patches/24_global_action.dpatch +++ b/debian/patches/24_global_action.dpatch @@ -32,16 +32,16 @@ diff -urNad privoxy~/config privoxy/config diff -urNad privoxy~/default.action.master privoxy/default.action.master --- privoxy~/default.action.master +++ privoxy/default.action.master -@@ -530,75 +530,6 @@ - # +@@ -537,74 +537,6 @@ allow-ads = -block -filter{banners-by-size} -filter{banners-by-link} --############################################################################# + ############################################################################# -# Defaults -############################################################################# -{ \ --add-header \ --block \ +--client-header-filter{hide-tor-exit-notation} \ --content-type-overwrite \ --crunch-client-header \ --crunch-if-none-match \ @@ -76,12 +76,7 @@ diff -urNad privoxy~/default.action.master privoxy/default.action.master --filter{yahoo} \ --filter{msn} \ --filter{blogspot} \ ---filter{xml-to-html} \ ---filter{html-to-xml} \ --filter{no-ping} \ ---filter{hide-tor-exit-notation} \ ---filter-client-headers \ ---filter-server-headers \ --force-text-mode \ --handle-as-empty-document \ --handle-as-image \ @@ -100,24 +95,29 @@ diff -urNad privoxy~/default.action.master privoxy/default.action.master --redirect \ --send-vanilla-wafer \ --send-wafer \ +--server-header-filter{xml-to-html} \ +--server-header-filter{html-to-xml} \ --session-cookies-only \ -+set-image-blocker{pattern} \ --treat-forbidden-connects-like-blocks \ -} -/ # Match all URLs - - ############################################################################# +- +-############################################################################# # These extensions belong to images: + ############################################################################# + {+handle-as-image -filter} diff -urNad privoxy~/global.action privoxy/global.action --- privoxy~/global.action +++ privoxy/global.action -@@ -0,0 +1,69 @@ +@@ -0,0 +1,67 @@ +############################################################################# +# Defaults +############################################################################# +{ \ +-add-header \ +-block \ ++-client-header-filter{hide-tor-exit-notation} \ +-content-type-overwrite \ +-crunch-client-header \ +-crunch-if-none-match \ @@ -152,12 +152,7 @@ diff -urNad privoxy~/global.action privoxy/global.action +-filter{yahoo} \ +-filter{msn} \ +-filter{blogspot} \ -+-filter{xml-to-html} \ -+-filter{html-to-xml} \ +-filter{no-ping} \ -+-filter{hide-tor-exit-notation} \ -+-filter-client-headers \ -+-filter-server-headers \ +-force-text-mode \ +-handle-as-empty-document \ +-handle-as-image \ @@ -176,6 +171,8 @@ diff -urNad privoxy~/global.action privoxy/global.action +-redirect \ +-send-vanilla-wafer \ +-send-wafer \ ++-server-header-filter{xml-to-html} \ ++-server-header-filter{html-to-xml} \ +-session-cookies-only \ ++set-image-blocker{pattern} \ +-treat-forbidden-connects-like-blocks \ diff --git a/debian/patches/25_standard_medium.dpatch b/debian/patches/25_standard_medium.dpatch index 83db7485..84466a5b 100755 --- a/debian/patches/25_standard_medium.dpatch +++ b/debian/patches/25_standard_medium.dpatch @@ -10,7 +10,7 @@ diff -urNad privoxy~/global.action privoxy/global.action --- privoxy~/global.action +++ privoxy/global.action -@@ -10,29 +10,29 @@ +@@ -11,29 +11,29 @@ -crunch-outgoing-cookies \ -crunch-incoming-cookies \ -crunch-server-header \ @@ -47,22 +47,24 @@ diff -urNad privoxy~/global.action privoxy/global.action -filter{site-specifics} \ -filter{google} \ -filter{yahoo} \ -@@ -52,17 +52,17 @@ +@@ -48,19 +48,19 @@ -hide-if-modified-since \ +hide-forwarded-for-headers \ +hide-from-header{block} \ --hide-referrer \ -++hide-referrer{forge} \ +++hide-referrer{conditional-block} \ -hide-user-agent \ -inspect-jpegs \ -kill-popups \ -limit-connect \ --prevent-compression \ -++prevent-compression \ -overwrite-last-modified \ ++-prevent-compression \ -redirect \ -send-vanilla-wafer \ -send-wafer \ + -server-header-filter{xml-to-html} \ + -server-header-filter{html-to-xml} \ --session-cookies-only \ ++session-cookies-only \ +set-image-blocker{pattern} \ diff --git a/debian/patches/26_edit_only_writable.dpatch b/debian/patches/26_edit_only_writable.dpatch deleted file mode 100755 index de751138..00000000 --- a/debian/patches/26_edit_only_writable.dpatch +++ /dev/null @@ -1,60 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 26_edit_only_writable.dpatch by Fabian Keil -## -## 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. -## DP: Extended version action.patch by Fabian Keil which shows a -## DP: message, that the file is write protected. -## DP: http://sf.net/tracker/?func=detail&atid=311118&aid=1564026&group_id=11118 - -@DPATCH@ -diff -urNad privoxy~/cgisimple.c privoxy/cgisimple.c ---- privoxy~/cgisimple.c -+++ privoxy/cgisimple.c -@@ -248,6 +248,10 @@ - #include - #include - -+#ifdef HAVE_ACCESS -+#include -+#endif /* def HAVE_ACCESS */ -+ - #ifdef _WIN32 - #define snprintf _snprintf - #endif /* def _WIN32 */ -@@ -1040,8 +1044,20 @@ - #ifdef FEATURE_CGI_EDIT_ACTIONS - if (NULL == strstr(csp->actions_list[i]->filename, "standard.action") && NULL != csp->config->actions_file_short[i]) - { -- snprintf(buf, 100, "  Edit", csp->config->actions_file_short[i]); -- if (!err) err = string_append(&s, buf); -+#ifdef HAVE_ACCESS -+ if (access(csp->config->actions_file[i], W_OK) == 0) -+ { -+#endif /* def HAVE_ACCESS */ -+ snprintf(buf, 100, "  Edit", -+ csp->config->actions_file_short[i]); -+ if (!err) err = string_append(&s, buf); -+#ifdef HAVE_ACCESS -+ } -+ else -+ { -+ if (!err) err = string_append(&s, "  File is write protected."); -+ } -+#endif /* def HAVE_ACCESS */ - } - #endif - -diff -urNad privoxy~/configure.in privoxy/configure.in ---- privoxy~/configure.in -+++ privoxy/configure.in -@@ -1129,7 +1129,7 @@ - AC_TYPE_SIGNAL - dnl uncommenting does not work for swa. suse linux - dnl AC_FUNC_STAT --AC_CHECK_FUNCS([atexit getcwd gethostbyaddr gethostbyaddr_r gethostbyname gethostbyname_r inet_ntoa localtime_r memchr memmove memset random regcomp select setlocale socket strchr strdup strerror strftime strptime strstr strtoul timegm]) -+AC_CHECK_FUNCS([access atexit getcwd gethostbyaddr gethostbyaddr_r gethostbyname gethostbyname_r inet_ntoa localtime_r memchr memmove memset random regcomp select setlocale socket strchr strdup strerror strftime strptime strstr strtoul timegm]) - - - dnl ================================================================= diff --git a/debian/patches/27_remove_nsl.dpatch b/debian/patches/27_remove_nsl.dpatch index 4f20cf6c..988d988e 100755 --- a/debian/patches/27_remove_nsl.dpatch +++ b/debian/patches/27_remove_nsl.dpatch @@ -8,7 +8,7 @@ diff -urNad privoxy~/configure.in privoxy/configure.in --- privoxy~/configure.in +++ privoxy/configure.in -@@ -886,7 +886,7 @@ +@@ -923,7 +923,7 @@ dnl ================================================================= dnl Next line needed to find the gethost*_r functions on Solaris diff --git a/debian/patches/29_usermanual.dpatch b/debian/patches/29_usermanual.dpatch new file mode 100755 index 00000000..e5ff6654 --- /dev/null +++ b/debian/patches/29_usermanual.dpatch @@ -0,0 +1,55 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 29_usermanual.dpatch by Roland Rosenfeld +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: fix some broken markup in user-manual.sgml + +@DPATCH@ +diff -urNad privoxy~/doc/source/user-manual.sgml privoxy/doc/source/user-manual.sgml +--- privoxy~/doc/source/user-manual.sgml ++++ privoxy/doc/source/user-manual.sgml +@@ -452,7 +452,7 @@ + + + Header filtering can be done with dedicated header filters now. As a result +- the actions filter-client-headers and filter-server-headers ++ the actions filter-client-headers and filter-server-headers + that were introduced with Privoxy 3.0.5 to apply + the content filters to the headers as, well have been removed again. + +@@ -2442,8 +2442,6 @@ + + + +- +- + + + +@@ -4079,7 +4077,7 @@ + + + forward-socks4a 127.0.0.1:9050 . to use the socks4a proxy listening at 127.0.0.1 port 9050. +- Replace forward-socks4a with forward-socks4 to use a socks4 connection (with local DNS ++ Replace forward-socks4a with forward-socks4 to use a socks4 connection (with local DNS + resolution) instead. + + +@@ -4087,7 +4085,7 @@ + + forward-socks4a 127.0.0.1:9050 proxy.example.org:8000 to use the socks4a proxy + listening at 127.0.0.1 port 9050 to reach the HTTP proxy listening at proxy.example.org port 8000. +- Replace forward-socks4a with forward-socks4 to use a socks4 connection (with local DNS ++ Replace forward-socks4a with forward-socks4 to use a socks4 connection (with local DNS + resolution) instead. + + +@@ -4116,7 +4114,7 @@ + to exit. + + +- Use the show-url-info CGI page ++ Use the show-url-info CGI page + to verify that your forward settings do what you thought the do. + + diff --git a/debian/patches/30_actionsfile_fullname.dpatch b/debian/patches/30_actionsfile_fullname.dpatch new file mode 100755 index 00000000..3a55d003 --- /dev/null +++ b/debian/patches/30_actionsfile_fullname.dpatch @@ -0,0 +1,27 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 30_actionsfile_fullname.dpatch by Roland Rosenfeld +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: The "actionsfile" syntax in the configuration file is consistent +## DP: with the rest of the configuration options and requires the +## DP: whole file name. + +@DPATCH@ +diff -urNad privoxy~/config privoxy/config +--- privoxy~/config ++++ privoxy/config +@@ -334,10 +334,10 @@ + # privacy considerations, etc. There is no point in using Privoxy + # 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 ++actionsfile standard.action # Internal purpose, recommended ++actionsfile global.action # Global default setting for all sites ++actionsfile default.action # Main actions file ++actionsfile user.action # User customizations + + # + # 2.4. filterfile diff --git a/debian/postinst b/debian/postinst index ccf2a17b..4f9a0e00 100644 --- a/debian/postinst +++ b/debian/postinst @@ -25,15 +25,8 @@ set -e case "$1" in configure) - if ! adduser --quiet --system --home /etc/privoxy --no-create-home \ - --ingroup nogroup --disabled-password privoxy - then - # user privoxy seems to exist - # -> remove him before newly adding him. - deluser --quiet privoxy - adduser --quiet --system --home /etc/privoxy --no-create-home \ - --ingroup nogroup --disabled-password privoxy - fi + adduser --quiet --system --home /etc/privoxy --no-create-home \ + --ingroup nogroup --disabled-password privoxy chown -R privoxy.adm /var/log/privoxy chmod 750 /var/log/privoxy chown privoxy /etc/privoxy/user.action /etc/privoxy/trust diff --git a/debian/postrm b/debian/postrm index b79c8ec6..3b761d09 100644 --- a/debian/postrm +++ b/debian/postrm @@ -20,7 +20,7 @@ set -e case "$1" in purge) - deluser --quiet privoxy + # deluser --quiet privoxy rm -rf /var/log/privoxy /etc/privoxy ;; diff --git a/debian/rules b/debian/rules index 8f6c4a54..6e7ada55 100755 --- a/debian/rules +++ b/debian/rules @@ -33,6 +33,7 @@ build-stamp: patch-stamp env CFLAGS="$(OPTIMIZE) -g" \ ./configure --prefix=/usr --sysconfdir=/etc \ --mandir=/usr/share/man $(WITHDEBUG) \ + --enable-zlib \ --with-docbook=/usr/share/sgml/docbook/stylesheet/dsssl/modular $(MAKE) # create missing doc/pdf directory if necessary: