Your message dated Fri, 04 Jan 2008 21:17:02 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#447033: fixed in apt-cacher 1.6.0
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: apt-cacher
Version: 1.5.5
Severity: important
Tags: patch

Apt-cacher failed to fetch any files from the mirrors after upgrading to
1.5.5. We tracked down the reason for this to /usr/sbin/apt-cacher lines
528 and the following where apt-cacher tries to distinguish between
requests targeted at itself ("host mode") and those targeted at other servers
("proxy mode"). To this end, apt-cacher tries to connect to the target host
and then compares the normalized address as read from the connected socket
against its configuration settings. It also tries to take a short cut there
and refuse the entire request if this connection attempt fails.

Unfortunately, the proxy settings (use_proxy, http_proxy) are ignored at
this stage. So every client request for "proxy mode" must fail if the use
of an http proxy is required to complete it.

I have created a workaround (see the patch included below) that is based
on the following rules:
 - Assume that the use of an http proxy is not required to connect to any
   address that apt-cacher recognizes as its own.
 - If use_proxy is set and the connection fails then treat it as an
   indication that "proxy mode" is to be used, and do not refuse the
   request at this point.


Relevant information:


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

Kernel: Linux 2.6.21-2-686 (SMP w/1 CPU core)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages apt-cacher depends on:
ii  bzip2                         1.0.3-7    high-quality block-sorting file co
ii  libwww-perl                   5.805-1    WWW client/server library for Perl
ii  perl                          5.8.8-7    Larry Wall's Practical Extraction

apt-cacher recommends no packages.

-- no debconf information


Excerpt from an apt-cacher/error.log written by the debug enabled,
unpatched version:

Wed Oct 17 14:16:34 2007|local|debug [5806]: Apt-Cacher started with Debug 
output enabled, accepting connections...
Wed Oct 17 14:16:39 2007|146.140.220.150|debug [5806]: Connection from 
146.140.220.150
Wed Oct 17 14:16:39 2007|146.140.220.150|debug [5807]: New HTTP connection open
Wed Oct 17 14:16:39 2007|146.140.220.150|debug [5807]: testing allowed_hosts
Wed Oct 17 14:16:39 2007|146.140.220.150|debug [5807]: checking against 
146.140.220.0/23
Wed Oct 17 14:16:39 2007|146.140.220.150|debug [5806]: registred child process: 
5807
Wed Oct 17 14:16:39 2007|146.140.220.150|debug [5807]: testing denied_hosts
Wed Oct 17 14:16:39 2007|146.140.220.150|debug [5807]: Client 146.140.220.150 
passed access control rules
Wed Oct 17 14:16:39 2007|146.140.220.150|debug [5807]: Processing a new request 
line
Wed Oct 17 14:16:39 2007|146.140.220.150|debug [5807]: got: GET 
http://security.debian.org/dists/stable/updates/Release.gpg HTTP/1.1
Wed Oct 17 14:16:39 2007|146.140.220.150|debug [5807]: Processing a new request 
line
Wed Oct 17 14:16:39 2007|146.140.220.150|debug [5807]: got: Host:
+security.debian.org
Wed Oct 17 14:16:39 2007|146.140.220.150|debug [5807]: Processing a new request 
line
Wed Oct 17 14:16:39 2007|146.140.220.150|debug [5807]: got: Cache-Control: 
max-age=0
Wed Oct 17 14:16:39 2007|146.140.220.150|debug [5807]: Processing a new request 
line
Wed Oct 17 14:16:39 2007|146.140.220.150|debug [5807]: got: User-Agent: Debian 
APT-HTTP/1.3 (0.7.6)
Wed Oct 17 14:16:39 2007|146.140.220.150|debug [5807]: Processing a new request 
line
Wed Oct 17 14:16:39 2007|146.140.220.150|debug [5807]: got:
Wed Oct 17 14:16:39 2007|146.140.220.150|debug [5807]: Checking host 
security.debian.org in absolute URI
Wed Oct 17 14:16:39 2007|146.140.220.150|info [5807]: Unable to connect to 
security.debian.org

The log is not particularly helpful as to the cause but it shows where the
refusal originates: The last log message is written in apt-cacher,
line 537, and the child sends a 404 back to the client and exits at that
point.


Now for the indicated workaround. In the presence of the use_proxy option,
a possible failed connect is ignored in line 536, and taken as an
indication of a non-local address in line 544. We also have to guard
$sock being undef'd, or the child will silently die. (Might consider
logging non-zero exit codes from child processes.)

The diff:

pluto:~# diff -c /usr/sbin/apt-cacher.orig /usr/sbin/apt-cacher
*** /usr/sbin/apt-cacher.orig   2007-10-17 14:40:42.000000000 +0200
--- /usr/sbin/apt-cacher        2007-10-17 14:47:36.000000000 +0200
***************
*** 533,539 ****
                                                              # overridden if 
port
                                                              # also in PeerAddr
                                             Proto   => "tcp");
