Package: polipo
Version: 1.0.4.1-1.1
Severity: wishlist

I seed ~/.polipo-forbidden based on the "adblockplus" database[0].  I
updated this for the first time since 10 Jun 2010.  Shortly after
this, I noticed that 1) polipo doesn't respond to most requests from
my browser[1]; and 2) polipo.log shows a new (I think) error:

    Couldn't compile regex: 13.

Since this wasn't very helpful and "13" didn't appear to be a line
number, I checked the source.  The message comes from forbidden.c[2];
13 is the value returned by regcomp(3).

The regcomp(3) manpage indicates that regerror(3) can be used to
generate a more detailed (i.e. useful) error message.  Please use it.

[0] The script I use it this:

    {
      curl -sL http://easylist.adblockplus.org/easyprivacy.txt
      curl -sL http://easylist.adblockplus.org/easylist_noelemhide.txt
    } |
                                    # Ref. http://adblockplus.org/en/filters
    sed '/^\[/d' |                  # leading [ means section (comment)
    sed 's/^!/#/' |                 # leading ! means comment
    sed '/^@@/d' |                  # leading @@ means whitelist (not handled)
    sed '/\$/d' |                   # any $ means "options" (not handled)
    sed 's/[.?]/\\&/g' |            # any . or ? is a literal . or ?
    sed 's!\*!.*!g' |               # any * means anything-at-all
    sed 's!\^![^[:alnum:].%-]!g' |  # any ^ means separator
    sed 's!^||!https?://!' |        # leading || means any-protocol
    sed 's/|$/$/' |                 # trailing | means end-of-string
    sed 's/^|/^/' |                 # leading | means beginning-of-string
    sed '/|/d'                      # any other | is bad juju

[1] $ curl -vso/dev/null http://example.net/
    * Couldn't find host example.net in the .netrc file; using defaults
    * About to connect() to proxy 127.0.0.1 port 8080 (#0)
    *   Trying 127.0.0.1...   C-c C-c

[2] if(rlen > 0) {
        regex = malloc(sizeof(regex_t));
        rc = regcomp(regex, regexbuf, REG_EXTENDED | REG_NOSUB);
        if(rc != 0) {
            do_log(L_ERROR, "Couldn't compile regex: %d.\n", rc);
            free(regex);
            regex = NULL;
        }
    } else {
        regex = NULL;
    }
    free(regexbuf);

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.35-rc3 (SMP w/2 CPU cores)
Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to