Package: tinyproxy
Version: 1.8.1-4
Severity: important
Tags: upstream patch

The 1.8 series of tinyproxy never matches an upstream "site_spec" rule
due to a small error in the config file handler. Patch attached
(against 1.8.1-4).

Using the following upstream rule, no default:
upstream 127.0.0.1:8080 ".google.com"

Current behavour (log file):
INFO Jun 08 21:30:12 [11459]: Added upstream 127.0.0.1:8080 for  ".google.com"
...
CONNECT Jun 08 21:31:43 [11460]: Request (file descriptor 6): GET
http://www.google.com/ HTTP/1.0
INFO Jun 08 21:31:43 [11460]: No proxy for www.google.com

Expected behavour (log file):
INFO Jun 08 21:46:52 [11511]: Added upstream 127.0.0.1:8080 for .google.com
...
CONNECT Jun 08 21:48:02 [11512]: Request (file descriptor 6): GET
http://www.google.com/ HTTP/1.0
INFO Jun 08 21:48:02 [11512]: Found proxy 127.0.0.1:8080 for www.google.com

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-3-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages tinyproxy depends on:
ii  libc6                         2.10.2-9   Embedded GNU C Library: Shared lib
ii  logrotate                     3.7.8-6    Log rotation utility

tinyproxy recommends no packages.

tinyproxy suggests no packages.

-- no debconf information
diff -ru a/src/conf.c b/src/conf.c
--- a/src/conf.c	2010-06-08 03:28:02.000000000 +0100
+++ b/src/conf.c	2010-06-08 21:27:16.000000000 +0100
@@ -1022,8 +1022,8 @@
                 return -1;
         port = (int) get_long_arg (line, &match[7]);
 
-        if (match[9].rm_so != -1) {
-                domain = get_string_arg (line, &match[9]);
+        if (match[10].rm_so != -1) {
+                domain = get_string_arg (line, &match[10]);
                 if (domain) {
                         upstream_add (ip, port, domain, &conf->upstream_list);
                         safefree (domain);

Reply via email to