!           if (!defined $sock) {
                info_message("Unable to connect to $1");
                &sendrsp(404, "Unable to connect to $1");
                exit(4);
--- 533,539 ----
                                                              # overridden if 
port
                                                              # also in PeerAddr
                                             Proto   => "tcp");
!           if ( (!defined $sock) && (!$$cfg{use_proxy}) ) {
                info_message("Unable to connect to $1");
                &sendrsp(404, "Unable to connect to $1");
                exit(4);
***************
*** 541,548 ****
            # Both host and port need to be matched.  In inetd mode daemon_port
            # is read from inetd.conf by get_inetd_port(). CGI mode shouldn't
            # get absolute URLs.
!           if ($sock->sockhost =~ $sock->peerhost &&
!               $sock->peerport == $$cfg{daemon_port}) { # Host is this host
                debug_message("Host in Absolute URI is this server");
                $path =~ s!^http://[^/]+!!; # Remove prefix and hostname
            }
--- 541,548 ----
            # Both host and port need to be matched.  In inetd mode daemon_port
            # is read from inetd.conf by get_inetd_port(). CGI mode shouldn't
            # get absolute URLs.
!           if ((defined $sock) && ($sock->sockhost =~ $sock->peerhost &&
!               $sock->peerport == $$cfg{daemon_port})) { # Host is this host
                debug_message("Host in Absolute URI is this server");
                $path =~ s!^http://[^/]+!!; # Remove prefix and hostname
            }
***************
*** 550,556 ****
                debug_message("Host in Absolute URI is not this server");
                $path =~ s!^http:/!!; # Remove absolute prefix
            }
!           $sock->shutdown(2); # Close
        }
        debug_message("Resolved request is $path");

--- 550,556 ----
                debug_message("Host in Absolute URI is not this server");
                $path =~ s!^http:/!!; # Remove absolute prefix
            }
!           defined($sock) and $sock->shutdown(2); # Close
        }
        debug_message("Resolved request is $path");

End of diff.


Sincerely,
   Ralph Rößner


-- 
Ralph Rößner
CAPCom AG < http://www.capcom.de >
Rundeturmstr. 10, 64283 Darmstadt, Germany
Phone +49 6151 155 900, Fax +49 6151 155 909

Vorstand: Luc Neumann (Vorsitzender)
Vorsitzender des Aufsichtsrats: Prof. Dr.-Ing. José L. Encarnação
Sitz der Gesellschaft: Darmstadt, Registergericht: Darmstadt HRB 8090



--- End Message ---
--- Begin Message ---
Source: apt-cacher
Source-Version: 1.6.0

We believe that the bug you reported is fixed in the latest version of
apt-cacher, which is due to be installed in the Debian FTP archive:

apt-cacher_1.6.0.dsc
  to pool/main/a/apt-cacher/apt-cacher_1.6.0.dsc
apt-cacher_1.6.0.tar.gz
  to pool/main/a/apt-cacher/apt-cacher_1.6.0.tar.gz
apt-cacher_1.6.0_all.deb
  to pool/main/a/apt-cacher/apt-cacher_1.6.0_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Mark Hindley <[EMAIL PROTECTED]> (supplier of updated apt-cacher package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Wed, 05 Dec 2007 10:45:57 +0000
Source: apt-cacher
Binary: apt-cacher
Architecture: source all
Version: 1.6.0
Distribution: unstable
Urgency: low
Maintainer: Mark Hindley <[EMAIL PROTECTED]>
Changed-By: Mark Hindley <[EMAIL PROTECTED]>
Description: 
 apt-cacher - Caching proxy for Debian package and source files
Closes: 369433 427695 447033 447933 451700
Changes: 
 apt-cacher (1.6.0) unstable; urgency=low
 .
   * Major new release.
   * IPv6 support (using libcurl and optional libio-socket-inet6-perl)
     (closes: #447933, #451700).
   * Experimental support for patching cached Packages and Sources with
     pdiffs. (closes: #427695)
   * Checksumming rewritten and now uses Berkeley DB for speed and reduced
     resource utilisation.
   * Checksum database manipulation with apt-cacher-cleanup.
   * Daemon mode can now listen on multiple addresses.
   * ETag support.
   * Respect Cache-Control headers (closes: #369433).
   * Don't assume host is not reachable if use_proxy set. Thanks to Ralph
     Rößner for patch. (closes: #447033)
   * apt-cacher-cleanup: verify SHA1 of debs and remove if mismatch.
Files: 
 6ab8f7aff7e012dfbd801d1bb472ed4d 615 net optional apt-cacher_1.6.0.dsc
 c370ef07f8ed9c06da20c6b1012f2cc9 92072 net optional apt-cacher_1.6.0.tar.gz
 609bcf5ec59903e1ddbaa04e168125ae 72784 net optional apt-cacher_1.6.0_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHXEab4QZIHu3wCMURAodVAJ4+ug7djbTi64AZPt+ROYKhST+H9QCfXZtj
eU3Vl4+ZPtQuxCX4/TGplKA=
=//im
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to