Menu

#1706 Can't use literal \. in domain blocking?

3.0.21
pending
nobody
5
2016-03-24
2016-03-13
No

Hi.

Why is privoxy ignoring literal . (aka .) character when trying to block whole domain in user.action file?

For example:

{ +block }
www.taloussanomat.fi

does not work for http://www.taloussanomat.fi/sivu.php?page_id=1?

Discussion

  • Fabian Keil

    Fabian Keil - 2016-03-14

    In traditional host patterns (which are used by default) the dot
    is a delimiter character:
    http://www.privoxy.org/user-manual/actions-file.html#HOST-PATTERN

    "Escaping" it is neither necessary nor supported.

    If you configure with --enable-extended-host-patterns, Privoxy
    will use PCRE for host patterns as well in which case the dot
    is no longer a delimiter and "." can be used to match the
    literal dot.

     
    • Stefan Fröberg

      Stefan Fröberg - 2016-03-14

      Thank you. I will then build privoxy with that switch. I have a huge blocklist with \. characters that I use with other software, like squid too.

      One more thing: I tried cross-compiling latest privoxy from fedora to windows (mingw).
      I also cross-compiled zlib and pcre dll's for it too. I then tried the privoxy.exe and it gives me
      "can't load actions file .\default.action: line 641: cannot create URL or TAG pattern from: .ad???*"

      Could it be because my cross-compiled pcre dll that is somehow screwed?
      (I compiled it with JIT support enabled if it matters)

       

      Last edit: Stefan Fröberg 2016-03-14
  • Fabian Keil

    Fabian Keil - 2016-03-21

    This probably has nothing to do with cross compilation.

    "ad???*" is not a valid pcre pattern.

    You can use url-pattern-translator.pl to convert action files from
    "traditional host pattern" to "extended host pattern" syntax:
    http://ijbswa.cvs.sourceforge.net/viewvc/ijbswa/current/tools/url-pattern-translator.pl?view=markup

    Note that transformation in the other direction is not supported.

    P.S.: Please don't use the "edit post" feature for essential edits as
    they don't result in email notifications.

     
  • Fabian Keil

    Fabian Keil - 2016-03-21
    • status: open --> closed
     
  • Fabian Keil

    Fabian Keil - 2016-03-21
    • status: closed --> pending
     
  • Stefan Fröberg

    Stefan Fröberg - 2016-03-24

    Thank you! It now works perfectly with my blocklist
    http://185.82.200.39/blocklist.txt

     

Log in to post a comment.